
:root{
  --primary:#1E40AF;      /* 寶藍 - Royal Blue */
  --accent:#D4AF37;       /* 金色 - Gold */
  --bg:#F6F7FB;
  --ink:#0F172A;
  --muted:#475569;
  --card:#ffffff;
  --border:rgba(15,23,42,.12);
  --shadow: 0 10px 30px rgba(2,6,23,.08);
  --hover-bg:rgba(30,64,175,.06);
  --hover-border:rgba(30,64,175,.18);
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "PingFang SC","Noto Sans SC", "Microsoft YaHei", Arial;
  background:var(--bg);
  color:var(--ink);
}
a{color:var(--primary); text-decoration:none}
a:hover{text-decoration:underline}
.container{max-width:1040px; margin:0 auto; padding:18px}
.topbar{
  position:sticky; top:0;
  background:rgba(250,250,247,.92);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--border);
}
.brand{display:flex; gap:12px; align-items:center}
.dot{
  width:12px; height:12px;
  border-radius:999px;
  background:linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow:0 0 0 6px rgba(20,184,166,.14);
}
.brand-title{font-weight:800; letter-spacing:.02em}
.brand-sub{font-size:12px; color:var(--muted)}
.nav{display:flex; gap:14px; align-items:center}
.topbar .container{display:flex; align-items:center; justify-content:space-between}
.h1{font-size:28px; margin:8px 0 10px}
.h2{font-size:18px; margin:10px 0}
.h3{font-size:15px; margin:8px 0}
.lead{color:var(--muted); margin:0 0 14px}
.small{font-size:12px; color:var(--muted)}
.muted{color:var(--muted)}
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:18px;
  padding:16px;
  box-shadow: var(--shadow);
}
.grid2{display:grid; grid-template-columns:1fr 1fr; gap:12px}
@media (max-width:840px){ .grid2{grid-template-columns:1fr} }

.field label{display:block; font-size:12px; color:var(--muted); margin-bottom:6px}
input, select, textarea{
  width:100%;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
}
textarea{resize:vertical; min-height:96px}
.sep{border:0; border-top:1px solid var(--border); margin:14px 0}
.bucket{border:1px solid var(--border); border-radius:14px; padding:12px; margin:10px 0; background:#fff}
.bucket-title{font-weight:800; margin-bottom:10px}
.bucket-list{display:flex; flex-direction:column; gap:6px}
.chk{display:flex; gap:10px; align-items:center; padding:10px 10px; width:100%; border-radius:12px; border:1px solid rgba(15,23,42,.06); background:#fff; cursor:pointer; transition: all 0.2s ease;}
.chk:hover{background:var(--hover-bg); border-color:var(--hover-border);}
.chk input{flex:0 0 auto; width:18px; height:18px; cursor:pointer;}
.chk-text{font-size:14px; line-height:1.35; word-break:break-word; flex:1; cursor:pointer;}
.req{color:#ef4444; margin-left:2px}
.hint{font-size:12px; color:var(--muted); margin-top:6px}
/* (dedup) */

.actions{margin-top:14px; display:flex; flex-direction:column; gap:8px}
.btn{
  display:inline-flex;
  align-items:center; justify-content:center;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(30,64,175,.35);
  background:linear-gradient(135deg, var(--primary), #0b5aa9);
  color:#fff;
  font-weight:700;
  cursor:pointer;
}
.btn.ghost{background:transparent; color:var(--primary)}
.alert{background:rgba(239,68,68,.08); border:1px solid rgba(239,68,68,.25); padding:10px 12px; border-radius:14px}
.footer{padding:18px 0; margin-top:18px}
.row{display:flex; align-items:center; justify-content:space-between; gap:10px}
.table{width:100%; border-collapse:collapse; font-size:14px}
.table th,.table td{padding:10px 8px; border-bottom:1px solid var(--border); text-align:left; vertical-align:top}
.tag{display:inline-block; padding:2px 8px; border-radius:999px; font-size:12px; border:1px solid var(--border)}
.tag.ok{background:rgba(34,197,94,.10); border-color:rgba(34,197,94,.25)}
.tag.warn{background:rgba(245,158,11,.12); border-color:rgba(245,158,11,.25)}
.scroll{max-height:340px; overflow:auto; border:1px solid var(--border); border-radius:14px; padding:10px}
.list{margin:0; padding-left:18px}
.cta{margin-top:14px; padding:14px; border-radius:16px; background:rgba(20,184,166,.08); border:1px solid rgba(20,184,166,.25)}
.cta-title{font-weight:800; margin-bottom:6px}


.topbar{position:sticky; top:0; z-index:10; backdrop-filter:saturate(140%) blur(10px); background:rgba(246,247,251,.85); border-bottom:1px solid var(--border)}
.topbar-inner{display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px 0}
.brand{display:flex; align-items:center; gap:12px}
.brand-logo{height:34px; width:auto; display:block; filter: drop-shadow(0 6px 12px rgba(2,6,23,.12));}
.brand-title{font-weight:900; letter-spacing:.08em}
.brand-sub{color:var(--muted); font-size:12px; margin-top:2px}

.card{border-radius:18px}
.btn{border-radius:14px; font-weight:800}
.btn:hover{transform:translateY(-1px)}
.bucket{border-radius:18px}
.chk{border-radius:14px}
.footer{padding:22px 0; color:var(--muted)}

/* ========== Progress Bar (Fixed Top) ========== */
.progress-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: rgba(30,64,175,0.1);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

/* Adjust main container to account for fixed progress bar */
body {
  padding-top: 50px;
}

/* ========== Chapter Navigation (Fixed Sidebar) ========== */
.chapter-nav {
  position: fixed;
  right: -200px;
  top: 120px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: right 0.3s ease;
}

.chapter-nav.visible {
  right: 16px;
}

.nav-btn, .nav-btn-top {
  padding: 8px 12px;
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  white-space: nowrap;
}

.nav-btn:hover, .nav-btn-top:hover {
  background: var(--primary);
  color: white;
  transform: translateX(-2px);
}

.nav-btn-top {
  background: linear-gradient(135deg, var(--primary), #0b5aa9);
  color: white;
  border-color: transparent;
  margin-top: 8px;
}

.nav-btn-top:hover {
  transform: translateX(-2px) translateY(-1px);
}

/* Hide chapter nav on mobile */
@media (max-width: 768px) {
  .chapter-nav {
    display: none;
  }
}

/* ========== Draft Notice ========== */
.draft-notice {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(212,175,55,0.1), rgba(212,175,55,0.05));
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #854d0e;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-clear-draft {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid rgba(212,175,55,0.4);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #854d0e;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-clear-draft:hover {
  background: rgba(212,175,55,0.15);
  border-color: rgba(212,175,55,0.6);
}

/* ========== Form Sections ========== */
.form-section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--primary);
}

/* ========== Symptom Chapters ========== */
.symptom-chapter {
  margin-bottom: 32px;
}

.chapter-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(30,64,175,0.08), rgba(30,64,175,0.03));
  border-left: 4px solid var(--primary);
  border-radius: 8px;
}

