/* ============================================================
   随手记 · 员工端设计系统 v2
   Ant Design 工作蓝 · PC 优先 + 响应式
   ============================================================ */

:root {
  /* Brand (Work Blue) */
  --brand: #0969DA;
  --brand-hover: #0A5BC2;
  --brand-active: #084CA2;
  --brand-soft: #E8F1FC;
  --brand-soft-2: #D3E4F8;
  --brand-strong: #0751A5;
  --accent-2: #8250DF;

  /* Neutral scale (cool cast) */
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-2: #F0F3F8;
  --surface-3: #E9EEF5;
  --border: #E3E8EF;
  --border-strong: #D2DCE7;

  --text-1: #1A2230;
  --text-2: #3E4C5E;
  --text-3: #66758A;
  --text-4: #9AA7B8;

  /* Semantic (Ant Design hues, deepened for text use) */
  --success: #389E0D;
  --success-soft: #F6FFED;
  --success-border: #B7EB8F;
  --warning: #D48806;
  --warning-soft: #FFFBE6;
  --warning-border: #FFE58F;
  --danger: #CF1322;
  --danger-soft: #FFF1F0;
  --danger-border: #FFA39E;
  --info: #0969DA;
  --info-soft: #E6F4FF;
  --info-border: #91CAFF;

  /* Layout */
  --sidebar-w: 232px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 60px;

  /* Spacing */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

  /* Radius */
  --r-sm: 4px; --r-md: 6px; --r-lg: 8px; --r-xl: 12px; --r-pill: 999px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 2px 8px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.12);

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 18px; --fs-2xl: 22px;

  --topbar-h: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.6;
  color: var(--text-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }

button { font-family: inherit; }
input, textarea, select, button { font-family: inherit; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #C6D0DC; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   App Shell
   ============================================================ */

.app-shell {
  min-height: 100vh;
  display: flex;
}

/* ---- Sidebar ---- */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width 0.2s ease;
}

.sidebar__logo {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 var(--sp-5);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.logo-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-active));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(9, 105, 218, 0.35);
}

.logo-name { font-size: 17px; font-weight: 700; letter-spacing: 0.02em; color: var(--text-1); }
.logo-name span { color: var(--brand); }

.sidebar__nav { flex: 1; padding: var(--sp-4) var(--sp-3); overflow-y: auto; }

.nav-group-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-4);
  padding: var(--sp-2) var(--sp-3);
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px var(--sp-3);
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: var(--fs-md);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 2px;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.nav-item:hover { background: var(--surface-2); color: var(--text-1); }

.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}

.nav-item .nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
}

.nav-item.active .nav-icon { color: var(--brand); }

.nav-item .nav-badge {
  margin-left: auto;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}

.sidebar__user {
  padding: var(--sp-4);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-active));
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.sidebar__user-info { flex: 1; min-width: 0; }
.sidebar__user-name { font-size: var(--fs-sm); font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user-dept { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.icon-btn {
  width: 34px; height: 34px;
  border-radius: var(--r-md);
  border: none;
  background: transparent;
  color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text-1); }

/* ---- Main area ---- */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.2s ease;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-6);
  gap: var(--sp-3);
}

.topbar__hamburger { display: none; }

.topbar__title { font-size: var(--fs-lg); font-weight: 600; color: var(--text-1); flex: 1; }

.topbar__right { display: flex; align-items: center; gap: var(--sp-2); }

.topbar__user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background 0.15s;
}
.topbar__user:hover { background: var(--surface-2); }
.topbar__user .avatar { width: 30px; height: 30px; font-size: 13px; }
.topbar__user-name { font-size: var(--fs-sm); font-weight: 500; color: var(--text-1); }

/* Week chip in topbar */
.week-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.week-chip:hover { border-color: var(--brand); color: var(--brand); }

/* Content */
.content {
  flex: 1;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: var(--sp-6);
}

/* ============================================================
   Components
   ============================================================ */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 var(--sp-5);
  border-radius: var(--r-md);
  font-size: var(--fs-md);
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-primary:active:not(:disabled) { background: var(--brand-active); }

.btn-default { background: var(--surface); color: var(--text-1); border-color: var(--border-strong); }
.btn-default:hover:not(:disabled) { color: var(--brand); border-color: var(--brand); background: var(--surface); }

.btn-ghost { background: transparent; color: var(--brand); border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--brand-soft); }

.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #B01322; }

