* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: #f8fafc;
  color: #1e293b;
  line-height: 1.5;
}

/* ==================== 全局导航栏 ==================== */
.nav {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-mark {
  background: #2563eb;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  text-decoration: none;
  color: #64748b;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: #2563eb;
}

.view-switcher {
  display: flex;
  background: #f1f5f9;
  padding: 0.25rem;
  border-radius: 0.5rem;
  gap: 0.25rem;
}

.switcher-btn {
  border: none;
  background: transparent;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s;
}

.switcher-btn.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(37,99,235,0.3);
}

/* 视图控制器 */
.main-view {
  display: none;
}
.main-view.active {
  display: block;
}

/* ==================== 1. 客户端样式 ==================== */
.hero {
  text-align: center;
  padding: 4rem 1rem 3rem;
  background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
  border-bottom: 1px solid #e2e8f0;
}

.badge {
  display: inline-block;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
  margin-bottom: 1rem;
}

.hero h1 span {
  color: #2563eb;
}

.hero p {
  max-width: 600px;
  margin: 0 auto 2rem;
  color: #64748b;
  font-size: 1.05rem;
}

.hero-btn {
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0.5rem;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(37,99,235,0.2);
  transition: all 0.2s;
}

.hero-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1rem;
}

.section-title {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-title h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.section-title p {
  color: #64748b;
}

/* 卡片网格 */
.types {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 4rem;
}

.type {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.5rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.type:hover {
  border-color: #93c5fd;
  transform: translateY(-2px);
}

.type.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 4px 12px rgba(37,99,235,0.1);
}

.type .icon {
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
}

.type h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.35rem;
}

.type p {
  font-size: 0.85rem;
  color: #64748b;
}

/* 需求表单布局 */
.form-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: start;
}

.card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 1.5rem;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field.full {
  grid-column: span 2;
}

.field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
}

.field input, .field select, .field textarea, .admin-input, .admin-select {
  padding: 0.65rem 0.875rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  font-size: 0.9rem;
  outline: none;
  background: #ffffff;
  transition: border 0.2s;
}

.field input:focus, .field select:focus, .field textarea:focus, .admin-input:focus, .admin-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

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

.checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 0.6rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.check:hover {
  background: #f1f5f9;
}

/* 侧边栏预估 */
.summary {
  position: sticky;
  top: 5rem;
}

.price-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1.25rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.price-label {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.price {
  font-size: 2.25rem;
  font-weight: 800;
  color: #2563eb;
}

.range {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

.summary-list {
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.875rem 0;
  margin-bottom: 1.25rem;
}

.row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  color: #475569;
}

.row span:last-child {
  font-weight: 600;
  color: #0f172a;
}

.submit {
  width: 100%;
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 0.875rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.2s;
}

.submit:hover {
  background: #1d4ed8;
}

.note {
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
  margin-top: 0.75rem;
}

/* 步骤说明 */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.step {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1.5rem;
  text-align: center;
}

.step .num {
  width: 36px;
  height: 36px;
  background: #dbeafe;
  color: #2563eb;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
}

.step b {
  display: block;
  font-size: 1rem;
  color: #0f172a;
  margin-bottom: 0.35rem;
}

.step p {
  font-size: 0.85rem;
  color: #64748b;
}

footer {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #94a3b8;
  font-size: 0.875rem;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}

/* ==================== 2. 后台管理样式 ==================== */
.admin-layout {
  display: flex;
  min-height: calc(100vh - 57px);
}

.admin-sidebar {
  width: 240px;
  background: #0f172a;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 1.25rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-menu {
  list-style: none;
  padding: 1rem 0.75rem;
  flex-grow: 1;
}

.admin-menu li {
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 0.35rem;
  transition: all 0.2s;
}

.admin-menu li:hover {
  background: #1e293b;
  color: #ffffff;
}

.admin-menu li.active {
  background: #2563eb;
  color: #ffffff;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid #1e293b;
  font-size: 0.8rem;
  color: #64748b;
}

.admin-content {
  flex-grow: 1;
  background: #f8fafc;
  padding: 2rem;
  overflow-y: auto;
}

.admin-section {
  display: none;
}

.admin-section.active {
  display: block;
}

.admin-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.admin-title-bar h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
}

.sub-text {
  font-size: 0.875rem;
  color: #64748b;
}

.admin-actions {
  display: flex;
  gap: 0.75rem;
}

/* 统计指标卡片 */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.metric-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.metric-icon {
  font-size: 2rem;
  width: 48px;
  height: 48px;
  background: #f1f5f9;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-title {
  font-size: 0.85rem;
  color: #64748b;
}

.metric-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
}

/* 后台卡片与表格 */
.admin-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
  margin-bottom: 1.5rem;
}

.admin-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 1rem;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th, .data-table td {
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.data-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
}

.badge-status {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-pending { background: #fef3c7; color: #d97706; }
.badge-evaluated { background: #dbeafe; color: #1d4ed8; }
.badge-signed { background: #d1fae5; color: #059669; }

.btn-primary {
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.375rem;
  cursor: pointer;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 0.25rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  cursor: pointer;
  margin-right: 0.25rem;
}

.btn-sm:hover {
  background: #f1f5f9;
}

.btn-danger {
  color: #ef4444;
  border-color: #fca5a5;
}

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

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

/* 弹窗 Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #ffffff;
  border-radius: 0.5rem;
  width: 90%;
  max-width: 560px;
  padding: 1.5rem;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.close-btn {
  font-size: 1.5rem;
  cursor: pointer;
  color: #94a3b8;
}

.close-btn:hover {
  color: #0f172a;
}

.full-width {
  width: 100%;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #0f172a;
  color: #ffffff;
  padding: 0.875rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
  transform: translateY(150%);
  transition: transform 0.3s ease;
  z-index: 2000;
}

.toast.show {
  transform: translateY(0);
}

@media (max-width: 868px) {
  .form-layout {
    grid-template-columns: 1fr;
  }
  .summary {
    position: static;
  }
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
  .admin-layout {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
  }
}
