/* ==========================================================================
   掌钟宝 · 管理系统样式
   设计基准：门店看板（远距离可读）+ 移动端优先
   说明：仅负责视觉，不改变任何 DOM 结构与脚本行为。
   ========================================================================== */

/* ---------- 设计令牌 ---------- */
:root {
    --bg: #eef2f6;
    --surface: #ffffff;
    --surface-alt: #f6fafb;
    --surface-sunken: #f1f5f7;
    --line: #e4ecf1;
    --line-2: #d3dfe6;
    --text: #1b2c37;
    --text-2: #5c7180;
    --text-3: #8fa1ad;
    --brand: #0fa08b;
    --brand-2: #0b7f70;
    --brand-ink: #0a6d61;
    --brand-soft: #e8f8f4;
    --free: #12b196;
    --busy: #f0b43c;
    --busy-ink: #48320a;
    --reserved: #8a76d8;
    --paused: #7c8d9c;
    --off-bg: #dfe7ec;
    --off-ink: #5d7080;
    --alert: #e8484f;
    --shadow-sm: 0 1px 2px rgba(16, 44, 58, .06);
    --shadow-md: 0 6px 18px rgba(16, 44, 58, .08);
    --shadow-lg: 0 22px 60px rgba(11, 30, 42, .24);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 7px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
}
body.detail-open { overflow: hidden; }

/* ---------- 页头 ---------- */
.page-header {
    position: sticky;
    top: 6px;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 6px 10px 10px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-md);
}
.page-header h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .6px;
}
.page-header > div:first-child { flex: 1 1 auto; min-width: 0; }
.page-header h1,
.page-header p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-header p {
    margin: 2px 0 0;
    color: var(--text-3);
    font-size: 11.5px;
    letter-spacing: .3px;
}
.header-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}
.header-actions a {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-2);
    font-size: 12px;
    text-decoration: none;
    white-space: nowrap;
    transition: color .16s, border-color .16s, background .16s;
}
.header-actions a:hover,
.header-actions a:focus-visible {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand-2);
    outline: none;
}
.header-actions a.logout {
    border-color: #f4d5d8;
    background: #fff6f7;
    color: #c2424a;
}
.header-actions a.logout:hover { background: #ffecee; border-color: #e9a9ae; color: #a82f37; }

.live-label {
    padding: 5px 10px;
    border: 1px solid #cce7df;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-2);
    font-size: 11.5px;
    white-space: nowrap;
}
.live-label.stale { border-color: #edd8ad; background: #fff8e9; color: #8f6712; }

/* ---------- 看板容器 ---------- */
.board { max-width: 1120px; margin: 0 auto; padding-bottom: 96px; }

/* ---------- 工具条 ---------- */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 8px 10px 8px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.technician-search {
    flex: 1 1 220px;
    min-width: 0;
    max-width: 340px;
    height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: var(--surface-alt);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    transition: border-color .16s, background .16s, box-shadow .16s;
}
.technician-search::placeholder { color: var(--text-3); }
.technician-search:focus {
    border-color: var(--brand);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(15, 160, 139, .14);
    outline: none;
}

.toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    color: var(--text-2);
    font-size: 12.5px;
    white-space: nowrap;
    cursor: pointer;
}
.toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #cbd6dd;
    transition: background .2s;
}
.switch:after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    transition: transform .2s;
}
.toggle input:checked + .switch { background: var(--brand); }
.toggle input:checked + .switch:after { transform: translateX(18px); }
.toggle input:focus-visible + .switch { outline: 2px solid var(--brand); outline-offset: 3px; }

.refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-2);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: background .16s, border-color .16s, color .16s;
}
.refresh:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-2); }
.refresh:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.refresh.is-loading { opacity: .6; cursor: wait; }

/* ---------- 图例 ---------- */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 2px 10px 10px;
    color: var(--text-2);
    font-size: 11.5px;
}
.legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
}
.legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--paused); }
.legend .free-dot { background: var(--free); }
.legend .busy-dot { background: var(--busy); }
.legend .reserved-dot { background: var(--reserved); }

/* ---------- 部门卡 ---------- */
.departments {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 0 10px;
}
.department {
    min-width: 0;
    padding: 13px 11px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.department h2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 11px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}
.department-title {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-2);
    font-weight: 700;
    letter-spacing: .6px;
}
.department-total { color: var(--text-3); font-size: 11.5px; font-weight: 400; white-space: nowrap; }