.btn-sm { height: 30px; padding: 0 var(--sp-3); font-size: var(--fs-sm); }
.btn-lg { height: 42px; font-size: var(--fs-lg); }
.btn-block { width: 100%; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
}

.card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
}

.card__title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.card__title .card-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.card__title .card-icon svg { width: 15px; height: 15px; }

.card__extra { font-size: var(--fs-sm); color: var(--text-3); display: flex; align-items: center; gap: 8px; }

.card__body { padding: var(--sp-5); }

.card + .card { margin-top: var(--sp-4); }

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-4); }
.grid-main-side { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--sp-4); align-items: start; }
.grid-main-side--narrow { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--sp-4); align-items: start; }

/* 首页双卡片等高对齐 */
.home-grid { align-items: stretch; }
.home-card { display: flex; flex-direction: column; min-width: 0; }
.home-card__body { flex: 1; }
/* 统一左右卡片头部高度与内容行高，消除阶梯状错位 */
.home-card .card__head { min-height: 56px; }
.home-card .card__title,
.home-card .card__extra { line-height: 1.5; display: flex; align-items: center; }
.home-card .card__extra a { line-height: inherit; }

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.6;
  border: 1px solid transparent;
  white-space: nowrap;
}

.tag-blue { background: var(--info-soft); color: #0958D9; border-color: var(--info-border); }
.tag-green { background: var(--success-soft); color: #237804; border-color: var(--success-border); }
.tag-orange { background: var(--warning-soft); color: #AD6800; border-color: var(--warning-border); }
.tag-red { background: var(--danger-soft); color: #A8071A; border-color: var(--danger-border); }
.tag-purple { background: #F4F0FC; color: #531DAB; border-color: #D3ADF7; }
.tag-gray { background: var(--surface-2); color: var(--text-3); border-color: var(--border); }
.tag-dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 4px;
}

/* Status banner */
.banner {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-xl);
  border: 1px solid;
}

.banner__icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.banner__icon svg { width: 22px; height: 22px; }

.banner__content { flex: 1; min-width: 0; }
.banner__title { font-size: var(--fs-lg); font-weight: 600; color: var(--text-1); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.banner__desc { font-size: var(--fs-sm); color: var(--text-3); margin-top: 2px; }

.banner--warning { background: var(--warning-soft); border-color: var(--warning-border); }
.banner--warning .banner__icon { background: rgba(255, 230, 143, 0.6); color: #AD6800; }
.banner--success { background: var(--success-soft); border-color: var(--success-border); }
.banner--success .banner__icon { background: rgba(183, 235, 143, 0.4); color: #237804; }
.banner--info { background: var(--info-soft); border-color: var(--info-border); }
.banner--info .banner__icon { background: rgba(145, 202, 255, 0.4); color: #0958D9; }
.banner--danger { background: var(--danger-soft); border-color: var(--danger-border); }
.banner--danger .banner__icon { background: rgba(255, 163, 158, 0.35); color: #A8071A; }

.banner { margin-bottom: var(--sp-4); }

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  position: relative;
  min-width: 0;
}
.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 17px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border-strong);
  z-index: 0;
}
.step.done:not(:last-child)::after { background: var(--success); }

.step__icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
  font-weight: 600;
  flex-shrink: 0;
  z-index: 1;
  border: 2px solid var(--border-strong);
}
.step__icon svg { width: 16px; height: 16px; }

.step.done .step__icon { background: var(--success); border-color: var(--success); color: #fff; }
.step.active .step__icon { background: var(--brand); border-color: var(--brand); color: #fff; }

.step__text { min-width: 0; }
.step__label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-1); }
.step__time { font-size: 11px; color: var(--text-4); }
.step.active .step__label { color: var(--brand); }

/* Forms */
.form-item { margin-bottom: var(--sp-4); }
.form-label { display: block; font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.form-label .required { color: var(--danger); margin-right: 2px; }

.input, .textarea, .select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  font-size: var(--fs-md);
  color: var(--text-1);
  background: var(--surface);
  transition: all 0.15s;
  line-height: 1.6;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.input:disabled, .textarea:disabled { background: var(--surface-2); color: var(--text-4); cursor: not-allowed; }

.textarea { resize: vertical; min-height: 140px; padding: 12px; line-height: 1.8; }
.textarea--tall { min-height: 320px; }
.textarea--xl { min-height: 420px; font-size: var(--fs-lg); }

/* Direction tabs */
.direction-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dir-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.dir-tab .dir-icon { width: 16px; height: 16px; color: var(--text-3); display: flex; align-items: center; justify-content: center; }
.dir-tab .dir-icon svg { width: 15px; height: 15px; }

.dir-tab:hover { border-color: var(--brand); color: var(--brand); }
.dir-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(9, 105, 218, 0.3);
}
.dir-tab.active .dir-icon { color: #fff; }

.dir-tab__check {
  position: absolute;
  top: -5px; right: -5px;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
}
.dir-tab__check svg { width: 10px; height: 10px; }

/* 已完成方向前的绿点标记 */
.dir-tab__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(46, 160, 67, 0.18);
}
.dir-tab.active .dir-tab__dot { background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25); }

/* Day selector */
.day-selector { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }

.day-chip {
  flex-shrink: 0;
  min-width: 56px;
  padding: 8px 10px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.day-chip:hover { border-color: var(--brand); }
.day-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.day-chip__weekday { font-size: 11px; font-weight: 500; opacity: 0.75; }
.day-chip__date { font-size: var(--fs-lg); font-weight: 600; margin-top: 1px; line-height: 1.2; }
.day-chip__mark { width: 5px; height: 5px; border-radius: 50%; margin: 3px auto 0; background: var(--border); }
.day-chip.active .day-chip__mark { background: rgba(255, 255, 255, 0.85); }
.day-chip.filled .day-chip__mark { background: var(--success); }
.day-chip.active.filled .day-chip__mark { background: #fff; }
.day-chip.today { box-shadow: inset 0 0 0 1.5px var(--brand); }
.day-chip.active.today { box-shadow: none; }

/* List items */
.list { list-style: none; }
.list-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }

.check-circle {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
  margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  color: transparent;
  background: var(--surface);
}
.check-circle:hover { border-color: var(--success); }
.check-circle.checked { background: var(--success); border-color: var(--success); color: #fff; }
.check-circle svg { width: 12px; height: 12px; }
.check-circle.is-timeout { border-color: var(--danger-border); background: var(--danger-soft); color: var(--danger); cursor: default; }
.list-item__title.is-timeout-text { color: var(--text-4); }

.list-item__body { flex: 1; min-width: 0; }
.list-item__title { font-size: var(--fs-md); font-weight: 500; color: var(--text-1); line-height: 1.5; word-break: break-word; }
.list-item__title.done { color: var(--text-4); text-decoration: line-through; }
.list-item__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 5px; font-size: var(--fs-xs); color: var(--text-3); }

/* Summary blocks (weekly overview) */
.summary-block {
  padding: var(--sp-4);
  background: var(--surface-2);
  border-radius: var(--r-lg);
  margin-bottom: var(--sp-4);
}
.summary-block:last-child { margin-bottom: 0; }
.summary-block__head { display: flex; align-items: center; gap: 8px; margin-bottom: var(--sp-3); }
.summary-block__icon {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.summary-block__icon svg { width: 13px; height: 13px; }
.summary-block__title { font-size: var(--fs-sm); font-weight: 600; color: var(--text-1); }

.note-entry { margin-bottom: var(--sp-3); padding-left: 32px; position: relative; }
.note-entry:last-child { margin-bottom: 0; }
.note-entry__date { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); margin-bottom: 2px; }
.note-entry__text { font-size: var(--fs-sm); color: var(--text-1); line-height: 1.7; white-space: pre-wrap; word-break: break-word; }

/* Stat tiles */
.stat-row { display: flex; gap: var(--sp-4); flex-wrap: wrap; }
.stat-tile {
  flex: 1;
  min-width: 120px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-4);
  box-shadow: var(--shadow-sm);
}
.stat-tile__value { font-size: 26px; font-weight: 700; color: var(--text-1); line-height: 1.2; }
.stat-tile__value.brand { color: var(--brand); }
.stat-tile__value.green { color: var(--success); }
.stat-tile__value.orange { color: var(--warning); }
.stat-tile__value.danger { color: var(--danger); }
.stat-tile__label { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; }

/* Progress */
.progress-bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.progress-bar > div { height: 100%; border-radius: 4px; background: var(--brand); transition: width 0.3s; }
.progress-bar.green > div { background: var(--success); }

.week-progress { display: flex; gap: 6px; }
.week-progress__day { flex: 1; text-align: center; }
.week-progress__bar { height: 6px; border-radius: 3px; background: var(--surface-3); margin-bottom: 5px; overflow: hidden; }
.week-progress__bar > div { height: 100%; border-radius: 3px; background: var(--success); }
.week-progress__label { font-size: 10px; color: var(--text-4); }
.week-progress__day.today .week-progress__label { color: var(--brand); font-weight: 600; }

/* Quick action cards */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }
.quick-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-5);
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  -webkit-tap-highlight-color: transparent;
}
.quick-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-soft-2);
}
.quick-card__icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 6px;
}
.quick-card__icon svg { width: 22px; height: 22px; }
.quick-card__icon.blue { background: var(--brand-soft); color: var(--brand); }
.quick-card__icon.purple { background: #F4F0FC; color: var(--accent-2); }
.quick-card__icon.green { background: var(--success-soft); color: var(--success); }
.quick-card__icon.orange { background: var(--warning-soft); color: var(--warning); }
.quick-card__title { font-size: var(--fs-md); font-weight: 600; color: var(--text-1); }
.quick-card__desc { font-size: var(--fs-xs); color: var(--text-3); }

/* Calendar */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-weekday { text-align: center; font-size: var(--fs-xs); font-weight: 500; color: var(--text-3); padding: 6px 0; }
.cal-day {
  position: relative;
  min-height: 74px;
  padding: 8px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.cal-day:hover { border-color: var(--brand-soft-2); }
.cal-day.other { background: transparent; border-color: transparent; cursor: default; }
.cal-day.today { border-color: var(--brand); }
.cal-day.selected { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.cal-day__num { font-size: var(--fs-sm); font-weight: 500; color: var(--text-1); }
.cal-day.today .cal-day__num { color: var(--brand); font-weight: 700; }
.cal-day.other .cal-day__num { color: var(--text-4); }
.cal-day__marks { display: flex; gap: 4px; margin-top: 10px; }
.cal-day__mark {
  width: 8px; height: 8px;
  border-radius: 50%;
}
.cal-day__mark.daily { background: var(--success); }
.cal-day__mark.weekly { background: var(--brand); }
.cal-day__mark.none { background: var(--border-strong); }
.cal-day__hint { font-size: 10px; color: var(--text-4); margin-top: 6px; }
.cal-day__counts { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 4px; }
.cal-count { font-size: 10px; font-weight: 500; line-height: 1.4; white-space: nowrap; }
.cal-count.daily { color: var(--success); }
.cal-count.weekly { color: var(--brand); }
.cal-count::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 4px; }
.cal-count.daily::before { background: var(--success); }
.cal-count.weekly::before { background: var(--brand); }

/* AI button */
.ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--accent-2), var(--brand));
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.ai-btn:hover { opacity: 0.92; }
.ai-btn:active { transform: scale(0.97); }
.ai-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.ai-btn svg { width: 15px; height: 15px; }

