:root {
  --bg-deep: #0b0f17;
  --bg-body: #101520;
  --bg-panel: rgba(18, 26, 40, 0.9);
  --bg-card: rgba(24, 34, 50, 0.78);
  --primary: #00e5ff;
  --primary-dim: rgba(0, 229, 255, 0.12);
  --text-main: #e8f4f8;
  --text-muted: #8ba4be;
  --border: rgba(139, 164, 190, 0.16);
  --success: #00d9a6;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --shadow-panel: 0 8px 32px rgba(0, 0, 0, 0.45);
  --glow-primary: 0 0 18px rgba(0, 229, 255, 0.28);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-deep);
  color: var(--text-main);
  overflow: hidden;
}

.app-shell {
  display: flex;
  height: 100vh;
  background:
    radial-gradient(circle at 85% 0%, rgba(0, 229, 255, 0.05), transparent 35%),
    radial-gradient(circle at 10% 100%, rgba(102, 240, 255, 0.03), transparent 35%),
    var(--bg-body);
}

/* 侧边栏 */
.sidebar {
  width: 260px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding: 26px 16px;
}

.brand { padding: 0 10px 28px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.brand-title { font-size: 1.3rem; font-weight: 700; color: var(--primary); }
.brand-sub { font-size: 0.85rem; color: var(--text-muted); margin-top: 6px; }

.nav-group { display: flex; flex-direction: column; gap: 8px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.18s ease;
  cursor: pointer;
  font-size: 0.98rem;
}
.nav-item:hover { background: rgba(0, 229, 255, 0.08); color: var(--text-main); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.18), rgba(0, 229, 255, 0.04));
  color: var(--primary);
  border-left: 3px solid var(--primary);
  box-shadow: var(--glow-primary);
}
.nav-icon { font-size: 1.2rem; width: 26px; text-align: center; }

/* 主区域 */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  height: 84px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 15, 23, 0.72);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}
.topbar .brand { display: flex; align-items: center; gap: 16px; border: none; padding: 0; margin: 0; }
.topbar .brand-avatar { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--primary); box-shadow: var(--glow-primary); }
.topbar .brand-title { font-size: 1.25rem; font-weight: 600; color: var(--text-main); }
.topbar .brand-sub { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }

.topbar-actions { display: flex; align-items: center; gap: 12px; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(0, 217, 166, 0.12);
  color: var(--success);
  border: 1px solid rgba(0, 217, 166, 0.25);
}
.status-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 6px var(--success); }

.content { flex: 1; overflow-y: auto; padding: 24px 28px 28px; }

.section { display: none; animation: fadeIn 0.25s ease; }
.section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.hero { margin-bottom: 18px; }
.section-title { font-size: 1.35rem; font-weight: 600; margin: 0 0 6px; }
.text-muted { color: var(--text-muted); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.06);
  color: var(--text-main);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn:hover { background: rgba(255,255,255,0.1); border-color: rgba(0, 229, 255, 0.35); }
.btn.primary { background: linear-gradient(135deg, #0099cc, var(--primary)); color: #071018; border: none; font-weight: 600; box-shadow: var(--glow-primary); }
.btn.primary:hover { filter: brightness(1.08); }

/* 卡片 */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-panel);
}
.card h3 { margin: 0 0 14px; font-size: 1rem; color: var(--primary); display: flex; align-items: center; gap: 8px; }

.quick-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow-panel);
}
.stat-box .value { font-size: 1.9rem; font-weight: 700; color: var(--primary); }
.stat-box .label { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* 表单 */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-panel);
}
.form-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--text-muted); }
input, select, textarea {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
textarea { resize: vertical; }

/* 表格 */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.data-table th {
  position: sticky;
  top: 0;
  background: rgba(0, 229, 255, 0.08);
  text-align: left;
  padding: 12px 14px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text-main); vertical-align: top; }
.data-table tr:hover td { background: rgba(0, 229, 255, 0.04); }

/* 预约 */
.appointment-list { display: flex; flex-direction: column; gap: 10px; }
.appointment-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}
.appointment-item:hover { background: rgba(0, 229, 255, 0.06); }
.appointment-item .time { width: 54px; font-size: 1rem; font-weight: 600; color: var(--primary); flex-shrink: 0; }
.appointment-item .info { flex: 1; }
.appointment-item .main-line { font-size: 0.95rem; margin-bottom: 4px; }
.appointment-item .sub-line { font-size: 0.8rem; color: var(--text-muted); }
.appointment-item .status { font-size: 0.75rem; padding: 3px 10px; border-radius: 999px; background: rgba(0, 217, 166, 0.12); color: var(--success); border: 1px solid rgba(0, 217, 166, 0.25); flex-shrink: 0; }

/* 病种知识库 */
.disease-kb-layout { display: flex; gap: 18px; min-height: 520px; }
.disease-list { width: 260px; overflow-y: auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px; }
.disease-list-item { padding: 12px; border-radius: var(--radius-sm); cursor: pointer; margin-bottom: 8px; }
.disease-list-item:hover { background: rgba(0, 229, 255, 0.08); }
.disease-list-item.active { background: linear-gradient(90deg, rgba(0, 229, 255, 0.18), rgba(0, 229, 255, 0.05)); border-left: 3px solid var(--primary); }
.disease-list-item .name { font-weight: 600; }
.disease-list-item .meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.disease-detail { flex: 1; overflow-y: auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; }
.disease-detail h3 { margin: 0 0 14px; color: var(--text-main); }
.disease-detail .detail-section { margin-bottom: 24px; }
.disease-detail .detail-section h4 { margin: 0 0 10px; font-size: 0.95rem; color: var(--text-muted); }
.disease-detail .detail-section pre { white-space: pre-wrap; word-break: break-word; background: rgba(0,0,0,0.25); padding: 14px; border-radius: var(--radius-sm); font-size: 0.86rem; line-height: 1.6; }

/* 弹窗 */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); }
.modal-content { position: relative; width: 95%; max-width: 760px; max-height: 92vh; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { margin: 0; font-size: 1.05rem; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-body .field { margin-bottom: 14px; }
.modal-body .field label { display: block; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 4px; }
.modal-body .field .value { font-size: 0.95rem; line-height: 1.6; }

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 2000;
}
.toast.show { opacity: 1; }

.tag {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(0, 229, 255, 0.12);
  color: var(--primary);
  margin-right: 4px;
}