.chapter-hint {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
  padding-left: 16px;
  font-style: italic;
}

/* ========== Enhanced Button Styles ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--primary), #0b5aa9);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(30,64,175,0.2);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(30,64,175,0.3);
}

.btn.ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid rgba(30,64,175,0.35);
  box-shadow: none;
}

.btn.ghost:hover {
  background: rgba(30,64,175,0.06);
  border-color: rgba(30,64,175,0.5);
}

/* ========== Enhanced Card Styles ========== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
}

/* ========== Gold Accent for Key Elements ========== */
.h1::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 24px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  margin-right: 12px;
  border-radius: 2px;
  vertical-align: middle;
}

/* ========== Improved Table for Admin ========== */
.table th {
  background: linear-gradient(135deg, rgba(30,64,175,0.08), rgba(30,64,175,0.03));
  font-weight: 700;
  color: var(--primary);
}

.table tr:hover {
  background: rgba(30,64,175,0.02);
}

/* ========== Responsive Adjustments ========== */
@media (max-width: 768px) {
  .progress-container {
    padding: 6px 12px;
  }
  
  .progress-text {
    font-size: 11px;
  }
  
  body {
    padding-top: 45px;
  }
  
  .chapter-title {
    font-size: 16px;
    padding: 10px 12px;
  }
  
  .btn {
    padding: 12px 20px;
    font-size: 15px;
  }
}

/* ========== Admin Copy Button ========== */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(135deg, var(--accent), #c9a32a);
  color: #000;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(212,175,55,0.3);
}

.copy-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212,175,55,0.4);
}

.copy-btn::before {
  content: '📋';
  font-size: 14px;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  background: rgba(34,197,94,0.95);
  color: white;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  z-index: 1000;
  animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ========== Admin Enhancements ========== */
.top-dimension {
  display: inline-block;
  padding: 4px 10px;
  background: linear-gradient(135deg, rgba(30,64,175,0.12), rgba(212,175,55,0.12));
  border: 1px solid rgba(30,64,175,0.25);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

.repeat-badge {
  display: inline-block;
  padding: 3px 8px;
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.35);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #92400e;
}

/* ========== Symptom Comparison Grid ========== */
.summary-card {
  background: linear-gradient(135deg, rgba(30,64,175,0.05), rgba(212,175,55,0.05));
}

.summary-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
}

