/* ============================================================
   七碟子八碗后厨 KDS · 模块样式（深色高可视 · 明档 2 米外可读）
   依赖：/frontend/shared/tokens.css → components.css → 本文件
   原则：深墨底 · 状态色左边条 · 大字号 · 大触控 · 克制动效
   ============================================================ */

:root {
    /* ---- 暗色工作台（对齐 shared/tokens.css 的 --dk-* 组）---- */
    --bg:        var(--dk-bg);        /* 暖黑 #0C0A07 */
    --panel:     var(--dk-surface);   /* 暖面 #16120C */
    --panel-2:   var(--dk-surface-2); /* 次级暖面 #211A11 */
    --panel-3:   #2A2115;
    --line:      var(--dk-line);      /* 暖描边 #33291C */
    --line-soft: #2A2116;
    --text:      var(--dk-text);      /* 暖白 #F3EDE2 */
    --text-dim:  #C9BCA6;
    --muted:     var(--dk-muted);     /* 暖灰 #A89B85 */
    --border:    var(--dk-line);

    /* ---- 品牌：陶土琥珀（v2.1 统一单琥珀：暗底用 shared --dk-hot，消灭第二套 #E08A2E）---- */
    --primary:      var(--dk-hot, #F0A93B);        /* 暗底提亮琥珀 = --dk-hot */
    --primary-deep: var(--c-primary);              /* #C05A12 */
    --primary-light: rgba(240, 169, 59, 0.14);
    --primary-dark: #F0A04F;

    /* ---- 状态三色（v2.1 升格为模块级 KDS 语义令牌，集中定义）---- */
    --kds-pending:    var(--dk-hot, #F0A93B);
    --kds-preparing:  #5AAFD8; --kds-ready: #3BBF8E; --kds-alert: #EF4444;
    --pending:        var(--kds-pending); --pending-bg: rgba(240, 169, 59, 0.10); --pending-border: rgba(240, 169, 59, 0.38);
    --preparing:      var(--kds-preparing); --preparing-bg: rgba(90, 175, 216, 0.12); --preparing-border: rgba(90, 175, 216, 0.42);
    --ready:          var(--kds-ready); --ready-bg: rgba(59, 191, 142, 0.10);   --ready-border: rgba(59, 191, 142, 0.38);

    --danger:  #F87171;
    --danger-strong: var(--kds-alert);
    --warning: var(--dk-hot, #F0A93B);
    --success: var(--kds-ready); --success-strong: #0E8C5F;

    --shadow:    0 2px 10px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* 全局兜底：hidden 属性必须真正隐藏（覆盖视图容器的 display 规则） */
[hidden] { display: none !important; }

html { height: 100%; }
body {
    font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Roboto, sans-serif);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    min-height: 100%;
    -webkit-font-smoothing: antialiased;
}

/* ---------- 抵消 shared/components.css 的泄漏（模块内以本文件为准） ---------- */
.btn { height: auto; }
.modal { width: auto; max-width: none; background: transparent; border-radius: 0; box-shadow: none; overflow: visible; animation: none; }
.toast { position: static; right: auto; bottom: auto; z-index: auto; color: var(--text); }

/* ============================================================
   登录视图 · 深墨入场
   ============================================================ */
.login-view {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(900px 480px at 78% -12%, rgba(194, 96, 12, 0.12), transparent 60%),
        linear-gradient(160deg, #1C1610 0%, var(--dk-bg) 70%);
    padding: 24px;
}
.login-bg { position: absolute; inset: 0; overflow: hidden; }
.login-blob {
    position: absolute; border-radius: 50%;
    filter: blur(90px); opacity: 0.14;
    animation: floatBlob 14s ease-in-out infinite;
}
.login-blob.blob-1 { width: 420px; height: 420px; background: #B45309; top: -140px; left: -120px; }
.login-blob.blob-2 { width: 360px; height: 360px; background: #2A2115; bottom: -120px; right: -100px; animation-delay: -7s; }
@keyframes floatBlob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(24px, 18px) scale(1.06); }
}
.login-card {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
    animation: cardInUp 0.45s var(--ease, cubic-bezier(.4,0,.2,1));
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo-icon {
    width: 76px; height: 76px;
    margin: 0 auto 16px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--dk-hot) 100%);
    color: #1C1610;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 28px rgba(194, 96, 12, 0.35);
}
.login-title { font-size: 25px; font-weight: 800; color: var(--text); letter-spacing: -0.02em; margin-bottom: 4px; }
.login-subtitle { font-size: 12px; color: var(--muted); letter-spacing: 0.18em; text-transform: uppercase; }

.form-group { margin-bottom: 18px; }
.form-group label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--text-dim); margin-bottom: 8px; letter-spacing: 0.02em;
}
.input-wrap {
    position: relative; display: flex; align-items: center;
    background: var(--dk-bg);
    border: 1.5px solid var(--line);
    border-radius: 12px;
    transition: border-color var(--dur-fast, 120ms), box-shadow var(--dur-fast, 120ms);
}
.input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(194, 96, 12, 0.18);
}
.input-icon { position: absolute; left: 14px; color: var(--muted); }
.input-wrap input {
    flex: 1; padding: 14px 14px 14px 46px;
    border: none; background: transparent;
    font-size: 15px; color: var(--text); outline: none; width: 100%;
}
.input-wrap input::placeholder { color: #7A6C57; }
.toggle-pwd {
    border: none; background: transparent; padding: 0 14px;
    cursor: pointer; color: var(--muted);
    display: flex; align-items: center; height: 100%; align-self: stretch;
}
.toggle-pwd:hover { color: var(--primary); }
.login-error {
    background: rgba(239, 68, 68, 0.10);
    color: var(--danger);
    padding: 11px 14px; border-radius: 10px;
    font-size: 13px; margin-bottom: 16px;
    border: 1px solid rgba(248, 113, 113, 0.35);
}

.btn {
    border: none; border-radius: 12px;
    font-size: 14px; font-weight: 700; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; position: relative;
    transition: filter var(--dur-fast, 120ms), transform var(--dur-fast, 120ms), box-shadow var(--dur-fast, 120ms);
}
.btn-primary {
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-600) 100%);
    color: #fff; padding: 15px 24px;
    box-shadow: 0 8px 22px rgba(194, 96, 12, 0.32);
    letter-spacing: 0.3em; text-indent: 0.3em;
}
.btn-primary:hover:not([disabled]) { filter: brightness(1.08); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { background: var(--panel-2); color: var(--text); padding: 10px 20px; border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--panel-3); }
.btn-block { width: 100%; }
.btn-lg { padding: 16px; font-size: 16px; }
.btn-spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff; border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.login-footer {
    position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
    color: #7A6C57; font-size: 12px; white-space: nowrap;
}

