/* 陪诊记事工作台 · PC 网页版
   语义色沿用小程序 styles/variables.wxss；PC 版式独立（契约 24.4） */
:root {
  --blue: #2563c9;
  --blue-dark: #1d4fa3;
  --blue-soft: #eaf1fd;
  --green: #2e9e6b;
  --green-soft: #e9f7f0;
  --orange: #e8833a;
  --orange-soft: #fff3e8;
  --purple: #7a63d6;
  --purple-soft: #f0edfd;
  --red: #e5544b;
  --red-soft: #fdecea;
  --pink: #c2548c;
  --amber: #b7791f;
  --teal: #12a594;
  --ink: #1d2635;
  --sub: #6b7484;
  --muted: #9aa3b1;
  --line: #e5e9f0;
  --bg: #f3f6fa;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 4px 18px rgba(29, 38, 53, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px; line-height: 1.6;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
a { color: var(--blue); text-decoration: none; }
.sub { color: var(--sub); font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 8px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.nowrap { white-space: nowrap; }
.danger-text { color: var(--red); font-weight: 600; margin-bottom: 12px; }

/* ---------- 启动遮罩 ---------- */
.boot { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.boot-card { text-align: center; }
.boot-logo, .login-logo, .brand-logo {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--blue); color: #fff; border-radius: 12px; font-weight: 700;
}
.boot-logo { width: 64px; height: 64px; font-size: 32px; margin-bottom: 16px; }
.boot-title { font-size: 20px; font-weight: 700; }
.boot-sub { color: var(--sub); margin-top: 6px; }

/* ---------- 登录 ---------- */
.login-view { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 20% 20%, #e7effc 0, var(--bg) 55%); padding: 24px; }
.login-card { width: 440px; max-width: 100%; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 36px; }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.login-logo { width: 48px; height: 48px; font-size: 24px; }
.login-brand h1 { font-size: 20px; }
.login-brand p { color: var(--sub); font-size: 12px; }
.login-form { display: flex; flex-direction: column; }
.login-form label { display: block; margin-bottom: 16px; font-weight: 600; font-size: 13px; }
.login-form input { margin-top: 6px; }
/* 登录按钮水平居中并加宽（契约 24.2，2026-11-17）：仅作用于登录页，不影响其他页面按钮 */
.login-form #login-submit { align-self: center; width: 73%; }

/* ---------- 应用外壳 ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 230px; flex: 0 0 230px; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 22px 18px; border-bottom: 1px solid var(--line); }
.brand-logo { width: 38px; height: 38px; font-size: 19px; }
.brand strong { display: block; font-size: 15px; }
.brand small { display: block; color: var(--muted); font-size: 11px; }
.nav { padding: 14px 10px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px;
  color: var(--sub); margin-bottom: 4px; font-weight: 500; }
.nav-item:hover { background: var(--bg); color: var(--ink); }
.nav-item.active { background: var(--blue-soft); color: var(--blue); font-weight: 700; }
.nav-icon { width: 20px; text-align: center; font-size: 16px; }
.sidebar-foot { padding: 14px; border-top: 1px solid var(--line); }
.user-line { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--blue-soft); color: var(--blue);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.user-line strong { display: block; font-size: 13px; }
.user-line small { color: var(--muted); font-size: 11px; }
.main-column { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 62px; flex: 0 0 62px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 10; }
.crumb { font-size: 17px; font-weight: 700; }
.top-right { display: flex; align-items: center; gap: 14px; color: var(--sub); font-size: 12px; }
.page { padding: 26px 28px 60px; flex: 1; }

/* ---------- 通用组件 ---------- */
.btn { border: 1px solid transparent; border-radius: 9px; padding: 9px 16px; font-weight: 600; font-size: 13px;
  background: #fff; transition: .15s; white-space: nowrap; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: #fff; }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn-danger-ghost { border-color: #f3c3bf; color: var(--red); background: #fff; }
.btn-danger-ghost:hover { background: var(--red-soft); }
.btn-lg { padding: 11px 22px; font-size: 14px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { border: 0; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; padding: 4px 8px; }
.icon-btn:hover { color: var(--ink); }
.link-btn { border: 0; background: none; color: var(--blue); padding: 2px 6px; font-size: 12px; }
.link-btn:hover { text-decoration: underline; }
.pill { background: var(--bg); color: var(--sub); border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 500; }
.input { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; background: #fff; outline: none; }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 201, .1); }
.textarea { resize: vertical; min-height: 84px; line-height: 1.6; }
.inline-field { display: flex; gap: 10px; align-items: center; }
.inline-field > .input { flex: 1; min-width: 0; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 16px; }
.panel-body { padding: 16px 20px; }
.head-actions { display: flex; gap: 10px; align-items: center; }
.head-actions .input { width: 220px; }
.state-box { text-align: center; padding: 46px 16px; color: var(--sub); }
.state-box .empty-icon { font-size: 38px; color: var(--muted); }
.state-box .err { color: var(--red); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--blue);
  border-radius: 50%; margin: 0 auto 12px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 标签（与小程序同语义色） */
.tag { display: inline-block; border-radius: 6px; padding: 2px 8px; font-size: 11px; font-weight: 600; line-height: 1.7; }
.t-accompany { background: var(--blue-soft); color: var(--blue); }
.t-consult { background: #e6f7f4; color: var(--teal); }
.t-check { background: var(--purple-soft); color: var(--purple); }
.t-drug { background: var(--green-soft); color: var(--green); }
.t-check-urgent { background: var(--red-soft); color: var(--red); }
.t-inpatient { background: #fbeef5; color: var(--pink); }
.t-appointment { background: var(--orange-soft); color: var(--amber); }
.t-report { background: var(--orange-soft); color: var(--orange); }
.t-other { background: #eef1f5; color: var(--sub); }
.s-pending { background: var(--orange-soft); color: var(--orange); }
.s-doing { background: var(--blue-soft); color: var(--blue); }
.s-done { background: var(--green-soft); color: var(--green); }
.s-cancel { background: #eef1f5; color: var(--muted); }
.pay-paid { background: var(--green-soft); color: var(--green); }
.pay-unpaid { background: var(--orange-soft); color: var(--orange); }
.s-overdue { background: var(--red-soft); color: var(--red); }
.s-today { background: var(--blue-soft); color: var(--blue); }
.s-soon { background: var(--purple-soft); color: var(--purple); }

/* ---------- 工作台 ---------- */
.welcome { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.welcome h1 { font-size: 24px; }
.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat-label { color: var(--sub); font-size: 12px; }
.stat-value { font-size: 28px; font-weight: 800; margin-top: 4px; }
.stat-card.blue .stat-value { color: var(--blue); }
.stat-card.orange .stat-value { color: var(--orange); }
.stat-card.purple .stat-value { color: var(--purple); }
.stat-card.green .stat-value { color: var(--green); }
.stat-card.red .stat-value { color: var(--red); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(280px, .85fr); gap: 16px; align-items: start; }
.dash-grid .panel { margin-bottom: 0; }
.dash-side { display: flex; flex-direction: column; gap: 16px; }
.list-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; cursor: pointer; transition: .15s; }
.list-item:hover { border-color: var(--blue); background: #fbfdff; }
.li-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.li-meta { font-weight: 600; font-size: 13px; line-height: 1.5; }
.li-note { color: var(--muted); font-size: 12px; margin-top: 5px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; color: var(--sub); font-weight: 600; background: #fafbfd;
  padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 12px 14px; border-bottom: 1px solid #f0f2f6; vertical-align: middle; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: #fbfdff; }
.cell-meta { font-weight: 600; max-width: 420px; }
.cell-note { color: var(--muted); font-size: 12px; margin-top: 3px; max-width: 420px; }
.table-count { padding: 12px 16px; color: var(--sub); font-size: 12px; }
.filter-bar { display: flex; gap: 10px; padding: 14px 20px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.filter-bar .input { width: auto; flex: 1; min-width: 150px; }
.filter-bar select.input { min-width: 140px; }

/* ---------- 表单 ---------- */
.form-panel { max-width: 1080px; margin: 0 auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; padding: 22px 24px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 7px; }
.field label b, .modal-form b { color: var(--red); }
.field.span2 { grid-column: span 2; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font-size: 13px; color: var(--sub); }
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.fee-box { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.fee-input { flex: 1; width: 0; min-width: 0; border: 0; outline: none; padding: 10px 14px; font-size: 16px; font-weight: 600; }
.fee-pay { width: 130px; border: 0; border-left: 1px solid var(--line); background: #fafbfd; padding: 0 10px; outline: none; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; padding: 18px 24px; border-top: 1px solid var(--line); }

/* ---------- 详情 ---------- */
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.detail-card { margin: 18px 20px 4px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfd; }
.detail-meta { font-size: 16px; font-weight: 700; margin-top: 10px; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; padding: 10px 20px 20px; }
.info-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed #eef1f5; }
.info-label { color: var(--sub); white-space: nowrap; }
.info-value { text-align: right; font-weight: 500; word-break: break-all; }
.remark-box, .attach-box { margin: 0 20px 16px; padding: 14px 16px; border-radius: 10px; background: #fafbfd; }
.remark-box h3, .attach-box h3 { font-size: 13px; color: var(--sub); margin-bottom: 6px; }
.remark-box.cancel { background: var(--red-soft); }
.attach-list { display: flex; flex-wrap: wrap; gap: 10px; }
.sticky { position: sticky; top: 82px; }
.action-stack { display: flex; flex-direction: column; gap: 10px; }
.file-btn { text-align: center; display: block; }
.log-list { display: flex; flex-direction: column; gap: 10px; }
.log-item { border-left: 3px solid var(--blue-soft); padding: 8px 12px; background: #fafbfd; border-radius: 0 8px 8px 0; }
.log-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.log-body { color: var(--sub); font-size: 12px; margin-top: 5px; }

/* ---------- 设置 ---------- */
.settings-stack .panel { max-width: 1080px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; }
.setting-block { padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.setting-block h3 { font-size: 14px; margin-bottom: 6px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.list-editor { display: flex; flex-direction: column; gap: 8px; }
.list-editor-row { display: flex; gap: 8px; align-items: center; }
.list-editor-row .input { flex: 1; }
.list-new { border-style: dashed; }

/* ---------- 弹窗 / 提示 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(20, 28, 40, .45); display: flex;
  align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: 16px; width: 540px; max-width: 100%; max-height: 90vh; display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); }
.modal-form { display: flex; flex-direction: column; gap: 14px; }
.modal-form label { font-weight: 600; font-size: 13px; }
.modal-form input, .modal-form textarea, .modal-form select { margin-top: 6px; }
.confirm-text { font-size: 14px; line-height: 1.8; }
.bind-code { font-size: 34px; letter-spacing: 10px; font-weight: 800; color: var(--blue); text-align: center;
  padding: 18px; background: var(--blue-soft); border-radius: 10px; }
.toast-root { position: fixed; right: 26px; top: 78px; z-index: 150; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #253044; color: #fff; padding: 10px 16px; border-radius: 9px; box-shadow: var(--shadow);
  font-size: 13px; max-width: 360px; transition: opacity .25s, transform .25s; }
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
.toast.fade { opacity: 0; transform: translateY(-6px); }

@media (max-width: 1180px) {
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .dash-side { grid-column: span 2; flex-direction: row; }
  .dash-side .panel { flex: 1; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .sidebar { width: 180px; flex-basis: 180px; }
  .detail-layout { grid-template-columns: 1fr; }
  .form-grid, .settings-grid, .info-grid { grid-template-columns: 1fr; }
  .field.span2 { grid-column: span 1; }
}