/* Empty state */
.empty { text-align: center; padding: var(--sp-8) var(--sp-4); color: var(--text-4); }
.empty__icon { width: 56px; height: 56px; margin: 0 auto var(--sp-4); border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--text-4); }
.empty__icon svg { width: 26px; height: 26px; }
.empty__text { font-size: var(--fs-sm); }

/* Divider */
.divider { height: 1px; background: var(--border); margin: var(--sp-4) 0; }

/* Week header (page-level) */
.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-5);
  box-shadow: var(--shadow-sm);
}
.week-nav__info { text-align: center; flex: 1; }
.week-nav__label { font-size: var(--fs-md); font-weight: 600; color: var(--text-1); }
.week-nav__label .is-current { color: var(--brand); }
.week-nav__date { font-size: var(--fs-xs); color: var(--text-3); margin-top: 1px; }
.week-nav__btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
  -webkit-tap-highlight-color: transparent;
}
.week-nav__btn:hover { background: var(--surface-2); color: var(--brand); }
.week-nav__btn:disabled, .week-nav__btn[disabled] { color: var(--text-4); cursor: not-allowed; pointer-events: none; opacity: 0.5; }

/* Section title inside content */
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: var(--sp-3);
}
.section-title .hint { font-size: var(--fs-xs); color: var(--text-4); font-weight: 400; margin-left: auto; }

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translate(-50%, -20px);
  background: rgba(26, 34, 48, 0.92);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--r-lg);
  font-size: var(--fs-sm);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 15px; height: 15px; }