/* ============================================================
   顶栏 · ink→深墨渐变 + 琥珀品牌点
   ============================================================ */
.app-view { min-height: 100vh; display: flex; flex-direction: column; }
.app-header {
    background: linear-gradient(120deg, #1C1610 0%, #140F09 55%, #241A0F 100%);
    border-bottom: 1px solid var(--line);
    padding: 12px 24px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 20px;
    position: sticky; top: 0; z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 20px; }
.header-brand { display: flex; align-items: center; gap: 12px; }
.brand-icon {
    width: 42px; height: 42px; border-radius: 12px;
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--dk-hot) 100%);
    color: #1C1610;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(194, 96, 12, 0.35);
}
.brand-text-wrap { position: relative; display: flex; flex-direction: column; line-height: 1.2; }
.brand-text { font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: -0.01em; }
/* 琥珀品牌点 */
.brand-text-wrap::before {
    content: ''; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
    width: 5px; height: 18px; border-radius: 3px;
    background: linear-gradient(180deg, var(--dk-hot), var(--c-primary));
}
.brand-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.conn-status {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 14px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 12px;
}
.conn-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.conn-dot--connecting { background: var(--warning); animation: pulse 1.5s infinite; }
.conn-dot--connected { background: var(--success); box-shadow: 0 0 0 3px rgba(59, 191, 142, 0.15); }
.conn-dot--disconnected { background: var(--danger); animation: pulse 1.2s infinite; }
/* FE-3：实时降级（仍在轮询兜底，不是断线）——用警示色但不脉冲，避免与"连接中"混淆 */
.conn-dot--degraded { background: var(--warning); box-shadow: 0 0 0 3px rgba(240, 169, 59, 0.25); }
.conn-text { color: var(--text-dim); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.header-center { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.clock { display: flex; align-items: baseline; gap: 10px; }
.clock-time {
    font-size: 24px; font-weight: 800; color: var(--text);
    font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.clock-date { font-size: 12px; color: var(--muted); }
.sys-info {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--primary);
    padding: 3px 10px;
    background: var(--primary-light);
    border: 1px solid rgba(240, 169, 59, 0.22);
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
}

.header-right { display: flex; align-items: center; gap: 12px; }
.search-wrap {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 14px;
    background: var(--panel);
    border: 1.5px solid var(--line);
    border-radius: 10px;
    color: var(--muted);
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 230px;
}
.search-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(194, 96, 12, 0.16);
}
.search-wrap input {
    border: none; background: transparent; outline: none;
    font-size: 14px; flex: 1; color: var(--text);
}
.search-wrap input::placeholder { color: #7A6C57; }
.header-btn {
    width: 44px; height: 44px;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text-dim);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.header-btn:hover { background: var(--primary-light); color: var(--primary); border-color: rgba(240, 169, 59, 0.35); }
.header-btn.muted { color: #7A6C57; }
.user-chip {
    display: flex; align-items: center; gap: 9px;
    padding: 6px 14px 6px 6px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 999px;
}
.user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-600));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 14px;
}
.user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.icon-btn {
    width: 44px; height: 44px;
    border-radius: 11px; border: 1px solid transparent;
    background: transparent; color: var(--muted);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, color 0.2s;
}
.icon-btn:hover { background: rgba(248, 113, 113, 0.12); color: var(--danger); }

