/* 郭梦静中医诊所官网 · 与微信小程序同款视觉
   色值、间距、圆角按小程序 app.wxss / pages/index/index.wxss 换算（750rpx ≈ 375px） */

:root {
    --ink: #3c2c20;
    --paper: #f7f4ed;
    --card: #fffdf8;
    --line: #eae0d0;
    --muted: #8a7d70;
    --tiny: #9a8c7c;
    --gold: #a5762f;
    --seal: #c09559;
    --red: #ac4339;
    --green: #2f7a4d;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
    background: #ece5d9;
    color: var(--ink);
    font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Songti SC", "Microsoft YaHei", sans-serif;
}
button { font: inherit; cursor: pointer; }

.app {
    position: relative;
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    margin: 0 auto;
    background: var(--paper);
    box-shadow: 0 0 30px rgba(60, 44, 32, .09);
    padding-bottom: 58px;
}

/* 对应小程序原生导航栏 */
.navbar {
    position: sticky; top: 0; z-index: 12;
    height: 44px; display: flex; align-items: center; justify-content: center;
    background: var(--paper); border-bottom: 1px solid rgba(234, 224, 208, .7);
    font-size: 16px; font-weight: 600; letter-spacing: .5px;
}
.navbar-side {
    position: absolute; right: 12px; top: 8px;
    padding: 5px 10px; border: 1px solid #d9bd8b; border-radius: 999px;
    background: transparent; color: var(--gold); font-size: 12px;
}

.page { padding: 12px 14px 30px; }
.view { display: none; }
.view-active { display: block; }

