/* KDS 手机版 H5 公共样式（M5 订房/房态）。
   深色主题与 PC 一致：#1a1d29 底 / #232839 卡片 / #3a3f4f 边框 / #ffcc00 主色。 */
:root {
    --bg: #1a1d29;
    --card: #232839;
    --border: #3a3f4f;
    --accent: #ffcc00;
    --text: #e0e0e0;
    --muted: #8b93a7;
    --green: #34c76a;
}

html, body {
    background: var(--bg);
    color: var(--text);
    font-size: 16px; /* 防 iOS 聚焦缩放 */
}

body {
    min-height: 100vh;
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

/* ---------- 顶栏 ---------- */
.m-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 10px 12px calc(10px);
}

.m-topbar .m-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.m-topbar a, .m-topbar .m-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 15px;
}

/* ---------- 卡片 ---------- */
.m-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
}

.m-card + .m-card { margin-top: 12px; }

/* ---------- 表单 ---------- */
.form-control, .form-select {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    min-height: 46px;
    font-size: 16px;
}

.form-control:focus, .form-select:focus {
    background: var(--bg);
    color: var(--text);
    border-color: var(--accent);
    box-shadow: 0 0 0 .2rem rgba(255, 204, 0, .15);
}

.form-control::placeholder { color: #a8b3c7; opacity: 1; }
/* 勾选框在深色主题下的可见度：边框提亮，勾选态用主题黄 */
.form-check-input { background-color: var(--bg, #1a1d29); border-color: #7d8698; }
.form-check-input:checked { background-color: var(--accent, #ffcc00); border-color: var(--accent, #ffcc00); }
.form-check-label { color: var(--text, #e0e0e0); }

.form-label { color: var(--muted); font-size: 14px; margin-bottom: 4px; }

.form-control-color-note { color: var(--muted); }

/* 时段选择胶囊（radio） */
.shift-pill {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--muted);
    background: var(--bg);
    font-size: 15px;
    cursor: pointer;
    user-select: none;
}

.shift-pill input { display: none; }

.shift-pill.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(255, 204, 0, .12);
    font-weight: 600;
}

/* ---------- 大按钮 ---------- */
.btn-accent {
    background: var(--accent);
    border: none;
    color: #1a1d29;
    font-weight: 600;
    font-size: 17px;
    padding: 12px;
    width: 100%;
}

.btn-accent:hover, .btn-accent:focus {
    background: #e6b800;
    color: #1a1d29;
}

.btn-outline-m {
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    min-height: 44px;
    font-size: 15px;
}

.btn-outline-m:hover { border-color: var(--accent); color: var(--accent); }

.btn-outline-m.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(255, 204, 0, .12);
}

/* ---------- 房态板 ---------- */
.room-card { padding: 10px 12px; }

.room-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.slot-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.slot {
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(26, 29, 41, .85);
    padding: 8px 6px;
    min-height: 84px;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    overflow: hidden;
}

.slot:active { filter: brightness(1.2); }

.slot .slot-shift { font-size: 12px; color: var(--muted); }
.slot .slot-main { font-size: 14px; font-weight: 600; line-height: 1.25; }
.slot .slot-sub { font-size: 12px; color: var(--muted); line-height: 1.25; }

.slot.slot-free { color: var(--muted); }
.slot .slot-free-hint { font-size: 13px; color: #6b7284; }

.slot.slot-booked {
    background: rgba(255, 204, 0, .13);
    border-color: rgba(255, 204, 0, .75);
}
.slot.slot-booked .slot-main { color: var(--accent); }

.slot.slot-open {
    background: rgba(52, 199, 106, .13);
    border-color: rgba(52, 199, 106, .75);
}
.slot.slot-open .slot-main { color: var(--green); }

/* ---------- 列表 / 徽标 ---------- */
.muted { color: var(--muted); }

.badge-soft {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
}

.badge-booked { background: rgba(255, 204, 0, .15); color: var(--accent); }
.badge-open { background: rgba(52, 199, 106, .15); color: var(--green); }
.badge-cancelled { background: rgba(139, 147, 167, .18); color: var(--muted); }

/* ---------- 底部栏 ---------- */
.m-bottombar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    background: var(--card);
    border-top: 1px solid var(--border);
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
}

/* ---------- 轻提示 ---------- */
.m-toast {
    position: fixed;
    top: 18%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    background: rgba(35, 40, 57, .96);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    max-width: 86vw;
    text-align: center;
    pointer-events: none;
}

.m-toast.toast-error { border-color: #ff6b6b; color: #ff8787; }

/* ---------- 弹层（预订详情/操作） ---------- */
.sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1500;
    background: rgba(0, 0, 0, .55);
}

.sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1501;
    background: var(--card);
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}

.sheet .sheet-title { font-size: 16px; font-weight: 600; }
.sheet .kv { font-size: 14px; line-height: 1.9; }
.sheet .kv .k { color: var(--muted); margin-right: 8px; }

/* ---------- 登录页 ---------- */
.m-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #1a1d29 0%, #2a2f3f 100%);
}

.m-login-card {
    width: 100%;
    max-width: 380px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 32px 24px;
}

.m-login-title {
    text-align: center;
    font-size: 21px;
    font-weight: 600;
    margin-bottom: 4px;
}

.m-login-sub {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 24px;
}

.error-tip {
    color: #ff6b6b;
    font-size: 13px;
    min-height: 20px;
    margin-top: 8px;
    text-align: center;
}