/* ============================================================
   桌数统计胶囊
   ============================================================ */
.stats-bar {
    display: flex;
    gap: 14px;
    padding: 18px 24px 4px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    flex-wrap: wrap;
}
.stat-card {
    flex: 1 1 200px;
    background: var(--panel);
    border-radius: 999px;
    padding: 10px 22px 10px 12px;
    display: flex; align-items: center; gap: 14px;
    border: 1px solid var(--line);
    transition: border-color 0.25s;
}
.stat-card:hover { border-color: #4A3A22; }
.stat-icon-wrap {
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-pending   .stat-icon-wrap { background: var(--pending-bg);   color: var(--pending); }
.stat-preparing .stat-icon-wrap { background: var(--preparing-bg); color: var(--preparing); }
.stat-ready     .stat-icon-wrap { background: var(--ready-bg);     color: var(--ready); }
.stat-info {
    flex: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}
.stat-value {
    font-size: 34px; font-weight: 800; line-height: 1;
    font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.stat-pending   .stat-value { color: var(--pending); }
.stat-preparing .stat-value { color: var(--preparing); }
.stat-ready     .stat-value { color: var(--ready); }
.stat-label {
    font-size: 14px; color: var(--text-dim); font-weight: 600;
    letter-spacing: 0.08em;
}
.stat-value.pulse { animation: statPulse 0.6s ease; }
@keyframes statPulse {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* ============================================================
   订单看板 · 三列 + 状态色左边条卡片
   ============================================================ */
.orders-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    padding: 18px 24px 36px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}
.board-col {
    background: #120D08;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    display: flex; flex-direction: column;
    min-height: 520px;
    overflow: hidden;
}
.col-header {
    padding: 15px 18px;
    display: flex; align-items: center; justify-content: space-between;
    font-weight: 800; font-size: 16px; letter-spacing: 0.12em;
}
.col-header-pending   { background: var(--pending-bg);   color: var(--pending);   border-bottom: 2px solid var(--pending-border); }
.col-header-preparing { background: var(--preparing-bg); color: var(--preparing); border-bottom: 2px solid var(--preparing-border); }
.col-header-ready     { background: var(--ready-bg);     color: var(--ready);     border-bottom: 2px solid var(--ready-border); }
.col-count {
    min-width: 34px; text-align: center;
    padding: 3px 11px; border-radius: 999px;
    font-size: 14px; font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.col-header-pending   .col-count { background: var(--pending);   color: #1C1610; }
.col-header-preparing .col-count { background: var(--preparing); color: #1C1610; }
.col-header-ready     .col-count { background: var(--ready);     color: #1C1610; }

.col-body {
    padding: 16px;
    display: flex; flex-direction: column; gap: 16px;
    flex: 1;
    overflow-y: auto;
}

/* ---------- 订单卡 ---------- */
.order-card {
    background: var(--panel);
    border-radius: 13px;
    border: 1px solid var(--line);
    overflow: hidden;
    transition: border-color 0.25s, box-shadow 0.25s;
    animation: cardInUp 0.4s cubic-bezier(.4,0,.2,1);
}
@keyframes cardInUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.col-pending   .order-card { border-left: 6px solid var(--pending); }
.col-preparing .order-card { border-left: 6px solid var(--preparing); }
.col-ready     .order-card { border-left: 6px solid var(--ready); }
.order-card:hover { border-color: #4A3A22; }
.col-pending   .order-card:hover { border-left-color: var(--pending); }
.col-preparing .order-card:hover { border-left-color: var(--preparing); }
.col-ready     .order-card:hover { border-left-color: var(--ready); }

/* 新单：琥珀脉冲，醒目但不喧宾 */
.order-card.is-new { animation: newOrderGlow 1.4s ease 2, cardInUp 0.4s ease; }
@keyframes newOrderGlow {
    0%   { box-shadow: 0 0 0 0 rgba(194, 96, 12, 0.55); }
    60%  { box-shadow: 0 0 0 12px rgba(194, 96, 12, 0); }
    100% { box-shadow: 0 0 0 0 rgba(194, 96, 12, 0); }
}

/* 超时（≥15 分钟）：危险色描边呼吸 —— FE-12 改由 JS 打 .is-timeout 类，普通选择器兼容低版本内核 */
.order-card.is-timeout {
    border-color: rgba(248, 113, 113, 0.55);
    animation: urgentRing 1.8s cubic-bezier(.4,0,.6,1) infinite;
}
@keyframes urgentRing {
    0%, 100% { box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.55), 0 0 18px rgba(239, 68, 68, 0.10); }
    50%      { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.28), 0 0 26px rgba(239, 68, 68, 0.22); }
}
.col-pending   .order-card.is-timeout { border-left-color: var(--danger); }
.col-preparing .order-card.is-timeout { border-left-color: var(--danger); }
.col-ready     .order-card.is-timeout { border-left-color: var(--danger); }

.card-head {
    padding: 14px 16px 12px;
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 10px;
    border-bottom: 1px solid var(--line-soft);
}
.card-head-left { flex: 1; min-width: 0; }
.card-table-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.table-no {
    font-size: 32px; font-weight: 800; color: #fff;
    letter-spacing: -0.02em; line-height: 1.05;
    font-variant-numeric: tabular-nums;
}
.table-prefix {
    font-size: 15px; font-weight: 700;
    background: var(--primary-light);
    color: var(--primary);
    padding: 3px 8px; border-radius: 7px;
    margin-right: 4px; vertical-align: 4px;
}
.type-tag { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; letter-spacing: 0.05em; }
.type-tag.takeout { background: rgba(240, 169, 59, 0.14); color: var(--pending); }
.type-tag.dine-in { background: var(--primary-light); color: var(--primary); }
.card-order-no {
    font-size: 13px; color: var(--muted);
    font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
}
.card-time-box { text-align: right; flex: none; }
.card-time-ago {
    font-size: 16px; font-weight: 800; color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}
.card-time-ago.urgent { color: #FF6B6B; animation: blink 1.2s infinite; }
.card-time-ago .unit { font-size: 12px; font-weight: 600; }
.card-time-clock { font-size: 12px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
@keyframes blink { 50% { opacity: 0.45; } }

.card-items { padding: 10px 16px 14px; }
/* 整单备注条：警示黄，厨师一眼可见 */
.card-remark {
    display: flex; align-items: center; gap: 8px;
    margin: 4px 16px 0;
    padding: 9px 12px;
    border-radius: 9px;
    background: rgba(240, 169, 59, 0.10);
    border: 1px dashed rgba(240, 169, 59, 0.45);
    color: var(--pending);
    font-size: 14px; font-weight: 700;
    line-height: 1.5;
}
.card-remark svg { flex-shrink: 0; }

.order-item {
    display: flex; gap: 12px;
    padding: 11px 0;
    align-items: flex-start;
    line-height: 1.7;
}
.order-item + .order-item { border-top: 1px dashed #2A2116; }
.item-qty {
    flex-shrink: 0;
    min-width: 44px; height: 32px;
    background: var(--panel-3);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 16px;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.item-qty .x { color: var(--muted); font-size: 12px; margin-right: 2px; }
.item-main { flex: 1; min-width: 0; }
.item-name {
    font-size: 18px; font-weight: 600; color: var(--text);
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
}
.item-status-pill { font-size: 12px; padding: 2px 9px; border-radius: 999px; font-weight: 700; }
.item-status-READY     { background: var(--ready-bg);     color: var(--ready); }
.item-status-PREPARING { background: var(--preparing-bg); color: var(--preparing); }
.order-item.is-ready  .item-name { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(138,148,168,.5); }
.order-item.is-served { opacity: 0.45; }
.item-remarks {
    font-size: 13px; color: var(--warning);
    margin-top: 3px; display: flex; align-items: center;
}

.item-check-wrap { display: flex; align-items: center; padding-left: 8px; align-self: center; }
.item-check {
    width: 40px; height: 40px;
    border-radius: 10px;
    border: 2px solid var(--line);
    background: var(--panel-2);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color 0.2s, background 0.2s;
    color: transparent; flex-shrink: 0; padding: 0;
}
.item-check:hover { border-color: var(--ready); }
.item-check.checked { background: var(--ready); border-color: var(--ready); color: #140F09; }

.card-foot {
    padding: 12px 16px 14px;
    border-top: 1px solid var(--line-soft);
    display: flex; gap: 10px; align-items: stretch;
}
/* ---------- 大触控操作按钮（≥48px） ---------- */
.action-btn {
    flex: 1;
    min-height: 52px;
    border: none; border-radius: 11px;
    padding: 12px 16px;
    font-size: 16px; font-weight: 800; letter-spacing: 0.05em;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    color: #1C1610;
    transition: filter 0.2s, transform 0.1s;
}
.action-btn:active { transform: translateY(1px); }
.action-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.action-start  { background: linear-gradient(135deg, var(--dk-hot, #F0A93B), var(--c-primary-600)); box-shadow: 0 4px 14px rgba(245, 158, 11, 0.22); }
.action-finish { background: linear-gradient(135deg, #F0A93B, #C05A12); color: #1C1610; box-shadow: 0 4px 14px rgba(192, 90, 18, 0.30); }
.action-serve  { background: linear-gradient(135deg, var(--kds-ready), var(--success-strong, #0E8C5F)); box-shadow: 0 4px 14px rgba(59, 191, 142, 0.18); }
.action-btn:hover:not(:disabled) { filter: brightness(1.07); }
.print-btn {
    width: 52px; min-height: 52px;
    border: 1px solid var(--line);
    background: var(--panel-2);
    border-radius: 11px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-dim);
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    flex: none;
}
.print-btn:hover { background: var(--primary-light); color: var(--primary); border-color: rgba(240, 169, 59, 0.35); }
.print-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.action-btn .ico { display: inline-flex; }

/* ---------- 空态：有秩序的等待 ---------- */
.empty-state {
    margin: 24px auto 48px;
    width: min(560px, calc(100% - 48px));
    text-align: center;
    padding: 64px 32px;
    color: var(--muted);
    background: var(--panel);
    border: 1px dashed var(--line);
    border-radius: 18px;
}
.empty-icon { font-size: 52px; margin-bottom: 14px; opacity: 0.85; }
.empty-state h4 { font-size: 20px; color: var(--text-dim); margin-bottom: 6px; font-weight: 700; letter-spacing: 0.02em; }
.empty-state p { font-size: 14px; color: var(--muted); }

/* ============================================================
   弹层 · 厨房联预览（票面保持纸张质感）
   ============================================================ */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(2, 6, 16, 0.68);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s;
}
.modal-dialog {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    width: 100%; max-width: 460px; max-height: 90vh;
    overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    animation: modalIn 0.25s cubic-bezier(.4,0,.2,1);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(15px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header {
    padding: 18px 20px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--line-soft);
}
.modal-header h3 { font-size: 17px; font-weight: 700; color: var(--text); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--line-soft);
    display: flex; justify-content: flex-end; gap: 10px;
}

/* ---------- 厨房联预览：字号按「隔蒸汽也能看清」标准放大 ---------- */
/* 只放宽打印预览这一个弹窗，其它弹窗维持 460px */
#printModal .modal-dialog { max-width: 760px; }
#printModal .modal-body { padding: 18px 22px; }
.kds-ticket {
    background: #fff; color: #1C1610;
    border: 2px dashed #c9a227;
    padding: 20px; border-radius: 10px;
    font-size: 17px;
    font-family: var(--font-sans);
}
.kt-head { text-align: center; border-bottom: 2px dashed #e5e7eb; padding-bottom: 12px; margin-bottom: 14px; }
/* 桌号是厨房最关心的信息：最大、最重 */
.kt-table {
    font-size: 46px; font-weight: 900; line-height: 1.05;
    letter-spacing: .06em; color: #1C1610;
    font-variant-numeric: tabular-nums;
}
.kt-title { font-size: 15px; font-weight: 800; color: #C05A12; margin-top: 6px; letter-spacing: .04em; }
.kt-sub { font-size: 13px; color: #6E6354; margin-top: 4px; }
.kt-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; color: #6E6354; }

.kt-section { margin: 0 0 16px; }
.kt-section:last-of-type { margin-bottom: 8px; }
.kt-cat {
    display: flex; align-items: baseline; gap: 10px;
    padding: 8px 12px; margin-bottom: 8px;
    background: #FCF3E8; border-left: 5px solid #C05A12;
    border-radius: 0 8px 8px 0;
}
.kt-cat-name { font-size: 24px; font-weight: 900; color: #A04708; letter-spacing: .04em; }
.kt-cat-count { font-size: 14px; font-weight: 800; color: #6E6354; }
.kt-section-items {
    padding: 4px 2px 10px;
    border-top: 1px dashed #e5e7eb;
}
/* 菜名 26px / 数量 26px：打印小票同款信息层级，站在灶台前一米也能读清 */
.kt-item {
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
    padding: 9px 2px; font-size: 26px; line-height: 1.25;
}
.kt-name { font-weight: 800; letter-spacing: .02em; }
.kt-qty {
    color: #C05A12; font-weight: 900;
    font-variant-numeric: tabular-nums; flex-shrink: 0;
}
.kt-remark {
    padding: 2px 2px 8px 14px;
    font-size: 17px; font-weight: 800; color: #B4291F;
}

/* ============================================================
   Toast / Loading / Skeleton
   ============================================================ */
.toast-container {
    position: fixed; top: 84px; right: 20px;
    z-index: 300;
    display: flex; flex-direction: column; gap: 10px;
    max-width: 380px;
}
.toast {
    display: flex; gap: 10px; align-items: flex-start;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px 15px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
    border-left: 4px solid var(--primary);
    animation: toastIn 0.3s cubic-bezier(.4,0,.2,1);
}
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
.toast.out { animation: toastOut 0.3s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
.toast-icon {
    width: 28px; height: 28px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; flex-shrink: 0; color: #140F09; font-size: 15px;
    background: var(--primary);
}
.toast.success { border-left-color: var(--success); }
.toast.success .toast-icon { background: var(--success); }
.toast.error { border-left-color: var(--danger-strong); }
.toast.error .toast-icon { background: var(--danger-strong); color: #fff; }
.toast.warning { border-left-color: var(--warning); }
.toast.warning .toast-icon { background: var(--warning); }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-size: 14px; font-weight: 700; color: var(--text); }
.toast-msg { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }

/* FE-13：shared/api.js 的 QW.createToaster 生成 toast--<type> + 纯 title/msg 结构（无图标块），
   标题/描述竖排、状态色左边条、is-hiding 退场。旧 .toast-icon/.toast-body 规则保留不删。 */
.toast-container .toast { flex-direction: column; align-items: stretch; gap: 2px; }
.toast-container .toast .toast-msg { margin-top: 2px; }
.toast--success { border-left-color: var(--success); }
.toast--error   { border-left-color: var(--danger-strong); }
.toast--warning { border-left-color: var(--warning); }
.toast--info    { border-left-color: var(--primary); }
.toast.is-hiding { animation: toastOut 0.3s ease forwards; }

.loading-overlay {
    position: fixed; inset: 0;
    background: rgba(5, 9, 20, 0.72);
    z-index: 400;
    display: flex; align-items: center; justify-content: center;
}
.loading-overlay[hidden] { display: none; }
.spinner {
    width: 44px; height: 44px;
    border: 3px solid var(--line);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.skeleton-card {
    height: 180px;
    background: linear-gradient(90deg, var(--panel) 25%, var(--panel-2) 50%, var(--panel) 75%);
    background-size: 200% 100%;
    border-radius: 13px;
    animation: skeletonShine 1.4s linear infinite;
}
@keyframes skeletonShine { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- 深色滚动条 ---------- */
.col-body::-webkit-scrollbar { width: 8px; }
.col-body::-webkit-scrollbar-track { background: transparent; }
.col-body::-webkit-scrollbar-thumb { background: #3A2E1C; border-radius: 4px; }
.col-body::-webkit-scrollbar-thumb:hover { background: #4A3A22; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1280px) {
    .table-no { font-size: 28px; }
    .stat-value { font-size: 30px; }
}
@media (max-width: 1024px) {
    .app-header { flex-wrap: wrap; padding: 10px 16px; }
    .header-center { order: 3; width: 100%; padding-top: 10px; border-top: 1px solid var(--line); margin-top: 8px; }
    .stats-bar { padding: 14px 16px 2px; gap: 10px; }
    .orders-board { padding: 14px 16px 28px; gap: 14px; }
    .search-wrap { width: 190px; }
}
@media (max-width: 768px) {
    .orders-board { grid-template-columns: 1fr; }
    .stats-bar { flex-direction: column; }
    .header-left, .header-right { gap: 8px; }
    .brand-text-wrap .brand-sub { display: none; }
    .user-name { display: none; }
    .search-wrap { width: 150px; }
    .clock-date { display: none; }
    .login-footer { white-space: normal; text-align: center; padding: 0 20px; }
    .table-no { font-size: 26px; }
}
@media (max-width: 480px) {
    .login-card { padding: 30px 22px; }
    .header-brand .brand-text { font-size: 15px; }
    .search-wrap { width: 120px; padding: 7px 10px; }
    .search-wrap input::placeholder { font-size: 12px; }
    .header-btn, .icon-btn { width: 40px; height: 40px; }
}

/* 减弱动效偏好 */
@media (prefers-reduced-motion: reduce) {
    .order-card.is-timeout { animation: none; }
    .card-time-ago.urgent { animation: none; }
}


/* ============================================================
   设计系统升级层 v2 · 暖调编辑式轻奢（深色工作台）
   ------------------------------------------------------------
   仅覆盖样式：不改动任何 DOM 结构、类名或 JS 交互钩子。
   ============================================================ */

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* 暗底滚动条：暖色，替代冷蓝灰 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(245, 239, 228, .16);
    border: 2px solid transparent; background-clip: padding-box;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(245, 239, 228, .28); background-clip: padding-box; }

.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

/* ---- 品牌 ---- */
.login-title { font-family: var(--font-display); font-weight: 600; }

/* ---- 看板：暖色描边与层次（暗底不加白光晕，用发丝内高光） ---- */
.col-header { border-bottom: 1px solid var(--line); }
.stat-card { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04); }
.order-card {
    transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.order-card:hover { box-shadow: var(--shadow-lg); }
.empty-state { border-color: var(--line-soft); }

/* 全部退菜的订单卡提示 */
.order-item--all-refunded { opacity: .7; }
.order-item--all-refunded .item-name { color: #B42318; font-weight: 600; }

/* ===== 2026-11-14 升级层：返回首页按钮 ===== */
a.icon-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
a.icon-btn.icon-btn--home { flex: none; }
.login-home-link { color: var(--c-muted, #8A7B63); text-decoration: none; font-size: 13px; }
.login-home-link:hover { color: var(--c-primary, #C05A12); text-decoration: underline; }

/* ===== 2026-11-14 防竖排：窄屏下身份/导航类短文本禁止折行（超出显示省略号） ===== */
/* 内容类文本（备注/菜名/描述）仍保留正常换行；此规则只约束 header/徽标/按钮等短 UI 文本 */
@media (max-width: 768px) {
    .brand-text, .brand-sub, .brand-name, .role-badge, .user-name, .user-chip,
    .user-chip-name, .user-chip-role, .user-avatar, .conn-text, .conn-status,
    .sub-title, .back-btn, .link-btn, .zone-tab, .status-badge, .table-tag,
    .order-type-tag, .detail-tab, .mobile-tabbar button span, .guest-btn, .tc-btn,
    .page-title, .table-badge, .home-link-btn, .header-btn, .menu-refresh-btn,
    .lan-info, .search-wrap input {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex-shrink: 0;
    }
    .sub-title { flex-shrink: 1; min-width: 0; }
}

/* ===== 2026-11-14 移动端 header 收纳 ===== */
@media (max-width: 768px) {
    .app-header { padding: 8px 12px; gap: 8px; flex-wrap: wrap; }
    .header-left { width: auto; flex: 1 1 auto; min-width: 0; }
    .header-brand { min-width: 0; overflow: hidden; }
    .brand-text { flex-shrink: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; max-width: 100%; }
    .brand-sub { display: none; }
    .lan-info, #lanIp { display: none; }
    .user-name { display: none; }
    .search-wrap { flex: 1 1 120px; min-width: 100px; }
    .search-wrap input { min-width: 0; }
    .header-right { flex-shrink: 0; }
}