/* hero */
.hero {
    position: relative; overflow: hidden;
    padding: 20px 18px 18px; margin-bottom: 13px;
    background: var(--ink); color: var(--paper); border-radius: 14px;
}
.hero-seal {
    position: absolute; right: 14px; top: 14px;
    width: 48px; height: 48px; line-height: 44px; text-align: center;
    border: 2px solid rgba(192, 149, 89, .7); border-radius: 50%;
    color: var(--seal); font-size: 18px; letter-spacing: 2px;
}
.hero-title { font-size: 22px; font-weight: 700; letter-spacing: 1px; }
.hero-sub { margin-top: 7px; font-size: 12.5px; color: #d5c9b9; }
.hero-line { width: 36px; height: 2px; margin-top: 13px; background: var(--seal); border-radius: 2px; }
.hero-admin {
    position: absolute; right: 14px; bottom: 14px;
    padding: 3px 10px; border: 1px solid rgba(192, 149, 89, .85); border-radius: 999px;
    color: #e4c48b; font-size: 11.5px;
}

/* 通用卡片 */
.card {
    padding: 14px; margin-bottom: 12px;
    background: var(--card); border: 1px solid var(--line);
    border-radius: 12px; box-shadow: 0 3px 10px rgba(60, 44, 32, .04);
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.section-title::before {
    content: ""; display: inline-block; width: 4px; height: 14px;
    margin-right: 7px; vertical-align: -2px; background: var(--red); border-radius: 2px;
}
.muted { color: var(--muted); font-size: 12.5px; }
.tiny { font-size: 11.5px; color: var(--tiny); }
.gold { color: var(--gold); }
.vermilion { color: var(--red); }
.divider { height: 1px; margin: 11px 0; background: #eee5d7; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row + .row { margin-top: 7px; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; line-height: 1.7; }
.tag-open { color: var(--green); background: #e9f5ec; }
.tag-soon { color: var(--gold); background: #fbf1de; }
.tag-full, .tag-closed { color: var(--muted); background: #f0ece5; }
.tag-red { color: var(--red); background: #fbece9; }

.btn-primary, .btn-ghost {
    display: block; width: 100%; padding: 0 12px;
    border-radius: 10px; text-align: center; text-decoration: none;
}
.btn-primary { height: 44px; line-height: 44px; color: #fffaf3; background: var(--red); border: none; font-size: 15px; font-weight: 600; }
.btn-ghost {
    height: 40px; line-height: 38px; color: var(--ink);
    background: var(--card); border: 1px solid #d5c9b9; font-size: 14px;
}
.btn-small { width: auto; height: 30px; line-height: 28px; padding: 0 12px; font-size: 12px; border-radius: 7px; }
.btn-primary:active, .btn-ghost:active { opacity: .8; }
.stack > * + * { margin-top: 10px; }

.empty { padding: 40px 15px; text-align: center; color: var(--tiny); font-size: 13px; }
.empty-title { display: block; margin-bottom: 6px; font-size: 15px; color: #6b5b4a; }
.empty .btn-primary { margin-top: 20px; }
.empty .btn-ghost { margin-top: 10px; }

/* 公告条 */
.notice-bar {
    padding: 10px 12px; margin-bottom: 12px;
    background: #fbf1de; border-left: 3px solid var(--seal); border-radius: 6px;
    font-size: 12.5px; color: #6b5334;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 日期选择 */
.day-scroll { overflow-x: auto; scrollbar-width: none; }
.day-scroll::-webkit-scrollbar { display: none; }
.day-list { display: inline-flex; padding-bottom: 3px; }
.day-chip {
    flex: 0 0 52px; display: inline-flex; flex-direction: column; align-items: center;
    padding: 8px 0 6px; margin-right: 7px;
    background: #faf7f0; border: 1px solid var(--line); border-radius: 9px;
    color: var(--ink); font-size: 11.5px;
}
.day-chip-active { background: var(--ink); border-color: var(--ink); }
.day-chip-off { opacity: .55; }
.day-week { color: var(--muted); font-size: 11.5px; }
.day-chip-active .day-week { color: #d5c9b9; }
.day-num { margin-top: 3px; font-size: 16px; font-weight: 700; }
.day-chip-active .day-num { color: #fffaf3; }
.day-dot { width: 5px; height: 5px; margin-top: 5px; border-radius: 50%; background: #d5c9b9; }
.day-dot-open { background: var(--seal); }

/* 名额条 + 三列时段卡片 */
.quota-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 7px 9px; margin-bottom: 11px;
    background: #fbf1de; border-radius: 7px; font-size: 11.5px; color: #6b5334;
}
.quota-num { flex-shrink: 0; font-weight: 600; color: var(--red); }
.slot-grid { display: flex; flex-wrap: wrap; }
.slot-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 31.5%; min-height: 73px; margin: 0 2.75% 7px 0; padding: 9px 3px 7px;
    background: #fffaf0; border: 1px solid #c9a66b; border-radius: 9px;
    color: var(--ink); text-align: center;
}
.slot-card:nth-child(3n) { margin-right: 0; }
.slot-card-time { font-size: 16px; font-weight: 700; line-height: 1.35; color: #7a5620; }
.slot-card-no { margin-top: 1px; font-size: 9.5px; line-height: 1.3; color: #b08d52; }
.slot-card-label { margin-top: 4px; font-size: 11px; color: var(--green); }
.slot-full .slot-card-no, .slot-closed .slot-card-no, .slot-expired .slot-card-no { color: #b3a998; }
.slot-soon .slot-card-no { color: #a08a63; }
.slot-full, .slot-closed, .slot-expired { background: #f4f1eb; border-color: #ece6dc; }
.slot-full .slot-card-time, .slot-closed .slot-card-time, .slot-expired .slot-card-time,
.slot-full .slot-card-label, .slot-closed .slot-card-label, .slot-expired .slot-card-label { color: #a89c8c; }
.slot-soon { background: #fbf6ea; border-color: #eadfc6; }
.slot-soon .slot-card-time { color: #8a744c; }
.slot-soon .slot-card-label { color: var(--gold); }
.slot-legend { display: block; margin-top: 6px; line-height: 1.6; }

/* 诊所页 */
.admin-entry { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 12px;
    background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.admin-entry-seal {
    flex: 0 0 38px; height: 38px; line-height: 36px; text-align: center;
    border: 1px solid var(--seal); border-radius: 9px; color: var(--gold); font-size: 18px;
}
.admin-entry-body { flex: 1; min-width: 0; }
.admin-entry-title { display: block; font-size: 14px; font-weight: 600; }
.admin-entry-sub { display: block; font-size: 11.5px; color: var(--muted); }
.admin-entry-arrow { color: var(--muted); font-size: 20px; }
.notice-item + .notice-item { margin-top: 12px; padding-top: 12px; border-top: 1px solid #f0e9dd; }
.notice-line { display: block; margin-top: 3px; }
.info-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 13px; }
.info-row > span:first-child { color: var(--muted); white-space: nowrap; }
.info-row a { color: var(--gold); text-decoration: none; }
footer { text-align: center; color: var(--tiny); font-size: 11.5px; margin-top: 11px; }

/* 底部 tabBar（对应小程序 4 个 tab） */
.tabbar {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    z-index: 12; width: 100%; max-width: 480px; height: 56px;
    display: flex; background: #fffaf3; border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
}
.tab-item {
    flex: 1; border: none; background: transparent; color: var(--muted);
    font-size: 11.5px; line-height: 56px; padding: 0;
}
.tab-item.tab-active { color: var(--red); font-weight: 600; }

/* 小程序码弹层 */
.mask { position: fixed; inset: 0; z-index: 20; background: rgba(31, 24, 18, .5); }
.mask[hidden] { display: none; }
.sheet {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    z-index: 21; width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto;
    padding: 18px 15px 30px; background: var(--card); border-radius: 16px 16px 0 0;
}
.sheet-title { display: block; margin-bottom: 14px; font-size: 17px; font-weight: 700; text-align: center; }
.qr-box {
    display: flex; align-items: center; justify-content: center;
    width: 200px; height: 200px; margin: 0 auto 12px;
    background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.qr-box img { width: 100%; height: 100%; object-fit: contain; }
.qr-empty { display: none; text-align: center; color: var(--muted); font-size: 12.5px; padding: 16px; }
.hint { margin: 0; text-align: center; color: var(--gold); font-size: 14px; }
.sheet .tiny { display: block; margin: 8px 0 14px; line-height: 1.6; }
.sheet .btn-ghost { margin-top: 10px; }

#toast {
    position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%);
    z-index: 30; max-width: 80%; padding: 9px 16px; border-radius: 20px;
    background: rgba(60, 44, 32, .92); color: #fff; font-size: 13px;
    opacity: 0; pointer-events: none; transition: opacity .2s; text-align: center;
}
#toast.show { opacity: 1; }

@media (min-width: 520px) {
    .app { margin: 16px auto; min-height: calc(100vh - 32px); border-radius: 14px; overflow: hidden; }
    .tabbar { bottom: 16px; border-radius: 0 0 14px 14px; }
}