/* ---------- 技师卡 ---------- */
.technicians {
    display: grid;
    /* 自适应列宽：窄屏自动降为 3 列，避免卡片被压到 80px 以下导致文字截断 */
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 8px;
}
.technician {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1px;
    min-width: 0;
    min-height: 104px;
    padding: 5px 2px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: var(--radius-sm);
    background: #8b9aa8;
    color: #fff;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(16, 44, 58, .12), inset 0 1px 0 rgba(255, 255, 255, .16);
    transition: transform .14s ease, box-shadow .14s ease;
}
.technician.free { background: linear-gradient(158deg, #1ac3a6, #10a389); color: #fff; }
.technician.busy { background: linear-gradient(158deg, #f7c65b, #eda51f); color: var(--busy-ink); }
.technician.reserved { background: linear-gradient(158deg, #9d8ae8, #8270cd); color: #fff; }
.technician.paused { background: linear-gradient(158deg, #8d9cab, #728292); color: #fff; }
.technician.unknown { background: linear-gradient(158deg, #8b9aa8, #74838f); color: #fff; }
.technician.hidden-technician { background: linear-gradient(158deg, #9199a4, #77808c); color: #fff; }
.technician.off {
    background: var(--off-bg);
    border-color: #cfdae1;
    color: var(--off-ink);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5);
}
/* afterWork=3：仍在忙碌队列但已申请下班 —— 红色描边 + 角标，不遮挡内容 */
.technician.pending-off {
    position: relative;
    background: linear-gradient(158deg, #ef8388, #dd4b53);
    color: #fff;
    box-shadow: 0 0 0 2px #d04148, 0 3px 10px rgba(190, 50, 58, .26);
}
.pending-off:before {
    content: '下班';
    position: absolute;
    top: 0;
    right: 0;
    padding: 0 5px;
    border-bottom-left-radius: 7px;
    background: #c22f38;
    color: #fff;
    font-size: 8.5px;
    font-weight: 700;
    line-height: 13px;
    letter-spacing: .5px;
    pointer-events: none;
}

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3px;
    width: 100%;
    padding: 0 4px;
    font-size: 10px;
    font-weight: 400;
    line-height: 15px;
    opacity: .88;
}
.card-top > span { min-width: 0; white-space: nowrap; }
.card-top > span:first-child { flex: 0 0 auto; }
.card-top > span:last-child { flex: 0 1 auto; text-align: right; overflow: hidden; text-overflow: ellipsis; }
.pending-off .card-top { padding-right: 30px; }
.reservation-mark {
    display: inline-block;
    margin-right: 1px;
    padding: 0 2px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .78);
    color: #a2530a;
    font-size: 8px;
    font-weight: 800;
    line-height: 12px;
    vertical-align: 1px;
    letter-spacing: 0;
}

.card-number {
    display: block;
    position: relative;
    z-index: 1;
    font-size: clamp(19px, 5vw, 25px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .5px;
    text-align: center;
}

.time-badge {
    display: inline-block;
    max-width: 100%;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .24);
    color: inherit;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.technician.off .time-badge { background: rgba(255, 255, 255, .62); }
.busy .time-badge { background: rgba(255, 255, 255, .58); color: #8a5300; }
.reserved .time-badge { background: rgba(255, 255, 255, .26); }

.point-wait-badge {
    display: block;
    min-height: 15px;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 15px;
    text-align: center;
    white-space: nowrap;
}
.busy .point-wait-badge { color: #8a3f00; }
.off .point-wait-badge { color: var(--off-ink); }

.card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2px;
    width: 100%;
    padding: 0 3px;
    line-height: 17px;
}
.count { flex: 0 0 auto; min-width: 12px; font-size: 12px; font-weight: 700; line-height: 17px; text-align: center; opacity: .95; }
.status {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .26);
    font-size: 10px;
    line-height: 15px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.busy .status { background: rgba(255, 255, 255, .62); color: #6b4900; }
.pointed .status { background: rgba(255, 255, 255, .68); color: #1c5f88; font-weight: 700; }
.busy.added .status { background: rgba(119, 83, 0, .16); color: #5a3d00; }
.off .status { background: rgba(255, 255, 255, .7); color: #4f6572; }
.unknown .status { background: rgba(255, 255, 255, .22); font-size: 10px; }
.reserved .status { background: rgba(255, 255, 255, .28); }

.technician-trigger {
    display: flex;
    width: 100%;
    border: 0;
    font-family: inherit;
    text-align: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}
.technicians .technician-trigger:hover { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(16, 44, 58, .18); }
.technicians .technician-trigger:active { transform: translateY(0) scale(.985); }
.technicians .technician-trigger:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.department-summary {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin: 10px 0 0;
    padding-top: 9px;
    border-top: 1px dashed var(--line-2);
    color: var(--text-3);
    font-size: 11.5px;
}
.department-summary strong { margin-left: 4px; color: var(--brand-2); font-size: 13.5px; }
.department-summary .working strong { color: #bf8916; }

/* ---------- 数据汇总 ---------- */
.data-summary {
    margin: 14px 10px 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.data-summary-title {
    margin: 0 0 12px;
    padding-left: 9px;
    border-left: 3px solid var(--brand);
    color: var(--text);
    font-size: 13.5px;
    font-weight: 700;
}
.data-summary-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.data-summary-card {
    min-width: 0;
    padding: 9px 4px 8px;
    border-radius: var(--radius-sm);
    background: var(--brand-soft);
    color: var(--brand-2);
    text-align: center;
}
.data-summary-card strong { display: block; font-size: 20px; font-weight: 700; line-height: 26px; }
.data-summary-card span { display: block; color: var(--text-2); font-size: 11px; line-height: 16px; white-space: nowrap; }
.data-summary-card:nth-child(2) { background: #e9f2fb; color: #1d6f9e; }
.data-summary-card:nth-child(3) { background: #f0edfb; color: #6a55c4; }
.data-summary-card:nth-child(4) { background: #fdf3e0; color: #906409; }
.data-summary-card:nth-child(5) { background: #f0f3f6; color: #5f7484; }
.data-summary-card[data-summary-filter] {
    border: 1px dashed #c8d6de;
    background: var(--surface-sunken);
    color: var(--text-2);
    cursor: pointer;
}
.data-summary-card[data-summary-filter]:hover,
.data-summary-card[data-summary-filter]:focus-visible {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand-2);
    outline: none;
}

/* ---------- 提示 / 空态 / 页脚 ---------- */
.notice {
    margin: 0 10px 11px;
    padding: 12px 14px;
    border: 1px solid #f0dda4;
    border-radius: var(--radius-sm);
    background: #fff8e6;
    color: #7c5c11;
    font-size: 13px;
    line-height: 1.7;
}
.notice.error { border-color: #f3cdd0; background: #fff5f5; color: #b3393f; }
.error { color: #b3393f; }
.empty { padding: 26px 0; color: var(--text-3); font-size: 13px; text-align: center; }
.footer {
    padding: 16px 12px 22px;
    color: var(--text-3);
    font-size: 11.5px;
    line-height: 1.9;
    text-align: center;
}
.footer span { color: var(--text-2); font-variant-numeric: tabular-nums; }

.technician-hidden { display: none !important; }
.hide-off .technician[data-off="1"] { display: none; }

/* ---------- 房间即时信息 ---------- */
.room-info-shell { min-height: calc(100vh - 150px); padding-bottom: 14px; }
.room-info-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 10px 10px 0;
    padding: 13px 16px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #0fa08b, #0b7f8f);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1.2px;
    box-shadow: var(--shadow-md);
}
.room-info-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 10px 0;
}
.room-info-filters select {
    width: 100%;
    height: 40px;
    padding: 0 32px 0 12px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    background-color: var(--surface);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path d="M1 1.5l5 5 5-5" fill="none" stroke="%236b8090" stroke-width="1.6" stroke-linecap="round"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    color: var(--text);
    font: 13px/1.4 inherit;
    outline: none;
    box-shadow: var(--shadow-sm);
    -webkit-appearance: none;
    appearance: none;
}
.room-info-filters select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 160, 139, .14);
}
.room-info-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 10px 0;
    padding: 7px 10px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-2);
    font-size: 12.5px;
    box-shadow: var(--shadow-sm);
}
.room-info-search input {
    flex: 1 1 auto;
    min-width: 0;
    height: 26px;
    padding: 0 6px;
    border: 0;
    border-radius: var(--radius-xs);
    background: transparent;
    color: var(--text);
    font: 13px/1.4 inherit;
    outline: none;
}
.room-info-search input:focus { background: var(--surface-alt); box-shadow: inset 0 0 0 1px var(--brand); }
#roomInfoStatus { margin: 8px 12px 6px; color: var(--text-3); font-size: 11.5px; }

.room-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0 8px 80px;
}
.room-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 134px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-2);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.room-card.is-clickable { cursor: pointer; }
.room-card.is-clickable:hover { border-color: var(--brand); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.room-card.is-clickable:active { transform: scale(.985); }
.room-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-height: 27px;
    padding: 4px 8px;
    background: #0fa08b;
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 19px;
}
.room-card-head span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-card-head span:last-child { flex: 0 0 auto; font-size: 10.5px; opacity: .92; }
.room-card-body { flex: 1 1 auto; min-height: 72px; padding: 6px 8px 0; font-size: 10.5px; line-height: 1.6; }
.room-card-body strong { display: block; color: var(--text); font-size: 11.5px; font-weight: 700; }
.room-used-time {
    display: block;
    margin: 2px 0;
    color: var(--brand-2);
    font-size: 24px;
    font-weight: 700;
    line-height: 28px;
    text-align: center;
}
.room-used-time small { margin-left: 2px; color: var(--text-3); font-size: 9px; font-weight: 400; }
.room-card-body .room-service {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    min-width: 0;
    white-space: nowrap;
}
.room-card-body .room-service span,
.room-card-body .room-service button { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.room-card-body .room-service .room-technician-trigger { flex: 0 1 auto; }
.room-card-body .room-service .room-remaining {
    flex: 0 0 auto;
    padding: 0 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-alt);
    color: var(--text-2);
    font-size: 10px;
    font-weight: 700;
    line-height: 15px;
}
.room-card-icon { display: block; margin: 6px auto 0; color: inherit; font-size: 28px; line-height: 32px; text-align: center; opacity: .5; }
.room-card-foot {
    min-height: 20px;
    padding: 0 8px 6px;
    color: var(--text-3);
    font-size: 10px;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.room-card.available { background: #f4fbff; }
.room-card.available .room-card-head { background: #3f97cd; }
.room-card.available .room-used-time { color: #2b7fae; }
.room-card.busy { background: #f6fdfa; }
.room-card.busy .room-card-head { background: #0fa08b; }
.room-card.settled { background: #fff6f5; }
.room-card.settled .room-card-head { background: #e5675f; }
.room-card.guest-present { background: #fff8f2; }
.room-card.guest-present .room-card-head { background: #e08050; }
.room-card.warning { background: #faf6ff; }
.room-card.warning .room-card-head { background: #9a72dc; }
.room-card.cleaning,
.room-card.needs-cleaning,
.room-card.reserved { background: #fffaf0; }
.room-card.cleaning .room-card-head,
.room-card.needs-cleaning .room-card-head,
.room-card.reserved .room-card-head { background: #d4a233; }
.room-card.dark { background: var(--surface-sunken); }
.room-card.dark .room-card-head { background: #7c8892; }

.room-empty {
    grid-column: 1 / -1;
    padding: 36px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-3);
    font-size: 13px;
    text-align: center;
}

.room-technician-trigger {
    display: inline-block;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.room-technician-trigger:hover,
.room-technician-trigger:focus-visible { color: var(--brand-2); text-decoration: underline; outline: none; }

/* ---------- 底部导航 ---------- */
.bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    gap: 2px;
    padding: 6px max(8px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -4px 20px rgba(16, 44, 58, .06);
}
.bottom-nav button,
.bottom-nav a {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    max-width: 340px;
    padding: 7px 4px 5px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text-3);
    font: 12px/1.5 inherit;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: color .18s, background .18s;
}
.bottom-nav svg { display: block; width: 21px; height: 21px; margin: 0 auto 3px; }
.bottom-nav button[aria-selected="true"] { background: var(--brand-soft); color: var(--brand-2); font-weight: 700; }
.bottom-nav button[aria-selected="true"] svg { stroke-width: 2; }

.tab-panel { padding-bottom: 6px; }

/* ---------- 通用面板 / 表单 ---------- */
.room-panel {
    margin: 10px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.room-panel h2 { margin: 0 0 8px; font-size: 17px; font-weight: 700; }
.room-help,
.room-update { margin: 6px 0; color: var(--text-2); font-size: 12.5px; line-height: 1.8; }
.room-update { color: var(--text-3); }

.scan-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font: 600 13.5px/1 inherit;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(15, 160, 139, .24);
    transition: background .16s, box-shadow .16s, transform .16s;
}
.scan-button:hover { background: var(--brand-2); box-shadow: 0 6px 16px rgba(15, 160, 139, .3); }
.scan-button:active { transform: translateY(1px); }
.scan-button:disabled { opacity: .55; cursor: wait; box-shadow: none; }
.scan-button.is-loading { opacity: .65; cursor: wait; }

.account-new-button {
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: var(--surface);
    color: var(--brand-2);
    font: 600 13.5px/1 inherit;
    cursor: pointer;
    transition: background .16s, border-color .16s;
}
.account-new-button:hover { border-color: var(--brand); background: var(--brand-soft); }

.scan-progress { width: 100%; height: 10px; margin-top: 14px; border-radius: 999px; accent-color: var(--brand); }

.lookup-form { display: grid; gap: 10px; margin-top: 14px; }
.lookup-form label { display: grid; gap: 5px; color: var(--text-2); font-size: 12.5px; }
.lookup-form input[type="text"],
.lookup-form input[type="password"],
.lookup-form input[type="date"],
.lookup-form input[type="tel"],
.lookup-form input:not([type]),
.lookup-form select {
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    color: var(--text);
    font: inherit;
    font-size: 13.5px;
    outline: none;
}
.lookup-form input:focus,
.lookup-form select:focus { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px rgba(15, 160, 139, .13); }
.lookup-form input[readonly] { background: var(--surface-sunken); color: var(--text-3); }
.lookup-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lookup-shortcuts { display: flex; flex-wrap: wrap; gap: 7px; }
.lookup-shortcuts button {
    min-height: 32px;
    padding: 0 13px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-2);
    font: 12.5px/1 inherit;
    cursor: pointer;
    transition: background .16s, border-color .16s, color .16s;
}
.lookup-shortcuts button:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-2); }
.lookup-result { margin-top: 14px; }
.lookup-result ul { margin: 8px 0 0; padding: 0; list-style: none; }
.lookup-result li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 0;
    border-top: 1px solid var(--line);
    color: var(--text-2);
    font-size: 12px;
}
.lookup-result li strong { flex: 0 0 auto; color: var(--brand-2); }
.lookup-clock-summary { padding: 8px 10px; border-radius: var(--radius-xs); background: var(--brand-soft); color: var(--brand-2); }

.permission-fieldset {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    padding: 9px 12px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: 12.5px;
}
.permission-fieldset label { display: inline-flex; flex-direction: row; align-items: center; gap: 5px; }
.permission-fieldset legend { color: var(--text-3); font-size: 12px; }

/* 表单里的单行复选框：横排、不参与输入框的竖向布局 */
.lookup-form label.checkbox-field {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 7px;
    width: fit-content;
    color: var(--text-2);
    font-size: 13px;
}
.lookup-form input[type="checkbox"] {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--brand);
    cursor: pointer;
}

/* ---------- 基础功能菜单 ---------- */
.menu-panel {
    margin: 12px 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.menu-section-title {
    margin: 0 0 12px;
    padding: 0 0 0 9px;
    border-left: 3px solid var(--brand);
    background: transparent;
    color: var(--text);
    font-size: 13.5px;
    font-weight: 700;
    line-height: 20px;
}
.menu-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.menu-item {
    min-height: 104px;
    padding: 14px 6px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    color: var(--text-2);
    font: inherit;
    cursor: pointer;
    transition: background .16s, border-color .16s, box-shadow .16s, transform .16s;
}
.menu-item:hover,
.menu-item:focus-visible {
    border-color: var(--brand);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    outline: none;
}
.menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 0 auto 9px;
    border-radius: 13px;
    background: linear-gradient(135deg, #1ac3a6, #0e8d86);
    color: #fff;
    box-shadow: 0 4px 10px rgba(15, 160, 139, .26);
}
.menu-icon svg { width: 22px; height: 22px; }
.menu-label { display: block; color: var(--text); font-size: 13px; line-height: 20px; white-space: nowrap; }
.menu-item:nth-child(2) .menu-icon { background: linear-gradient(135deg, #4aa8e0, #2b86c8); box-shadow: 0 4px 10px rgba(43, 134, 200, .26); }
.menu-item:nth-child(3) .menu-icon { background: linear-gradient(135deg, #f2b84b, #e09b1d); box-shadow: 0 4px 10px rgba(224, 155, 29, .26); }
.menu-item:nth-child(4) .menu-icon { background: linear-gradient(135deg, #a68ae8, #8670d0); box-shadow: 0 4px 10px rgba(134, 112, 208, .26); }
.menu-item:nth-child(5) .menu-icon { background: linear-gradient(135deg, #f28b6a, #dd6b48); box-shadow: 0 4px 10px rgba(221, 107, 72, .26); }
.menu-item:nth-child(6) .menu-icon { background: linear-gradient(135deg, #7f93a4, #647888); box-shadow: 0 4px 10px rgba(100, 120, 136, .26); }

/* ---------- 全屏列表（状态 / 会员 / 记录） ---------- */
.status-overlay,
.member-info-overlay,
.member-record-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}
.status-overlay { z-index: 1200; }
.member-info-overlay { z-index: 1200; }
.member-record-overlay { z-index: 1300; }

.status-head,
.member-info-head,
.member-record-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 54px;
    padding: 0 8px;
    background: linear-gradient(135deg, #0fa08b, #0b7f8f);
    color: #fff;
    box-shadow: 0 2px 12px rgba(11, 90, 86, .24);
}
.status-head-title,
.member-info-title,
.member-record-title {
    flex: 1 1 auto;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .6px;
    text-align: center;
}
.status-back,
.member-info-back,
.status-refresh {
    width: 40px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font: inherit;
    cursor: pointer;
    transition: background .16s;
}
.status-back,
.member-info-back { font-size: 26px; line-height: 1; text-align: center; }
.status-refresh { font-size: 17px; }
.status-back:hover,
.member-info-back:hover,
.status-refresh:hover { background: rgba(255, 255, 255, .28); }
.status-head > span:last-child { display: flex; gap: 6px; }
.member-info-head > span[aria-hidden="true"] { display: block; }

.status-table-wrap { flex: 1 1 auto; overflow: auto; padding: 10px 8px 22px; }
.status-message { padding: 26px 14px; color: var(--text-3); font-size: 13px; text-align: center; }

.status-table {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 12.5px;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}
.status-table th,
.status-table td {
    height: 36px;
    padding: 0 6px;
    border-bottom: 1px solid var(--line);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.status-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 1px solid var(--line-2);
    background: var(--surface-alt);
    color: var(--text-3);
    font-weight: 600;
}
.status-table thead th:first-child { border-top-left-radius: var(--radius-sm); }
.status-table thead th:last-child { border-top-right-radius: var(--radius-sm); }
.status-table tbody tr:nth-child(even) td { background: #fafcfd; }
.status-table tbody tr:hover td { background: var(--brand-soft); }
.status-table tbody tr:last-child td { border-bottom: 0; }
.status-table.technician-status th:nth-child(1) { width: 18%; }
.status-table.technician-status th:nth-child(2) { width: 23%; }
.status-table.technician-status th:nth-child(3) { width: 13%; }
.status-table.technician-status th:nth-child(4) { width: 28%; }
.status-table.technician-status th:nth-child(5) { width: 18%; }
.status-table.room-status th:nth-child(1) { width: 34%; }
.status-table.room-status th:nth-child(2) { width: 33%; }
.status-table.room-status th:nth-child(3) { width: 33%; }
.status-table.vip-waiting th:nth-child(1) { width: 27%; }
.status-table.vip-waiting th:nth-child(2) { width: 22%; }
.status-table.vip-waiting th:nth-child(3) { width: 31%; }
.status-table.vip-waiting th:nth-child(4) { width: 20%; }

/* ---------- 更新数据日志 ---------- */
.technician-id-update-log {
    max-height: 260px;
    margin-top: 8px;
    padding: 9px 11px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    background: var(--surface-alt);
    color: var(--text-2);
    font-size: 12px;
    line-height: 1.7;
}
.technician-id-update-log:empty { display: none; }
.technician-id-update-log p { margin: 0; padding: 2px 0; border-bottom: 1px dashed var(--line); }
.technician-id-update-log p:last-child { border-bottom: 0; }
.technician-id-update-log .success { color: var(--brand-2); }
.technician-id-update-log .failed { color: #b3393f; }
.technician-id-log-overlay {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(14, 30, 40, .5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.technician-id-log-dialog {
    width: min(520px, 100%);
    max-height: min(80vh, 540px);
    padding: 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}
.technician-id-log-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text);
    font-size: 14.5px;
    font-weight: 700;
}
.technician-id-log-close {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: var(--surface-sunken);
    color: var(--text-2);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}
.technician-id-log-close:hover { background: #e6edf1; color: var(--text); }
.technician-id-log-dialog .technician-id-update-log { max-height: 320px; }

/* ---------- 会员即时信息 ---------- */
.member-info-form { display: flex; gap: 8px; margin: 14px 11px 0; height: 44px; }
.member-info-form input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 14px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    outline: none;
}
.member-info-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 160, 139, .13); }
.member-info-form button {
    flex: 0 0 88px;
    border: 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--brand);
    color: #fff;
    font: 600 14px/1 inherit;
    cursor: pointer;
}
.member-info-form button:hover { background: var(--brand-2); }
.member-info-message { padding: 18px 14px; color: var(--text-3); font-size: 13px; text-align: center; }

.member-result-card {
    margin: 12px 10px 0;
    padding: 14px 13px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    color: var(--text);
}
.member-result-main { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; }
.member-money {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 64px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1ac3a6, #0c8b93);
    color: #fff;
    font-size: 30px;
    box-shadow: 0 6px 16px rgba(15, 160, 139, .26);
}
.member-result-info { min-width: 0; }
.member-result-number {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
}
.member-card-type {
    padding: 3px 9px;
    border-radius: 999px;
    background: #fdf3e0;
    color: #926607;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.member-result-name,
.member-result-phone { margin-top: 8px; color: var(--text-2); font-size: 13px; }
.member-result-name::before { content: '· '; color: var(--brand); font-weight: 700; }
.member-result-phone::before { content: '· '; color: #e08050; font-weight: 700; }
.member-result-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    padding-top: 9px;
    border-top: 1px solid var(--line);
    color: var(--text-3);
    font-size: 11.5px;
}
.member-result-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.member-result-actions button {
    padding: 0 12px;
    min-height: 32px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-2);
    font: 12px/1 inherit;
    cursor: pointer;
    transition: background .16s, border-color .16s, color .16s;
}
.member-result-actions button:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-2); }
.member-notice {
    margin: 11px 10px;
    padding: 11px 13px;
    border: 1px solid #f3d7c9;
    border-radius: var(--radius-sm);
    background: #fff7f2;
    color: #b4532b;
    font-size: 12.5px;
    line-height: 1.7;
}

/* ---------- 会员记录 ---------- */
.member-record-close {
    width: 40px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}
.member-record-close:hover { background: rgba(255, 255, 255, .28); }
.member-record-content {
    flex: 1 1 auto;
    padding: 10px 10px 24px;
    overflow: auto;
    overscroll-behavior-y: contain;
}
.member-record-pull {
    height: 0;
    overflow: hidden;
    color: var(--text-3);
    font-size: 12px;
    text-align: center;
    transition: height .15s ease;
}
.member-record-pull.is-visible { height: 28px; padding-top: 6px; }
.member-record-message { padding: 20px 10px; color: var(--text-3); font-size: 13px; text-align: center; }
.member-record-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 8px 0 10px;
    padding: 11px 8px;
    border: 1px solid #cfeae4;
    border-radius: var(--radius-sm);
    background: var(--brand-soft);
    color: var(--brand-2);
    font-size: 11.5px;
    line-height: 1.5;
    text-align: center;
}
.member-record-summary strong { display: block; color: #b44329; font-size: 15px; font-weight: 700; }
.member-record-list { display: grid; gap: 8px; }
.member-record-item {
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    color: var(--text-2);
    font-size: 12.5px;
    line-height: 1.7;
}
.member-record-item-head { display: flex; justify-content: space-between; gap: 10px; color: var(--text); font-weight: 700; }
.member-record-item-main { margin-top: 3px; }
.member-record-item-meta { margin-top: 4px; color: var(--text-3); font-size: 11.5px; }
.member-record-detail-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--brand-2);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}
.member-record-more {
    display: block;
    margin: 14px auto 0;
    padding: 0 20px;
    min-height: 36px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: var(--surface);
    color: var(--brand-2);
    font: 13px/1 inherit;
    cursor: pointer;
}
.member-record-more:hover { border-color: var(--brand); background: var(--brand-soft); }

/* ---------- 消费明细弹层 ---------- */
.member-detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(12, 26, 36, .58);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.member-detail-dialog {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 380px;
    max-height: calc(100vh - 32px);
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    color: var(--text);
}
.member-detail-log {
    flex: 0 0 auto;
    max-height: 90px;
    margin: 10px 10px 0;
    padding: 8px 10px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    background: var(--surface-alt);
    color: var(--text-2);
    font-size: 11px;
    line-height: 1.6;
    text-align: left;
    overscroll-behavior: contain;
}
.member-detail-log p { margin: 0; }
.member-detail-log .error { color: #b3393f; }
.member-detail-sort {
    flex: 0 0 auto;
    display: none;
    width: calc(100% - 20px);
    margin: 8px 10px 0;
    padding: 8px 10px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-xs);
    background: var(--surface-alt);
    color: var(--text);
    font-size: 13px;
}
.member-detail-sort.is-visible { display: block; }
.member-detail-table {
    display: block;
    width: calc(100% - 20px);
    max-height: min(62vh, 560px);
    margin: 10px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    background: var(--surface);
    border-collapse: collapse;
    font-size: 13px;
    text-align: center;
    -webkit-overflow-scrolling: touch;
}
.member-detail-table thead,
.member-detail-table tbody { display: table; width: 100%; table-layout: fixed; }
.member-detail-table th,
.member-detail-table td { height: 32px; border-bottom: 1px solid var(--line); }
.member-detail-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 1px solid var(--line-2);
    background: var(--surface-alt);
    color: var(--text-3);
    font-weight: 600;
}
.member-detail-table tbody tr:nth-child(even) td { background: #fafcfd; }
.member-detail-close {
    flex: 0 0 auto;
    display: block;
    margin: 8px auto 12px;
    padding: 0 26px;
    min-height: 36px;
    border: 0;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font: 600 13px/1 inherit;
    cursor: pointer;
}
.member-detail-close:hover { background: var(--brand-2); }

/* ---------- 技師详情弹层 ---------- */
.detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(12, 26, 36, .58);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.detail-dialog {
    position: relative;
    width: 100%;
    max-width: 390px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}
.detail-banner { height: 78px; background: linear-gradient(135deg, #0fa08b, #1c8fb0); }
.detail-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .26);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(4px);
}
.detail-close:hover { background: rgba(255, 255, 255, .4); }
.detail-avatar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 82px;
    height: 82px;
    margin: -50px auto 16px;
    border: 4px solid var(--surface);
    border-radius: 50%;
    background: linear-gradient(135deg, #12b196, #0c8b93);
    color: #fff;
    box-shadow: 0 8px 20px rgba(13, 123, 155, .24);
}
.detail-avatar svg { width: 46px; height: 46px; }
.detail-number { margin: 0; color: var(--text); font-size: 21px; font-weight: 700; text-align: center; }
.detail-identity { margin: 8px 12px 16px; color: var(--text-3); font-size: 13px; font-weight: 600; text-align: center; }
.detail-rows { margin: 0; padding: 0 18px 18px; }
.detail-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}
.detail-row dt { flex-shrink: 0; color: var(--text-3); font-size: 13px; }
.detail-row dd { margin: 0; color: var(--text); text-align: right; overflow-wrap: anywhere; }
.detail-message { padding: 18px; color: var(--text-3); font-size: 13px; line-height: 1.8; text-align: center; }
.detail-message.is-error { color: #b3393f; }

.detail-income {
    margin: 0 14px 16px;
    padding: 14px;
    border: 1px solid #d8ece8;
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
}
.detail-income-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--brand-2);
    font-size: 13px;
    font-weight: 700;
}
.detail-income-breakdown { display: grid; gap: 4px; margin-bottom: 8px; color: var(--text-2); font-size: 12.5px; }
.detail-income-breakdown div { display: flex; justify-content: space-between; gap: 8px; }
.detail-income-breakdown strong { color: var(--text); }
.detail-income-total { color: var(--brand-2); font-size: 17px; font-weight: 700; }
.detail-income-list { margin: 0; padding: 0; list-style: none; color: var(--text-2); font-size: 12px; line-height: 1.8; }
.detail-income-list li { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid #e2eeeb; }
.detail-income-list button {
    width: 100%;
    padding: 5px 0;
    border: 0;
    background: transparent;
    color: var(--text-2);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.detail-income-list button:hover { color: var(--brand-2); }
.detail-income-message { color: var(--text-3); font-size: 12px; }
.detail-service { margin-top: 10px; padding-top: 10px; border-top: 1px solid #dcece9; }
.detail-service-title { color: var(--brand-2); font-size: 12.5px; font-weight: 700; }
.detail-service-message { margin: 6px 0; color: var(--text-3); font-size: 12px; }
.detail-service-list { margin: 0; padding: 0; list-style: none; color: var(--text-2); font-size: 12px; line-height: 1.7; }
.detail-service-list li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-top: 1px solid #e2eeeb; }
.detail-service-list progress { width: 100%; height: 6px; accent-color: var(--brand); }

/* ---------- 房间消费明细 ---------- */
.room-account-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 12px;
    overflow-y: auto;
    background: rgba(12, 26, 36, .58);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.room-account-dialog {
    width: 100%;
    max-width: 430px;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    color: var(--text);
}
.room-account-head {
    position: relative;
    padding: 14px 48px;
    background: linear-gradient(135deg, #0fa08b, #0b7f8f);
    color: #fff;
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: .6px;
    text-align: center;
}
.room-account-close {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.room-account-close:hover { background: rgba(255, 255, 255, .3); }
.room-account-section-title {
    margin: 0;
    padding: 11px 13px 8px;
    border-left: 3px solid var(--brand);
    background: transparent;
    color: var(--text);
    font-size: 12.5px;
    font-weight: 700;
}
.room-account-basic { padding: 2px 13px 12px; color: var(--text-2); font-size: 12.5px; line-height: 1.9; }
.room-account-basic div { display: flex; gap: 14px; }
.room-account-basic span:first-child { flex: 0 0 70px; width: 70px; color: var(--text-3); }
.room-account-basic strong { color: var(--text); font-weight: 600; }
.room-account-items { border-top: 1px solid var(--line); }
.room-account-item { padding: 10px 13px; border-bottom: 1px solid var(--line); }
.room-account-item-head { display: flex; justify-content: space-between; gap: 8px; color: var(--text); font-size: 13.5px; font-weight: 700; }
.room-account-item-meta { margin-top: 5px; color: var(--text-3); font-size: 11.5px; line-height: 1.7; }
.room-account-item-price { max-width: 58%; color: #dc5223; font-size: 12px; font-weight: 400; line-height: 1.5; text-align: right; }
.room-account-summary { border-top: 1px solid var(--line); background: var(--surface-alt); color: var(--text); }
.room-account-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 13px;
    border-bottom: 1px solid var(--line);
    color: var(--text-2);
    font-size: 12.5px;
}
.room-account-summary-row strong { color: var(--text); }
.room-account-total {
    margin: 10px;
    padding: 13px;
    border: 1px solid #d8ece8;
    border-radius: var(--radius-sm);
    background: var(--brand-soft);
    color: var(--brand-2);
    font-size: 14px;
    text-align: center;
}
.room-account-total strong { margin-left: 6px; color: #d84a1c; font-size: 20px; }
.room-account-message { padding: 30px 14px; background: var(--surface); color: var(--text-3); font-size: 13px; text-align: center; }

/* ---------- 账号 / 个人信息弹层 ---------- */
.account-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(12, 26, 36, .58);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.account-dialog {
    width: min(94%, 760px);
    max-height: 90vh;
    padding: 20px;
    overflow: auto;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}
.account-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.account-dialog-head h2 { margin: 0; color: var(--text); font-size: 17px; font-weight: 700; }
.account-close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: var(--surface-sunken);
    color: var(--text-2);
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
}
.account-close:hover { background: #e6edf1; color: var(--text); }

.personal-info-dialog { max-width: 620px; }
.personal-info-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.personal-info-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.personal-info-summary div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid #d9ece8;
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    color: var(--text-3);
    font-size: 12.5px;
}
.personal-info-summary strong { color: var(--brand-2); font-weight: 700; }
.personal-info-section-title { margin: 18px 0 8px; color: var(--text); font-size: 14px; font-weight: 700; }
.personal-coupon-list { max-height: 300px; margin: 0; padding: 0; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); list-style: none; }
.personal-coupon-list li { padding: 9px 11px; border-top: 1px solid var(--line); color: var(--text-2); font-size: 12.5px; line-height: 1.7; }
.personal-coupon-list li:first-child { border-top: 0; }
.personal-history-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
    color: var(--text-2);
    font-size: 12.5px;
}
.personal-history-row strong { color: var(--brand-2); }
.personal-history-row button { flex: 0 0 auto; padding: 0 14px; min-height: 32px; }
.personal-history-detail { margin: -2px 0 8px; padding: 8px 10px; border-radius: var(--radius-xs); background: var(--surface-alt); color: var(--text-2); font-size: 12px; line-height: 1.7; }

.profile-admin { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.profile-admin h3 { margin: 0 0 6px; color: var(--text); font-size: 14.5px; }
.profile-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); color: var(--text-2); font-size: 12px; }
.profile-row span { min-width: 0; overflow-wrap: anywhere; }
.profile-row .scan-button { flex: 0 0 auto; min-height: 30px; padding: 0 12px; }

/* ---------- 排班查询结果（房间分组） ---------- */
.room-results { display: grid; gap: 12px; margin: 14px 10px; }
.room-group {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.room-group h3 { margin: 0 0 10px; color: var(--brand-2); font-size: 14px; font-weight: 700; }
.room-group.shared { border-color: #9ed8cc; }
.room-person { padding: 9px 0; border-top: 1px solid var(--line); color: var(--text-2); font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.room-person:first-of-type { border-top: 0; }
.room-person strong { display: inline-block; margin-right: 8px; color: var(--text); font-size: 16px; }
.room-person small { color: var(--text-3); }

/* ---------- 排名 ---------- */
.ranking-first {
    color: #b3262e;
    border: 1px solid #f3c3c7;
    background: linear-gradient(135deg, #fff5f5, #fffbf2);
    box-shadow: 0 4px 14px rgba(200, 60, 70, .12);
    font-weight: 800;
}
.ranking-champion {
    border: 1px solid #ecc9cd;
    background: linear-gradient(135deg, #fff6f6, #fffaf0);
    color: #a82830;
    font-weight: 700;
}
.ranking-total { border: 1px solid #b5e5db; background: linear-gradient(135deg, #eefcf8, #f7fffd); color: var(--brand-2); font-weight: 700; }
.ranking-row { align-items: center; flex-wrap: wrap; font-size: 13px; font-weight: 400; }
.ranking-row.ranking-first { border: 0; background: transparent; box-shadow: none; color: inherit; font-weight: 400; }
.ranking-person-name { flex: 1 1 100%; min-width: 0; color: var(--text); font-size: 13px; font-weight: 600; line-height: 1.5; }
.ranking-clock-summary { display: flex; flex: 1 1 100%; min-width: 0; gap: 5px; color: var(--text-3); font-size: 11px; font-weight: 400; line-height: 1.4; }
.ranking-stat { padding: 1px 6px; border-radius: 999px; background: var(--surface-sunken); white-space: nowrap; }
.ranking-stat-total { background: var(--brand-soft); color: var(--brand-2); }
.ranking-wage-summary { flex: 0 1 auto; min-width: 0; color: var(--brand-2); font-size: 14px; font-weight: 700; line-height: 1.4; text-align: right; white-space: normal; overflow-wrap: anywhere; }
.ranking-wage-reward { flex: 1 1 100%; color: #96670c; text-align: left; }
.ranking-champion-row { font-size: 13px; font-weight: 600; line-height: 1.5; }
.ranking-results { padding-bottom: 8px; }

/* ---------- 响应式 ---------- */
@media (min-width: 760px) {
    .departments { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px; }
    .department { padding: 16px 16px 14px; }
    .department h2 { font-size: 14px; }
    .technicians { gap: 10px; }
    .technician { height: 118px; }
    .card-number { font-size: 27px; }
    .room-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; padding-right: 12px; padding-left: 12px; }
    .room-info-filters,
    .room-info-search { max-width: 900px; margin-right: auto; margin-left: auto; }
    .room-info-header { max-width: 900px; margin-right: auto; margin-left: auto; }
    .room-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
    .page-header { flex-wrap: wrap; gap: 9px; }
    .page-header > div:first-child { flex-basis: 100%; }
    .header-actions { flex: 1 1 100%; }
    .header-actions a { flex: 1 1 0; justify-content: center; }
    .toolbar { flex-wrap: wrap; align-items: stretch; }
    .technician-search { order: -1; flex-basis: 100%; max-width: none; }
    .personal-info-summary { grid-template-columns: 1fr; }
    .data-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .data-summary-card strong { font-size: 18px; }
    .member-detail-overlay { align-items: flex-start; padding: 10px; overflow: hidden; }
    .member-detail-dialog { max-height: calc(100dvh - 20px); }
    .member-detail-table { max-height: min(58dvh, 500px); font-size: 12.5px; }
    .member-detail-table th,
    .member-detail-table td { height: 30px; }
    .ranking-row { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 6px !important; align-items: center; padding: 10px 0; }
    .ranking-person-name { grid-row: 1; grid-column: 1; min-width: 0; font-size: 13px; line-height: 1.4; }
    .ranking-clock-summary { grid-row: 2; grid-column: 1 / -1; gap: 3px; font-size: 10px; line-height: 1.3; }
    .ranking-stat { padding: 1px 5px; }
    .ranking-wage-summary { grid-row: 1; grid-column: 2; min-width: 0; max-width: 45vw; font-size: 11px; line-height: 1.25; text-align: right; }
    .ranking-wage-reward { grid-row: 3; grid-column: 1 / -1; max-width: none; font-size: 12px; text-align: left; }
    .ranking-champion-row { font-size: 12px; line-height: 1.35; }
}

@media (max-width: 380px) {
    .page-header { padding: 10px 12px; }
    .page-header h1 { font-size: 16px; }
    .header-actions a { height: 28px; padding: 0 10px; font-size: 11.5px; }
    .toolbar { padding: 9px; }
    .department { padding: 11px 8px 9px; }
    .technicians { gap: 6px; }
    .technician { height: 90px; border-radius: 9px; }
    .card-number { font-size: 20px; }
    .card-bottom { padding: 0 3px; }
    .card-top { padding: 0 5px; }
    .menu-item { min-height: 98px; }
    .menu-label { font-size: 12.5px; }
    .status-table { font-size: 12px; }
    .room-grid { gap: 6px; padding-right: 5px; padding-left: 5px; }
    .room-card { min-height: 126px; }
    .room-card-head { font-size: 12px; }
    .room-info-search { margin-right: 6px; margin-left: 6px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* ---------- 技师详情内容区 ---------- */
.detail-content { padding: 0; }
.detail-content .detail-rows { padding-bottom: 14px; }

/* ---------- 技师 ID 备份表 ---------- */
/* 6 列在手机上必然拥挤：改固定布局 + 允许换行，保证每列都能看到，不出现横向滚动 */
.status-table.technician-id-table { table-layout: fixed; font-size: 11.5px; }
.status-table.technician-id-table th,
.status-table.technician-id-table td {
    height: auto;
    min-height: 34px;
    padding: 7px 4px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    line-height: 1.35;
}
.status-table.technician-id-table th { padding-top: 6px; padding-bottom: 6px; }
.status-table.technician-id-table th:nth-child(1) { width: 11%; }
.status-table.technician-id-table th:nth-child(2) { width: 13%; }
.status-table.technician-id-table th:nth-child(3) { width: 15%; }
.status-table.technician-id-table th:nth-child(4) { width: 19%; }
.status-table.technician-id-table th:nth-child(5) { width: 24%; }
.status-table.technician-id-table th:nth-child(6) { width: 18%; }

/* ---------- 登录页 ---------- */
body.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px 16px;
    background:
        radial-gradient(1200px 600px at 12% -8%, #d6f2ea 0%, rgba(214, 242, 234, 0) 60%),
        radial-gradient(900px 500px at 100% 0%, #dcebf7 0%, rgba(220, 235, 247, 0) 55%),
        var(--bg);
}
.login {
    width: min(100%, 372px);
    margin: 0;
    padding: 30px 26px 26px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 18px 46px rgba(16, 44, 58, .14);
}
.login h1 {
    margin: 0 0 4px;
    color: var(--text);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: .8px;
}
.login h1:after {
    content: '门店排班 · 上钟状态';
    display: block;
    margin-top: 6px;
    color: var(--text-3);
    font-size: 11.5px;
    font-weight: 400;
    letter-spacing: .4px;
}
.login label { display: block; margin: 15px 0 0; color: var(--text-2); font-size: 12.5px; }
.login input {
    width: 100%;
    min-height: 44px;
    margin-top: 6px;
    padding: 0 13px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    color: var(--text);
    font: 15px/1.4 inherit;
    outline: none;
}
.login input:focus { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px rgba(15, 160, 139, .14); }
.login button {
    width: 100%;
    min-height: 46px;
    margin-top: 20px;
    padding: 0 18px;
    border: 0;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #12b196, #0b7f70);
    color: #fff;
    font: 600 15px/1 inherit;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(15, 160, 139, .28);
    transition: filter .16s, box-shadow .16s, transform .16s;
}
.login button:hover { filter: brightness(1.05); box-shadow: 0 10px 24px rgba(15, 160, 139, .34); }
.login button:active { transform: translateY(1px); }
.login .error { min-height: 0; margin-bottom: 6px; color: #c2424a; font-size: 12.5px; }
.login .error:empty { display: none; }

/* ---------- 账号管理页 ---------- */
body.account-page-body {
    min-height: 100vh;
    padding: 26px 16px 40px;
    background: var(--bg);
}
.account-page { width: min(100%, 860px); margin: 0 auto; }
.account-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
    padding: 16px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.account-head h1 { margin: 0; color: var(--text); font-size: 19px; font-weight: 700; }
.account-head a {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 14px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-2);
    font-size: 12.5px;
    text-decoration: none;
    transition: background .16s, border-color .16s, color .16s;
}
.account-head a:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-2); }
.account-card {
    margin-bottom: 14px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.account-card h2 {
    margin: 0 0 14px;
    padding-left: 9px;
    border-left: 3px solid var(--brand);
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    line-height: 20px;
}
.account-card p { color: var(--text-2); font-size: 13px; line-height: 1.8; }
.account-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
/* 只作用于直接子级 label，避免权限/状态里的嵌套 label 被拆成竖排 */
.account-form > label { display: flex; flex-direction: column; gap: 6px; color: var(--text-2); font-size: 12.5px; }
.account-form > label > span { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-height: 40px; }
.account-form > label > span > label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-2);
    font-size: 13px;
    line-height: 1.4;
    white-space: nowrap;
} 

/* 状态与功能权限：与输入框同高的一行，占满整行宽度 */
.account-form > label.account-field-wide { grid-column: 1 / -1; }
.account-form > label.account-field-wide > span { min-height: 0; }
.account-form > .account-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }
.account-form > .account-actions button { flex: 0 1 auto; min-width: 132px; }
.account-form input[type="checkbox"] {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--brand);
    cursor: pointer;
}
.account-form input[type="text"],
.account-form input[type="password"] {
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    color: var(--text);
    font: 14px/1.4 inherit;
    outline: none;
}
.account-form input[type="text"]:focus,
.account-form input[type="password"]:focus { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px rgba(15, 160, 139, .13); }
.account-form button {
    min-height: 40px;
    padding: 0 20px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--brand);
    color: #fff;
    font: 600 13.5px/1 inherit;
    cursor: pointer;
    transition: background .16s;
}
.account-form button:hover { background: var(--brand-2); }
.account-form button[type="button"] {
    border: 1px solid var(--line-2);
    background: var(--surface);
    color: var(--text-2);
}
.account-form button[type="button"]:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-2); }
.account-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 2px;
    border-top: 1px solid var(--line);
    color: var(--text-2);
    font-size: 13px;
}
.account-row:first-child { border-top: 0; }
.account-row span { min-width: 0; overflow-wrap: anywhere; }
.account-row button {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 0 14px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: var(--surface);
    color: var(--brand-2);
    font: 12.5px/1 inherit;
    cursor: pointer;
    transition: background .16s, border-color .16s;
}
.account-row button:hover { border-color: var(--brand); background: var(--brand-soft); }
.account-message { min-height: 20px; color: #c2424a; font-size: 12.5px; }

@media (max-width: 650px) {
    .account-form { grid-template-columns: 1fr; }
    .account-head { flex-direction: column; align-items: flex-start; }
    .account-row { flex-direction: column; align-items: flex-start; gap: 8px; }
}