.toast.toast-success svg { color: var(--success); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
}
.modal-overlay.show { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 440px;
  max-height: 85vh;
  overflow-y: auto;
  animation: modalIn 0.22s ease;
  box-shadow: var(--shadow-lg);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

.modal__head { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-5); border-bottom: 1px solid var(--border); }
.modal__title { font-size: var(--fs-lg); font-weight: 600; }
.modal__body { padding: var(--sp-5); }
.modal__foot { padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--border); display: flex; gap: var(--sp-3); justify-content: flex-end; }

/* Drawer (mobile nav) */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 400;
  display: none;
}
.drawer-overlay.show { display: block; }
.drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: var(--surface);
  z-index: 401;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}
.drawer-overlay.show .drawer { transform: translateX(0); }
.drawer__logo { height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 var(--sp-5); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.drawer__nav { flex: 1; padding: var(--sp-4); overflow-y: auto; }
.drawer__user { padding: var(--sp-4); border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }

/* Utility */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex-1 { flex: 1; min-width: 0; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mt-4 { margin-top: 16px; }
.text-xs { font-size: var(--fs-xs); }
.text-sm { font-size: var(--fs-sm); }
.text-muted { color: var(--text-3); }
.text-faint { color: var(--text-4); }
.text-brand { color: var(--brand); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- SVG 尺寸约束 ---------- */
.nav-icon svg { width: 18px; height: 18px; }
.logo-mark svg { width: 16px; height: 16px; }
.icon-btn svg { width: 17px; height: 17px; }
.btn svg { width: 15px; height: 15px; }
.week-chip svg { width: 14px; height: 14px; }
.week-nav__btn svg { width: 16px; height: 16px; }
.card__title > svg { width: 18px; height: 18px; color: var(--brand); flex-shrink: 0; }
.card__extra svg { width: 13px; height: 13px; vertical-align: -2px; }
.list-item__meta svg { width: 12px; height: 12px; vertical-align: -2px; }
.dir-icon svg { width: 15px; height: 15px; }
.filter-tab svg { width: 13px; height: 13px; vertical-align: -2px; }

/* Filter tabs */
.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-tab {
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.filter-tab:hover { border-color: var(--brand); color: var(--brand); }
.filter-tab.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-strong); font-weight: 600; }
.filter-tab .count { margin-left: 4px; font-size: 11px; opacity: 0.7; }

/* Voice FAB */
.voice-fab {
  position: fixed;
  right: var(--sp-6);
  bottom: var(--sp-6);
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(9, 105, 218, 0.4);
  cursor: pointer;
  z-index: 80;
  transition: all 0.2s;
  border: none;
  -webkit-tap-highlight-color: transparent;
}
.voice-fab svg { width: 24px; height: 24px; }
.voice-fab:hover { background: var(--brand-hover); transform: scale(1.04); }
.voice-fab.recording { background: var(--danger); animation: pulse 1.5s infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(207, 19, 34, 0.45); }
  50% { box-shadow: 0 0 0 14px rgba(207, 19, 34, 0); }
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1023px) {
  .sidebar { width: var(--sidebar-w-collapsed); }
  .main { margin-left: var(--sidebar-w-collapsed); }
  .sidebar__logo { justify-content: center; padding: 0; }
  .logo-name { display: none; }
  .nav-item { justify-content: center; padding: 10px 0; }
  .nav-item .nav-text, .nav-item .nav-badge { display: none; }
  .nav-group-label { text-align: center; font-size: 10px; padding: var(--sp-2) 0; }
  .sidebar__user { justify-content: center; padding: var(--sp-3) var(--sp-2); }
  .sidebar__user-info, .sidebar__user .icon-btn { display: none; }
  .grid-main-side, .grid-main-side--narrow { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .topbar__hamburger { display: flex; }
  .topbar { padding: 0 var(--sp-4); height: 54px; }
  .content { padding: var(--sp-4); }
  .grid-2 { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
  .quick-card { padding: var(--sp-4); }
  .topbar__user-name, .week-chip { display: none; }
  .textarea--tall { min-height: 240px; }
  .textarea--xl { min-height: 320px; }
  .card__body { padding: var(--sp-4); }
  .btn-lg { height: 46px; }
  .banner { padding: var(--sp-3) var(--sp-4); }
  .banner__icon { width: 38px; height: 38px; }
  .steps { padding: var(--sp-3) var(--sp-4); }
  .step__time { display: none; }
  .voice-fab { right: var(--sp-4); bottom: var(--sp-4); }
}

@media (max-width: 420px) {
  .quick-grid { grid-template-columns: 1fr 1fr; }
  .stat-row { gap: var(--sp-3); }
  .stat-tile { padding: var(--sp-3); }
  .stat-tile__value { font-size: 22px; }
}
