/* ============ 小智智能生活助理平台 · 高保真原型样式 ============ */
:root {
  --primary: #4F6EF7;
  --primary-dark: #3D5BE5;
  --primary-soft: #EEF2FE;
  --bg: #F4F6FB;
  --card: #FFFFFF;
  --text: #1F2937;
  --muted: #6B7280;
  --border: #E6E9F2;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(31, 41, 55, .06);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Microsoft YaHei', 'PingFang SC', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 224px; background: #1E2433; color: #CBD2E1;
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0;
}
.sidebar .logo { display: flex; align-items: center; gap: 10px; padding: 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .logo .mark { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #6C8CFF, #4F6EF7); display: flex; align-items: center; justify-content: center; font-size: 18px; color: #fff; }
.sidebar .logo .name { font-size: 16px; font-weight: 700; color: #fff; }
.sidebar .logo .name small { display: block; font-size: 11px; color: #8A94AB; font-weight: 400; }
.nav { flex: 1; padding: 14px 10px; }
.nav .group { font-size: 11px; color: #6E7891; padding: 12px 12px 6px; letter-spacing: 1px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px;
  color: #B7C0D4; margin-bottom: 3px; font-size: 13.5px; transition: all .15s;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav a.active { background: var(--primary); color: #fff; }
.nav .icon { width: 20px; text-align: center; font-size: 15px; }
.sidebar .foot { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; color: #8A94AB; }

.main { flex: 1; margin-left: 224px; display: flex; flex-direction: column; }
.topbar {
  height: 60px; background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 26px;
  position: sticky; top: 0; z-index: 10;
}
.topbar .title { font-size: 16px; font-weight: 700; }
.topbar .right { display: flex; align-items: center; gap: 16px; }
.topbar .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.content { padding: 24px 26px; max-width: 1180px; width: 100%; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); }
.card + .card { margin-top: 16px; }
.card .card-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card .card-head h3 { font-size: 15px; }
.card .card-body { padding: 20px; }
.card .card-body.np { padding: 0; }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 9px; border: 1px solid transparent; font-size: 13.5px; cursor: pointer; transition: all .15s; font-family: inherit; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: #fff; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: #FEE2E2; color: var(--danger); }
.btn-sm { padding: 5px 12px; font-size: 12.5px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px;
  font-size: 13.5px; font-family: inherit; outline: none; transition: border .15s; background: #FBFCFE;
}
.field input:focus, .field textarea:focus { border-color: var(--primary); background: #fff; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { background: #F7F8FC; text-align: left; padding: 11px 16px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #FAFBFE; }

/* ---------- 徽标 ---------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; }
.badge-success { background: #D9F5EB; color: #0B9B6E; }
.badge-warning { background: #FDF0D8; color: #B7791F; }
.badge-danger { background: #FDE3E3; color: #D64545; }
.badge-info { background: var(--primary-soft); color: var(--primary); }
.badge-gray { background: #EEF0F4; color: var(--muted); }

/* ---------- 统计卡片 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.stat-card .label { font-size: 12.5px; color: var(--muted); }
.stat-card .value { font-size: 26px; font-weight: 700; margin: 6px 0 4px; }
.stat-card .trend { font-size: 12px; }
.stat-card .trend.up { color: var(--success); }
.stat-card .trend.down { color: var(--danger); }

/* ---------- 对话 ---------- */
.chat-box { display: flex; flex-direction: column; height: calc(100vh - 170px); }
.chat-scroll { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.bubble { max-width: 76%; padding: 12px 16px; border-radius: 14px; line-height: 1.7; font-size: 13.5px; }
.bubble.user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.bubble.ai { align-self: flex-start; background: #F1F3F9; color: var(--text); border-bottom-left-radius: 4px; }
.tool-card { align-self: flex-start; max-width: 76%; background: #FFF; border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: 10px; padding: 10px 14px; font-size: 12.5px; color: var(--muted); }
.tool-card b { color: var(--text); }
.chat-input { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); background: #fff; }
.chat-input input { flex: 1; padding: 11px 14px; border: 1px solid var(--border); border-radius: 22px; font-size: 13.5px; outline: none; font-family: inherit; }
.chat-input input:focus { border-color: var(--primary); }
.chips { display: flex; gap: 8px; padding: 10px 18px 0; flex-wrap: wrap; }
.chip { padding: 5px 12px; background: var(--primary-soft); color: var(--primary); border-radius: 16px; font-size: 12.5px; cursor: pointer; border: none; font-family: inherit; }
.chip:hover { background: #DFE7FD; }

/* ---------- 登录 ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #E8EEFF 0%, #F5F7FC 45%, #EAF2FF 100%); }
.auth-card { width: 400px; background: #fff; border-radius: 16px; box-shadow: 0 12px 40px rgba(60, 90, 220, .15); padding: 36px 34px; }
.auth-card .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.auth-card .brand .mark { width: 40px; height: 40px; border-radius: 11px; background: linear-gradient(135deg, #6C8CFF, #4F6EF7); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.auth-card h1 { font-size: 19px; }
.auth-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.auth-links { display: flex; justify-content: space-between; font-size: 13px; margin-top: 14px; }

/* ---------- 待办 / 笔记 / 出行 ---------- */
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: none; }
.list-item .check { width: 20px; height: 20px; border: 2px solid #CBD2E1; border-radius: 50%; cursor: pointer; flex-shrink: 0; }
.list-item.done .check { background: var(--success); border-color: var(--success); position: relative; }
.list-item.done .check:after { content: '✓'; color: #fff; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.list-item.done .title { text-decoration: line-through; color: var(--muted); }
.list-item .title { flex: 1; font-size: 13.5px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- 看板图表 ---------- */
.chart-row { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.bars { display: flex; align-items: flex-end; gap: 14px; height: 200px; padding: 10px 6px; }
.bars .bar { flex: 1; background: linear-gradient(180deg, #7B96FF, #4F6EF7); border-radius: 6px 6px 0 0; position: relative; }
.bars .bar span { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--muted); }
.bars .x { display: flex; gap: 14px; padding: 6px; }
.bars .x em { flex: 1; text-align: center; font-style: normal; font-size: 12px; color: var(--muted); }

/* ---------- 杂项 ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.flex { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.mt { margin-top: 16px; }
.empty { padding: 46px 0; text-align: center; color: var(--muted); }
.empty .big { font-size: 40px; margin-bottom: 10px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%);
  background: #232B3E; color: #fff; padding: 10px 20px; border-radius: 20px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 99;
}
.toast.show { opacity: 1; }

/* 首页总览 */
.hero { background: linear-gradient(120deg, #4F6EF7 0%, #7C9BFF 100%); border-radius: 16px; color: #fff; padding: 40px 36px; box-shadow: var(--shadow); }
.hero h1 { font-size: 26px; margin-bottom: 10px; }
.hero p { opacity: .9; line-height: 1.8; }
.page-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; }
.page-tile { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.page-tile .big { font-size: 26px; }
.page-tile h4 { margin: 10px 0 6px; }
.page-tile p { font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.section-title { font-size: 15px; font-weight: 700; margin: 26px 0 12px; display: flex; align-items: center; gap: 8px; }
@media (max-width: 960px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3, .chart-row, .page-grid { grid-template-columns: 1fr; }
}