:root {
  --primary: #f24e1e;
  --primary-dark: #d8430f;
  --primary-light: #fff0ea;
  --accent: #146ef5;
  --text: #1f2430;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f6f7fb;
  --card-bg: #ffffff;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(31, 36, 48, 0.07);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== 顶部导航 ===== */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.site-header .header-link {
  color: var(--muted);
  font-size: 14px;
}

/* ===== 首页 ===== */
.page-home .site-header {
  background: transparent;
  border-bottom-color: rgba(255, 255, 255, 0.25);
}

.page-home .brand {
  color: #fff;
}

.home-main {
  min-height: calc(100vh - 120px);
}

.hero {
  background: linear-gradient(135deg, #ff8c42 0%, #f24e1e 55%, #e2340f 100%);
  color: #fff;
  text-align: center;
  padding: 90px 16px 110px;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 44px);
  margin: 0 0 10px;
  letter-spacing: 1px;
}

.hero-sub {
  font-size: 17px;
  opacity: 0.92;
  margin: 0 0 28px;
}

.notice-banner {
  display: inline-block;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 8px 22px;
  font-size: 14px;
  margin-bottom: 34px;
}

.home-actions {
  display: flex;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.btn-lg {
  padding: 22px 34px;
  min-width: 240px;
}

.btn-rent {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.btn-rent:hover {
  background: #fff7f2;
}

.btn-find {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.btn-find:hover {
  background: rgba(255, 255, 255, 0.24);
}

.btn-icon {
  font-size: 34px;
  line-height: 1;
}

.btn-text {
  text-align: left;
  display: flex;
  flex-direction: column;
}

.btn-text strong {
  font-size: 21px;
  line-height: 1.3;
}

.btn-text small {
  font-size: 13px;
  opacity: 0.75;
  font-weight: 400;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  padding: 12px 28px;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  padding: 10px 22px;
}

.btn-outline:hover {
  background: var(--primary-light);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 8px;
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-green {
  background: var(--green);
  color: #fff;
}

.btn-green:hover {
  background: #15803d;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 18px 16px;
}

.site-footer p {
  margin: 0;
}

/* ===== 页面主体 ===== */
.page-main {
  padding: 30px 0 60px;
  min-height: calc(100vh - 140px);
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.page-head h2 {
  margin: 0;
  font-size: 24px;
}

.page-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* ===== 表单 ===== */
.form-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  max-width: 680px;
  margin: 0 auto;
}

.form-card h2 {
  margin: 0 0 6px;
}

.form-card .form-intro {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 22px;
}

.form-field {
  margin-bottom: 18px;
}

.form-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-field .required {
  color: var(--primary);
}

.form-field input[type="text"],
.form-field input[type="number"],
.form-field input[type="password"],
.form-field textarea,
.form-field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-field textarea {
  resize: vertical;
  min-height: 130px;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(242, 78, 30, 0.12);
}

.form-field .hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}

.form-field.has-error input,
.form-field.has-error textarea {
  border-color: var(--red);
}

.field-error {
  color: var(--red);
  font-size: 13px;
  margin-top: 5px;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.checkbox-line input {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
}

.checkbox-line span {
  font-size: 14px;
  color: var(--muted);
}

.form-actions {
  margin-top: 24px;
}

.form-actions .btn {
  width: 100%;
  padding: 13px;
  font-size: 17px;
  font-weight: 600;
}

.form-note {
  background: #fffbe6;
  border: 1px solid #fde68a;
  border-radius: 10px;
  color: #92400e;
  font-size: 13px;
  padding: 10px 14px;
  margin-top: 16px;
}

.alert {
  border-radius: 10px;
  padding: 13px 16px;
  font-size: 14px;
  margin-bottom: 18px;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

.flash {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 14px;
  transition: opacity 0.6s ease;
}

/* ===== 列表页 ===== */
.listings-head {
  margin-bottom: 16px;
}

.listings-head h2 {
  margin: 0;
  font-size: 24px;
}

.listings-head p {
  color: var(--muted);
  font-size: 14px;
  margin: 4px 0 0;
}

.sort-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 20px;
}

.sort-bar .sort-label {
  font-size: 13px;
  color: var(--muted);
  margin-right: 4px;
}

.sort-link {
  font-size: 14px;
  color: var(--text);
  padding: 7px 14px;
  border-radius: 999px;
}

.sort-link:hover {
  background: var(--bg);
  text-decoration: none;
}

.sort-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.listing-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.listing-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(31, 36, 48, 0.12);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.card-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
  color: var(--text);
}

.card-title a {
  color: inherit;
}

.card-title a:hover {
  color: var(--primary);
}

.area-badge {
  flex-shrink: 0;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.card-price {
  color: var(--primary);
  font-size: 20px;
  font-weight: 700;
}

.card-price.negotiable {
  color: var(--amber);
}

.card-desc {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 42px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}

.card-meta .dot {
  opacity: 0.5;
}

.card-contact {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
}

.card-contact .phone-link {
  color: var(--green);
  font-weight: 600;
}

.card-contact .wechat {
  color: var(--muted);
}

.empty-state {
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  padding: 70px 20px;
  color: var(--muted);
}

.empty-state .empty-icon {
  font-size: 44px;
  display: block;
  margin-bottom: 10px;
}

.empty-state p {
  margin: 0 0 18px;
}

/* ===== 分页 ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.page-link {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font-size: 14px;
}

.page-link:hover {
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}

.page-link.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

.page-link.disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* ===== 详情页 ===== */
.detail-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  max-width: 760px;
  margin: 0 auto;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.detail-head h2 {
  margin: 0;
  font-size: 23px;
}

.detail-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.tag {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  padding: 4px 12px;
}

.tag.price-tag {
  background: var(--primary-light);
  border-color: #ffd1bd;
  color: var(--primary);
  font-weight: 700;
}

.detail-price {
  color: var(--primary);
  font-size: 26px;
  font-weight: 700;
  white-space: nowrap;
}

.detail-price.negotiable {
  color: var(--amber);
}

.detail-desc {
  color: var(--text);
  font-size: 15px;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 20px;
}

.detail-contact {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.detail-contact .contact-label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 2px;
}

.detail-contact .contact-value {
  font-size: 18px;
  font-weight: 700;
}

.detail-contact .contact-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-back {
  display: block;
  text-align: center;
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
}

.detail-notice {
  background: #fffbe6;
  border: 1px solid #fde68a;
  border-radius: 10px;
  color: #92400e;
  font-size: 13px;
  padding: 10px 14px;
  margin-top: 16px;
}

/* ===== 管理后台 ===== */
.admin-header {
  background: #1c2333;
  color: #fff;
}

.admin-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  min-height: 60px;
}

.admin-header .brand {
  color: #fff;
  font-size: 17px;
}

.admin-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.admin-nav a {
  color: #c7d0e0;
  font-size: 14px;
  padding: 7px 12px;
  border-radius: 8px;
}

.admin-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.admin-main {
  padding: 26px 0 60px;
}

.admin-main h2 {
  margin: 0 0 16px;
  font-size: 22px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.stat-card .stat-num {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
}

.stat-card .stat-label {
  color: var(--muted);
  font-size: 13px;
}

.stat-card.stat-pending .stat-num {
  color: var(--amber);
}

.stat-card.stat-approved .stat-num {
  color: var(--green);
}

.stat-card.stat-hidden .stat-num {
  color: var(--muted);
}

.admin-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 22px;
}

.admin-panel h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
}

.filter-tab:hover {
  text-decoration: none;
  border-color: var(--primary);
  color: var(--primary);
}

.filter-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

.search-form {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.search-form input[type="text"] {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  width: 200px;
}

.table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table th {
  background: var(--bg);
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.admin-table tr:hover td {
  background: #fafbfd;
}

.badge {
  display: inline-block;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-pending {
  background: #fef3c7;
  color: #b45309;
}

.badge-approved {
  background: #dcfce7;
  color: #15803d;
}

.badge-hidden {
  background: #e5e7eb;
  color: #4b5563;
}

.action-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.action-btns form {
  margin: 0;
}

.inline-link {
  font-size: 13px;
  color: var(--accent);
}

/* ===== 后台登录页 ===== */
.login-page {
  background: linear-gradient(135deg, #ff8c42 0%, #f24e1e 55%, #e2340f 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-box {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
  padding: 36px;
  width: 100%;
  max-width: 400px;
}

.login-box h1 {
  margin: 0 0 6px;
  font-size: 22px;
  text-align: center;
}

.login-box .login-sub {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 24px;
}

/* ===== 安装向导 ===== */
.install-page {
  background: var(--bg);
  min-height: 100vh;
  padding: 40px 16px 60px;
}

.install-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  max-width: 720px;
  margin: 0 auto;
  padding: 32px;
}

.install-box h1 {
  margin: 0 0 6px;
  font-size: 24px;
}

.install-box .install-sub {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 22px;
}

.check-list {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
}

.check-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}

.check-list .ok {
  color: var(--green);
  font-weight: 600;
}

.check-list .fail {
  color: var(--red);
  font-weight: 600;
}

.install-box h2 {
  font-size: 17px;
  margin: 24px 0 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 60px 16px 80px;
  }

  .btn-lg {
    min-width: 100%;
  }

  .form-card,
  .detail-card {
    padding: 18px;
  }

  .search-form {
    width: 100%;
    margin-left: 0;
  }

  .search-form input[type="text"] {
    flex: 1;
    width: auto;
  }
}