.stat-item.improved {
  background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(147,197,253,0.08));
  border-color: rgba(59,130,246,0.25);
}

.stat-item.persistent {
  background: linear-gradient(135deg, rgba(249,115,22,0.08), rgba(251,146,60,0.08));
  border-color: rgba(249,115,22,0.25);
}

.stat-item.new {
  background: linear-gradient(135deg, rgba(239,68,68,0.08), rgba(252,165,165,0.08));
  border-color: rgba(239,68,68,0.25);
}

.stat-icon {
  font-size: 32px;
  line-height: 1;
}

.stat-content {
  flex: 1;
}

.stat-number {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
}

.warm-message {
  padding: 14px;
  background: linear-gradient(135deg, rgba(212,175,55,0.12), rgba(212,175,55,0.05));
  border: 1px solid rgba(212,175,55,0.35);
  border-radius: 12px;
  text-align: center;
  font-weight: 600;
  color: #92400e;
  margin-top: 12px;
}

.grid-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 14px 0;
  padding: 12px;
  background: rgba(30,64,175,0.03);
  border-radius: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.legend-color {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.legend-color.improved {
  background: linear-gradient(90deg, rgba(239,68,68,0.15) 0%, rgba(239,68,68,0.15) 50%, rgba(59,130,246,0.85) 50%, rgba(59,130,246,0.85) 100%);
}

.legend-color.persistent {
  background: linear-gradient(90deg, rgba(239,68,68,0.5) 0%, rgba(239,68,68,0.5) 50%, rgba(249,115,22,0.85) 50%, rgba(249,115,22,0.85) 100%);
}

.legend-color.new {
  background: linear-gradient(90deg, rgba(156,163,175,0.3) 0%, rgba(156,163,175,0.3) 50%, rgba(239,68,68,0.5) 50%, rgba(239,68,68,0.5) 100%);
}

.symptom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

@media (max-width: 840px) {
  .symptom-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

.symptom-tile {
  position: relative;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.symptom-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.symptom-tile.improved {
  background: linear-gradient(90deg, rgba(239,68,68,0.15) 0%, rgba(239,68,68,0.15) 50%, rgba(59,130,246,0.85) 50%, rgba(59,130,246,0.85) 100%);
  border-color: rgba(59,130,246,0.4);
}

.symptom-tile.persistent {
  background: linear-gradient(90deg, rgba(239,68,68,0.5) 0%, rgba(239,68,68,0.5) 50%, rgba(249,115,22,0.85) 50%, rgba(249,115,22,0.85) 100%);
  border-color: rgba(249,115,22,0.4);
}

.symptom-tile.new {
  background: linear-gradient(90deg, rgba(156,163,175,0.3) 0%, rgba(156,163,175,0.3) 50%, rgba(239,68,68,0.5) 50%, rgba(239,68,68,0.5) 100%);
  border-color: rgba(239,68,68,0.4);
}

.tile-content {
  text-align: center;
  position: relative;
  z-index: 1;
}

.tile-id {
  font-size: 11px;
  color: rgba(0,0,0,0.5);
  font-weight: 600;
  margin-bottom: 4px;
}

.tile-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: rgba(0,0,0,0.85);
  word-break: break-word;
}

.advice-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.advice-item {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.advice-item .h3 {
  color: var(--primary);
  margin-bottom: 10px;
}

.causes {
  margin-top: 10px;
}

.causes ul {
  margin: 8px 0;
}

.dimensions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: white;
  border-radius: 16px;
  padding: 24px;
  max-width: 90%;
  max-height: 90%;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 28px;
  font-weight: bold;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: none;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.modal-close:hover {
  background-color: rgba(0, 0, 0, 0.1);
  color: var(--ink);
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--ink);
}

.modal-body {
  text-align: center;
}

.modal-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.modal-hint {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}


/* Toast Notification */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 15px;
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  max-width: 90%;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* Table styles */
.table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

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

.table th {
  background-color: rgba(30, 64, 175, 0.05);
  font-weight: 600;
  color: var(--ink);
}

.table tbody tr:hover {
  background-color: rgba(30, 64, 175, 0.02);
}

/* Badge styles */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background-color: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.badge-info {
  background-color: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

.badge-warning {
  background-color: rgba(251, 191, 36, 0.1);
  color: #d97706;
}

.badge-danger {
  background-color: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.badge-muted {
  background-color: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

/* Button variants */
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: white;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sm:hover {
  background-color: var(--hover-bg);
  border-color: var(--hover-border);
}

.btn-danger {
  background-color: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background-color: rgba(239, 68, 68, 0.2);
}

/* Utility classes for section cards */
.hidden {
  display: none !important;
}

