/* =========================================================
   前台样式 · 九头鸟食府宾客短信系统 v3.0
   设计语言：正红 × 鎏金 / 中式餐饮质感 / 响应式移动优先
   ========================================================= */
:root {
    --brand: #9e1f19;
    --brand-deep: #7a1511;
    --brand-light: #c73e36;
    --brand-grad: linear-gradient(135deg, #b32820 0%, #7a1511 100%);
    --gold: #d9a441;
    --gold-soft: #f3e3c3;
    --ink: #26282e;
    --ink-soft: #767c88;
    --line: #e7e5df;
    --bg: #f7f5f1;
    --card: #ffffff;
    --ok: #0e9f6e;
    --ok-bg: #ecfdf5;
    --err: #dc2626;
    --err-bg: #fef2f2;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 12px 32px rgba(38, 40, 46, .08);
    --shadow-lg: 0 20px 48px rgba(38, 40, 46, .14);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
html, body { touch-action: manipulation; -ms-touch-action: manipulation; }
/* 输入聚焦时禁止 iOS/Android 自动缩放 */
input, select, textarea { font-size: 16px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    background:
        radial-gradient(1100px 420px at 85% -8%, rgba(217, 164, 65, .14), transparent 60%),
        radial-gradient(800px 520px at -12% 108%, rgba(158, 31, 25, .07), transparent 55%),
        var(--bg);
    color: var(--ink);
    line-height: 1.65;
    min-height: 100vh;
}
.is-hidden { display: none !important; }
a { color: var(--brand); text-decoration: none; }

/* ===================== 登录屏 ===================== */
.login-screen {
    min-height: 100vh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 32px 16px;
    background:
        radial-gradient(900px 500px at 50% -10%, rgba(217, 164, 65, .18), transparent 60%),
        linear-gradient(180deg, #f9f6f0 0%, #f2ece3 100%);
}
.login-panel {
    width: 100%; max-width: 400px;
    background: var(--card);
    border-radius: 22px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    padding: 44px 36px 32px;
    text-align: center;
    animation: rise .5s cubic-bezier(.2, .8, .2, 1);
}
.login-panel.shake { animation: shake .45s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes shake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-7px); }
    40%, 60% { transform: translateX(7px); }
}
.login-brand { margin-bottom: 28px; }
.brand-mark {
    width: 72px; height: 72px; margin: 0 auto 16px;
    display: grid; place-items: center; overflow: hidden;
    background: var(--brand-grad); color: #fff;
    font-family: "Noto Serif SC", "SimSun", serif;
    font-size: 32px; font-weight: 700;
    border-radius: 20px;
    border: 1px solid rgba(217, 164, 65, .6);
    box-shadow: 0 14px 28px rgba(158, 31, 25, .35);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-mark--sm { width: 38px; height: 38px; margin: 0; font-size: 17px; border-radius: 11px; }
.login-brand h1 { font-size: 1.5rem; letter-spacing: 1px; font-family: "Noto Serif SC", "SimSun", serif; }
.login-brand p { color: var(--ink-soft); font-size: .9rem; margin-top: 2px; letter-spacing: 3px; }

.login-form .input-wrap { position: relative; margin-bottom: 16px; text-align: left; }
.input-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    width: 19px; height: 19px; fill: #b3aca0; pointer-events: none;
}
.login-form input {
    width: 100%; padding: 13px 16px 13px 44px;
    border: 1.5px solid var(--line); border-radius: 12px;
    font-size: 1rem; font-family: inherit;
    letter-spacing: 2px;
    background: #fbfaf8;
    transition: border-color .2s, box-shadow .2s;
}
.login-form input:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(158, 31, 25, .1);
}
.login-error {
    color: var(--err); font-size: .85rem; margin-top: 12px;
    background: var(--err-bg); border-radius: 8px; padding: 8px 10px;
}
.login-tip { color: #b3aca0; font-size: .78rem; margin-top: 18px; letter-spacing: 1px; }
.login-ribbon {
    margin-top: 26px; color: #c0b8aa; font-size: .75rem; letter-spacing: 1px;
}

/* ===================== 按钮 ===================== */
.btn-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    width: 100%; padding: 14px 24px;
    background: var(--brand-grad); color: #fff;
    border: none; border-radius: 12px; cursor: pointer;
    font-size: 1rem; font-weight: 600; font-family: inherit; letter-spacing: 2px;
    box-shadow: 0 10px 22px rgba(158, 31, 25, .32);
    transition: transform .15s, box-shadow .2s, filter .2s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(158, 31, 25, .4); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { filter: grayscale(.4) opacity(.7); cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }
.btn-ico { width: 18px; height: 18px; fill: currentColor; }
.btn-spin {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-ghost-sm {
    display: inline-flex; align-items: center; gap: 5px;
    background: transparent; border: 1.5px solid rgba(255, 255, 255, .4);
    color: #fff; padding: 6px 12px; border-radius: 9px;
    font-size: .8rem; cursor: pointer; font-family: inherit;
    transition: background .2s;
}
.btn-ghost-sm:hover { background: rgba(255, 255, 255, .14); }
.btn-ghost-sm svg { width: 14px; height: 14px; fill: currentColor; }

/* ===================== 顶栏 / 标签 ===================== */
.topbar {
    position: sticky; top: 0; z-index: 40;
    background: var(--brand-grad);
    box-shadow: 0 6px 20px rgba(122, 21, 17, .28);
}
.topbar__inner {
    max-width: 980px; margin: 0 auto;
    padding: 12px 18px;
    display: flex; align-items: center; justify-content: space-between;
    color: #fff;
}
.topbar__brand { display: flex; align-items: center; gap: 12px; }
.topbar__title { display: flex; flex-direction: column; line-height: 1.25; }
.topbar__title strong { font-size: 1.02rem; font-family: "Noto Serif SC", "SimSun", serif; letter-spacing: 1px; }
.topbar__title em { font-style: normal; font-size: .72rem; opacity: .75; letter-spacing: 2px; }
.topbar__meta { display: flex; align-items: center; gap: 14px; }
.topbar__clock { font-variant-numeric: tabular-nums; font-size: .9rem; opacity: .9; }

.tabbar {
    max-width: 980px; margin: 0 auto;
    display: flex; gap: 4px;
    padding: 0 12px 10px;
}
.tab {
    display: inline-flex; align-items: center; gap: 7px;
    background: rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .8);
    border: none; cursor: pointer;
    padding: 9px 18px; border-radius: 999px;
    font-size: .9rem; font-weight: 500; font-family: inherit;
    transition: background .2s, color .2s;
}
.tab svg { width: 16px; height: 16px; fill: currentColor; }
.tab:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.tab.is-active { background: #fff; color: var(--brand-deep); font-weight: 700; box-shadow: 0 4px 12px rgba(0, 0, 0, .18); }

/* ===================== 内容区 ===================== */
.content { max-width: 980px; margin: 0 auto; padding: 22px 16px 40px; }
.tabpanel { display: none; animation: fadeIn .3s ease; }
.tabpanel.is-active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card__head { padding: 22px 24px 0; }
.card__head h2 { font-size: 1.12rem; font-family: "Noto Serif SC", "SimSun", serif; letter-spacing: .5px; }
.card__head p { color: var(--ink-soft); font-size: .84rem; margin-top: 2px; }

.form-card form { padding: 20px 24px 26px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }

.field { margin-bottom: 16px; min-width: 0; }
.field label { display: block; font-size: .86rem; font-weight: 600; margin-bottom: 6px; color: #3d4148; }
.field label em { color: var(--err); font-style: normal; margin-left: 2px; }
.field input, .field select {
    width: 100%; padding: 11px 13px;
    border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    font-size: 16px; font-family: inherit;
    background: #fbfaf8;
    transition: border-color .2s, box-shadow .2s, background .2s;
    appearance: none;
}
.field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath fill='%23a09a8e' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
    padding-right: 34px;
}
.field input:focus, .field select:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(158, 31, 25, .1);
    background: #fff;
}
.field input[readonly] { background: var(--gold-soft); color: #8a6d2f; font-weight: 600; }

/* 发送方式选择 */
.method-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.method-option { position: relative; cursor: pointer; }
.method-option input { position: absolute; opacity: 0; pointer-events: none; }
.method-option__body {
    display: flex; flex-direction: column; gap: 2px;
    border: 1.5px solid var(--line); border-radius: 12px;
    padding: 13px 14px 12px 46px;
    position: relative;
    transition: border-color .2s, background .2s, box-shadow .2s;
    height: 100%;
}
.method-option__body::before {
    content: ""; position: absolute; left: 16px; top: 19px;
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid #c8c2b6;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.method-option__body svg { position: absolute; left: 41px; top: 18px; width: 0; height: 0; }
.method-option__body strong { font-size: .92rem; color: #3d4148; }
.method-option__body small { font-size: .76rem; color: var(--ink-soft); }
.method-option input:checked + .method-option__body {
    border-color: var(--brand);
    background: #fdf7f4;
    box-shadow: 0 0 0 3px rgba(158, 31, 25, .08);
}
.method-option input:checked + .method-option__body::before {
    border-color: var(--brand);
    background: radial-gradient(circle at center, var(--brand) 0 45%, #fff 50%);
}

/* ===================== 看板 ===================== */
.board-card .board-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 16px;
}
.date-input {
    padding: 9px 13px; border: 1.5px solid var(--line); border-radius: 10px;
    font-family: inherit; font-size: .9rem; background: #fbfaf8;
}
.date-input:focus { outline: none; border-color: var(--brand); }
.board-grid {
    padding: 0 16px 20px;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    max-height: 560px; overflow-y: auto;
}
.room-cell {
    border: 1.5px solid var(--line); border-radius: 12px;
    padding: 13px 15px; background: #fdfdfc;
    min-height: 64px;
}
.room-cell.is-busy { border-color: rgba(158, 31, 25, .35); background: #fdf5f2; }
.room-cell__title {
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 700; font-size: .95rem; margin-bottom: 6px;
}
.room-badge {
    font-size: .68rem; padding: 2px 9px; border-radius: 999px;
    background: var(--ok-bg); color: var(--ok); font-weight: 600;
}
.room-badge.is-busy { background: #fdecea; color: var(--brand); }
.room-booking {
    display: flex; justify-content: space-between; gap: 8px;
    font-size: .8rem; color: #4a4e55;
    padding: 5px 0; border-top: 1px dashed #eee;
}
.room-booking:first-of-type { border-top: none; }
.room-booking b { color: var(--brand-deep); }

.state-empty {
    grid-column: 1 / -1;
    text-align: center; color: var(--ink-soft);
    padding: 44px 16px; font-size: .9rem;
}

/* ===================== 记录 ===================== */
.history-card .history-list { padding: 6px 16px 20px; max-height: 640px; overflow-y: auto; }
.history-item {
    display: grid; grid-template-columns: 1fr auto; gap: 4px 12px;
    padding: 14px 4px; border-bottom: 1px solid #f0eee8;
    animation: fadeIn .25s ease;
}
.history-item:last-child { border-bottom: none; }
.history-item__name { font-weight: 700; font-size: .95rem; }
.history-item__name span { color: var(--ink-soft); font-weight: 400; font-size: .82rem; margin-left: 8px; }
.history-item__time { color: var(--ink-soft); font-size: .8rem; grid-column: 1 / -1; }
.history-item__tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
    font-size: .72rem; padding: 2px 9px; border-radius: 999px;
    background: #f3f1ea; color: #6a6f78; font-weight: 500;
}
.tag--room { background: var(--gold-soft); color: #8a6d2f; }
.tag--method { background: #e8f0fe; color: #3567c4; }
.tag--status-ok { background: var(--ok-bg); color: var(--ok); }
.tag--status-recorded { background: #fff7e6; color: #b4740c; }

.foot {
    text-align: center; color: #b7b1a4; font-size: .76rem;
    margin-top: 28px; line-height: 2;
}
.foot__sep { margin: 0 8px; opacity: .5; }

/* ===================== 弹窗 ===================== */
.modal-mask {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(30, 26, 22, .55);
    backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    padding: 18px;
    animation: fadeIn .2s ease;
}
.modal {
    width: 100%; max-width: 480px; max-height: 86vh;
    background: var(--card); border-radius: 18px;
    box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column;
    animation: rise .3s cubic-bezier(.2, .8, .2, 1);
    overflow: hidden;
}
.modal__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.modal__head h3 { font-size: 1rem; font-family: "Noto Serif SC", "SimSun", serif; }
.modal__close {
    border: none; background: transparent; cursor: pointer;
    font-size: 1.5rem; line-height: 1; color: var(--ink-soft);
    padding: 2px 6px; border-radius: 6px;
}
.modal__close:hover { background: #f3f1ea; color: var(--ink); }
.modal__body { padding: 18px 20px; overflow-y: auto; }
.modal__foot {
    display: flex; gap: 10px; padding: 14px 20px 18px;
    border-top: 1px solid var(--line);
}
.modal__foot .btn-primary { width: auto; flex: 1; letter-spacing: 1px; padding: 12px 18px; }
.btn-cancel {
    flex: 1; padding: 12px 18px;
    background: #f3f1ea; color: #565b63;
    border: none; border-radius: 12px; cursor: pointer;
    font-size: .95rem; font-weight: 600; font-family: inherit;
    transition: background .2s;
}
.btn-cancel:hover { background: #e9e6dd; }

.sms-preview {
    background: #f8f6f0; border: 1px solid #e7e3d8;
    border-radius: 12px; padding: 16px;
    font-size: .88rem; line-height: 1.8;
    white-space: pre-wrap; word-break: break-all;
    max-height: 44vh; overflow-y: auto;
}
.sms-preview-dest {
    display: flex; align-items: center; gap: 10px;
    background: var(--gold-soft); border-radius: 10px;
    padding: 10px 14px; margin-bottom: 14px;
    font-size: .88rem; color: #8a6d2f;
}
.sms-preview-dest b { font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.modal-warn {
    display: flex; gap: 8px; align-items: flex-start;
    margin-top: 14px; font-size: .8rem; color: #a16207;
    background: #fff7e6; border-radius: 10px; padding: 10px 12px;
}
.modal-ok-icon {
    width: 64px; height: 64px; margin: 8px auto 14px;
    display: grid; place-items: center;
    background: var(--ok-bg); color: var(--ok);
    border-radius: 50%; font-size: 30px; font-weight: 700;
    border: 2px solid rgba(14, 159, 110, .3);
}
.modal-ok-text { text-align: center; font-size: .95rem; }
.modal-ok-text small { display: block; color: var(--ink-soft); margin-top: 4px; }

/* ===================== Toast ===================== */
.toast {
    position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
    z-index: 200;
    background: rgba(38, 40, 46, .92); color: #fff;
    padding: 11px 22px; border-radius: 999px;
    font-size: .88rem; box-shadow: var(--shadow-lg);
    animation: toastIn .3s ease;
    max-width: min(90vw, 420px); text-align: center;
}
.toast--ok::before { content: "✓ "; color: #6ee7b7; font-weight: 700; }
.toast--err { background: rgba(158, 31, 25, .95); }
.toast--err::before { content: "✕ "; font-weight: 700; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ===================== 系统更新日志浮窗 ===================== */
.fab {
    position: fixed; right: 20px; bottom: 24px; z-index: 120;
    width: 52px; height: 52px; border-radius: 50%;
    border: none; cursor: pointer;
    background: var(--brand-grad);
    color: #fff; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 18px rgba(158, 31, 25, .38);
    transition: transform .18s ease, box-shadow .18s ease;
}
.fab svg { width: 26px; height: 26px; fill: #fff; }
.fab:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 10px 24px rgba(158, 31, 25, .46); }
.fab:active { transform: scale(.96); }
.fab__badge {
    position: absolute; top: -4px; right: -6px;
    background: var(--gold); color: #7a2a10;
    font-size: .62rem; font-weight: 800; padding: 1px 7px; border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}

/* 更新日志弹窗内容 */
.changelog { display: flex; flex-direction: column; gap: 14px; max-height: 60vh; overflow: auto; padding-right: 4px; }
.changelog__ver { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.changelog__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.changelog__tag {
    background: var(--brand); color: #fff; font-size: .78rem; font-weight: 800;
    padding: 2px 12px; border-radius: 999px; letter-spacing: .5px;
}
.changelog__date { color: var(--ink-soft); font-size: .76rem; }
.changelog__list { margin: 0; padding-left: 4px; list-style: none; }
.changelog__list li {
    position: relative; padding: 3px 0 3px 18px; font-size: .88rem; color: var(--ink);
    line-height: 1.55;
}
.changelog__list li::before {
    content: ""; position: absolute; left: 4px; top: 11px;
    width: 6px; height: 6px; border-radius: 50%; background: var(--brand);
}

/* 浮窗小屏适配 */
@media (max-width: 640px) {
    .fab { right: 14px; bottom: 76px; width: 48px; height: 48px; }
}

/* ===================== 响应式 ===================== */
@media (max-width: 640px) {
    .content { padding: 16px 12px 32px; }
    .form-card form { padding: 16px 16px 20px; }
    /*.form-grid { grid-template-columns: 1fr; }*/
    /*.method-options { grid-template-columns: 1fr; }*/
    .card__head { padding: 18px 16px 0; }
    .tabbar { padding: 0 8px 10px; }
    .tab { padding: 8px 12px; font-size: .82rem; }
    .topbar__clock { display: none; }
    .topbar__inner { padding: 10px 14px; }
    .login-panel { padding: 34px 22px 24px; }
    .board-grid { grid-template-columns: 1fr; max-height: none; }
    .modal-mask { padding: 12px; align-items: flex-end; }
    .modal { max-height: 90vh; border-radius: 18px 18px 12px 12px; }
}
