/* ==========================================================================
   美宿云交付及运营工作台 三模态设计系统 (style.css)
   Tokens SSOT | 支持 Daylight / Eyecare / Midnight
   ========================================================================== */
:root, [data-theme="daylight"] {
  --bg-canvas: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-surface: #eff6ff;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}
[data-theme="eyecare"] {
  --bg-canvas: #f6f3eb;
  --bg-surface: #fdfbf7;
  --bg-surface-elevated: #ffffff;
  --border-subtle: #e5dec9;
  --border-strong: #d4c8a8;
  --text-primary: #2c2720;
  --text-secondary: #594f42;
  --text-muted: #8c7f6b;
  --accent: #855828;
  --accent-hover: #68431b;
  --accent-surface: #f2ede1;
  --success: #2d6a4f;
  --warning: #b06d15;
  --danger: #9e2a2b;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(44,39,32,0.06);
}
[data-theme="midnight"] {
  --bg-canvas: #090d16;
  --bg-surface: #111827;
  --bg-surface-elevated: #1f2937;
  --border-subtle: #1e293b;
  --border-strong: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-surface: rgba(59, 130, 246, 0.15);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", sans-serif; }
body { background-color: var(--bg-canvas); color: var(--text-primary); line-height: 1.5; min-height: 100vh; transition: background 0.2s, color 0.2s; }
.app-container { max-width: 1400px; margin: 0 auto; padding: 16px 24px 60px; }

/* 头部 */
.global-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 24px; }
.brand-section { display: flex; align-items: center; gap: 14px; }
.brand-logo { width: 36px; height: 36px; background: var(--accent); color: #fff; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; }
.brand-title { font-size: 18px; font-weight: 600; }
.hotel-badge { font-size: 12px; background: var(--accent-surface); color: var(--accent); padding: 4px 10px; border-radius: 20px; font-weight: 500; border: 1px solid var(--accent); }

/* 主题控件 */
.header-actions { display: flex; align-items: center; gap: 16px; }
.theme-segmented-switch { display: flex; background: var(--bg-canvas); padding: 3px; border-radius: 20px; border: 1px solid var(--border-subtle); }
.theme-btn { border: none; background: transparent; padding: 5px 12px; border-radius: 16px; font-size: 13px; cursor: pointer; color: var(--text-secondary); transition: all 0.15s; }
.theme-btn.active { background: var(--bg-surface); color: var(--text-primary); font-weight: 600; box-shadow: var(--shadow); }

/* 大盘指标 */
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.metric-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.metric-title { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.metric-val { font-size: 28px; font-weight: 700; color: var(--text-primary); }
.metric-desc { font-size: 12px; color: var(--text-muted); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.metric-badge { font-size: 11px; padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.badge-success { background: rgba(5, 150, 105, 0.12); color: var(--success); }
.badge-warning { background: rgba(217, 119, 6, 0.12); color: var(--warning); }
.badge-info { background: var(--accent-surface); color: var(--accent); }

/* 选项卡 */
.main-tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 20px; }
.tab-btn { background: none; border: none; padding: 10px 18px; font-size: 14px; font-weight: 500; color: var(--text-secondary); cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.15s; }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* 表格与面板 */
.content-panel { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
th { background: var(--bg-canvas); padding: 12px 14px; color: var(--text-secondary); font-weight: 600; border-bottom: 1px solid var(--border-subtle); }
td { padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); color: var(--text-primary); }
tr:hover td { background-color: var(--bg-canvas); }

/* 状态胶囊 */
.status-pill { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.pill-accepted { background: rgba(5, 150, 105, 0.12); color: var(--success); }
.pill-pending { background: rgba(217, 119, 6, 0.12); color: var(--warning); }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 7px 14px; border-radius: var(--radius); font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid transparent; transition: all 0.15s; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text-secondary); }
.btn-outline:hover { background: var(--bg-canvas); color: var(--text-primary); }
.btn-sm { padding: 4px 8px; font-size: 12px; }

/* 沙盒与签名 */
.sandbox-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; }
.device-screen { background: var(--bg-canvas); border: 1px solid var(--border-subtle); border-radius: var(--radius); padding: 16px; min-height: 280px; display: flex; flex-direction: column; }
.chat-bubble { max-width: 80%; padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 10px; }
.bubble-user { align-self: flex-end; background: var(--accent); color: #fff; }
.bubble-bot { align-self: flex-start; background: var(--bg-surface); border: 1px solid var(--border-subtle); color: var(--text-primary); }
.card-attachment { background: var(--accent-surface); border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 4px; margin-top: 6px; font-size: 12px; }
.signature-pad-wrapper { border: 2px dashed var(--border-strong); border-radius: var(--radius); background: #ffffff; width: 100%; height: 160px; position: relative; margin: 12px 0; }
canvas#signatureCanvas { width: 100%; height: 100%; cursor: crosshair; }
