/* ========== mine工作助手 — 极简黑白 + 科技蓝 + 樱花粉 ========== */
:root {
  --bg: #F8F9FA;            /* 页面背景：干净浅灰 */
  --card: #FFFFFF;          /* 卡片：纯白 */
  --text: #1A1A1A;          /* 主文字：深灰黑 */
  --text-sub: #6B7280;      /* 次级文字 */
  --text-faint: #9CA3AF;    /* 弱化文字 */
  --border: #E5E7EB;        /* 边框 */
  --primary: #2563EB;       /* 品牌主色：科技蓝 */
  --primary-light: #3B82F6;
  --primary-bg: #EFF6FF;    /* 蓝色浅底 */
  --accent: #EC4899;        /* 亮点色：樱花粉 */
  --accent-light: #F472B6;
  --accent-bg: #FDF2F8;     /* 粉色浅底 */
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(26, 26, 26, 0.06), 0 4px 16px rgba(26, 26, 26, 0.05);
  --shadow-hover: 0 4px 8px rgba(26, 26, 26, 0.08), 0 8px 24px rgba(26, 26, 26, 0.08);
}

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

body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

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

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: 200px;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

.logo-icon { font-size: 22px; }
.logo-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 6px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
}

.nav-item:hover { background: var(--bg); color: var(--text); }

.nav-item.active {
  background: var(--primary-bg);
  color: var(--primary);
  font-weight: 600;
}

.nav-icon { font-size: 16px; }
.nav-label-short { display: none; }
.nav-label-full { display: inline; }

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.llm-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--card);
  cursor: pointer;
  transition: all 0.18s ease;
  width: 100%;
  text-align: left;
}

.llm-status:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

.llm-status .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.llm-status.online .dot {
  background: #22C55E;
  box-shadow: 0 0 0 3px #DCFCE7;
}

.llm-status.online {
  border-color: #86EFAC;
  color: #15803D;
  background: #F0FDF4;
}

.llm-status.offline .dot {
  background: #EF4444;
  box-shadow: 0 0 0 3px #FEE2E2;
}

.llm-status.offline {
  border-color: #FCA5A5;
  color: #B91C1C;
  background: #FEF2F2;
}

.llm-label { font-weight: 600; }

/* 下班啦按钮：樱花粉 */
.clockout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.28);
  transition: all 0.18s ease;
}

.clockout-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(236, 72, 153, 0.36); }
.clockout-btn:active { transform: translateY(0); }
.cat-icon { font-size: 18px; }

/* 系统设置按钮：白底描边，下班啦上方 */
.settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.settings-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
}
.gear-icon { font-size: 15px; }

/* ---------- 主内容区 ---------- */
.main-content {
  flex: 1;
  padding: 26px 32px;
  max-width: 1080px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.topbar-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.greeting {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.2px;
}

.window-info { font-size: 12px; color: var(--text-faint); }

.page { display: none; }
.page.active { display: block; animation: fadeIn 0.25s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 输入卡片 ---------- */
.input-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
}

.input-row { display: flex; gap: 10px; align-items: stretch; }

.mini-field {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 0 10px;
  border: 1.5px solid #FBCFE8;
  border-radius: 14px;
  background: linear-gradient(180deg, #FFF7FB 0%, #FDF2F8 100%);
  box-shadow: 0 1px 0 rgba(236, 72, 153, 0.08);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  cursor: pointer;
}
.mini-field:hover {
  border-color: #F9A8D4;
  transform: translateY(-1px);
}
.mini-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
  background: #fff;
}

.mini-emoji {
  font-size: 14px;
  line-height: 1;
  user-select: none;
}

.mini-input {
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: #BE185D;
}

.mini-date { min-width: 138px; }
.mini-date-input {
  width: 118px;
  padding: 12px 0;
  cursor: pointer;
}
.mini-date-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.55;
}

.mini-hours { min-width: 78px; padding-right: 8px; }
.mini-hours-input {
  width: 36px;
  padding: 12px 0;
  text-align: center;
  -moz-appearance: textfield;
}
.mini-hours-input::-webkit-outer-spin-button,
.mini-hours-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.mini-unit {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-right: 2px;
}

.work-input {
  flex: 1;
  min-width: 0;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.work-input::placeholder { color: var(--text-faint); }
.work-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
  background: #fff;
}

.save-check-btn {
  width: 48px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.save-check-btn:hover { background: var(--primary-light); transform: translateY(-1px); }
.save-check-btn:active { transform: translateY(0); }

.category-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.category-label {
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

.cat-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.cat-select:focus { border-color: var(--primary); }

/* 卡哇伊小分类胶囊：一/二级均可编辑 */
.cat-select.cat-pill,
.log-cat-select.cat-pill,
.log-sub-select.cat-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  border-width: 1.5px;
  line-height: 1.6;
  max-width: 132px;
  appearance: none;
  -webkit-appearance: none;
  background-image: none;
}

.cat-pill-sub {
  font-weight: 500;
  opacity: 0.95;
}

.cat-pill[data-cat="任务制项目"],
.cat-tone-task {
  background: #EEF4FF;
  border-color: #93C5FD;
  color: #1D4ED8;
}
.cat-pill[data-cat="科技"],
.cat-tone-tech {
  background: #ECFDF5;
  border-color: #6EE7B7;
  color: #0F766E;
}
.cat-pill[data-cat="生产"],
.cat-tone-prod {
  background: #FFFBEB;
  border-color: #FCD34D;
  color: #B45309;
}
.cat-pill[data-cat="管理"],
.cat-tone-mgmt {
  background: #EEF2FF;
  border-color: #A5B4FC;
  color: #4338CA;
}
.cat-pill[data-cat="其他"],
.cat-tone-other {
  background: #FDF2F8;
  border-color: #F9A8D4;
  color: #BE185D;
}

.parsed-hint { font-size: 12px; color: var(--primary); }

/* ---------- 今日记录 ---------- */
.today-logs-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-header h3 { font-size: 15px; font-weight: 700; }

.log-count {
  font-size: 12px;
  color: var(--text-faint);
  background: var(--bg);
  padding: 2px 10px;
  border-radius: 20px;
}

.log-list { display: flex; flex-direction: column; gap: 8px; }

.log-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: border-color 0.18s ease;
  animation: fadeIn 0.25s ease;
}

.log-item:hover { border-color: var(--border); }

.log-time {
  font-size: 12px;
  color: var(--text-faint);
  padding-top: 2px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.log-content { flex: 1; min-width: 0; font-size: 13.5px; }

/* 模版行：可直接点击编辑 */
.log-template {
  outline: none;
  border-radius: 6px;
  padding: 1px 4px;
  margin: 0 -4px;
  line-height: 1.7;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  word-break: break-all;
}

.log-template:hover {
  background: var(--primary-bg);
  cursor: text;
}

.log-template:focus,
.log-template.editing {
  background: #fff;
  box-shadow: 0 0 0 2px var(--primary-bg), 0 0 0 3.5px var(--primary-light);
}

.log-saved-hint {
  font-size: 11px;
  color: #16A34A;
  padding: 1px 8px;
}

.log-meta { display: flex; gap: 6px; margin-top: 5px; flex-wrap: wrap; align-items: center; }

.log-tag {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 12px;
  background: var(--primary-bg);
  color: var(--primary);
}

.log-tag.tag-sub { background: var(--bg); color: var(--text-sub); border: 1px solid var(--border); }
.log-tag.tag-hours { background: #FFF7ED; color: #EA580C; }
.log-tag.tag-prov { background: var(--accent-bg); color: var(--accent); }

.log-del {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 6px;
  border-radius: 10px;
  transition: all 0.15s ease;
  line-height: 1;
}

.log-del:hover {
  background: #FEF2F2;
  transform: scale(1.1);
}

.empty-hint {
  text-align: center;
  color: var(--text-faint);
  padding: 22px 0;
  font-size: 13px;
}

/* ---------- 周报区 ---------- */
.reports-wrap { display: flex; flex-direction: column; gap: 14px; }

.reports-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.reports-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.reports-title h3 { font-size: 15px; font-weight: 700; }

.reports-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* 🔄 刷新周报按钮：浅蓝软胶囊 */
.refresh-btn {
  padding: 9px 18px;
  border: 1.5px solid #BFDBFE;
  border-radius: 999px;
  background: var(--primary-bg);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.refresh-btn:hover {
  background: #DBEAFE;
  border-color: var(--primary-light);
  transform: translateY(-1px);
}
.refresh-btn:disabled { opacity: 0.55; cursor: wait; transform: none; }

.report-period { font-size: 12px; color: var(--text-faint); }

.draft-badge {
  font-size: 11px;
  color: var(--primary);
  background: var(--primary-bg);
  padding: 2px 10px;
  border-radius: 12px;
  transition: opacity 0.3s;
}

.draft-badge.saving { opacity: 0.45; }

/* 提交按钮：深色软胶囊，别太死板 */
.submit-btn {
  padding: 9px 18px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #374151 0%, #1A1A1A 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 4px 12px rgba(26, 26, 26, 0.18);
}

.submit-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }

.report-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}

.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.report-title {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.report-actions { display: flex; gap: 8px; }

.mini-btn {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-sub);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.mini-btn:hover { border-color: var(--primary); color: var(--primary); }

.copy-btn {
  padding: 5px 14px;
  border: none;
  border-radius: 999px;
  background: var(--primary-bg);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.copy-btn:hover { background: var(--primary); color: #fff; }

.report-textarea {
  width: 100%;
  min-height: 120px;
  padding: 14px 16px;
  border: 1.5px solid #E8ECF1;
  border-radius: 14px;
  background: #FAFBFC;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.85;
  resize: vertical;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.report-textarea:focus {
  border-color: #93C5FD;
  box-shadow: 0 0 0 4px var(--primary-bg);
  background: #fff;
}

/* ---------- 统计页 ---------- */
.period-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.period-select,
.period-date {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  outline: none;
}

.period-select:focus,
.period-date:focus { border-color: var(--primary); }

.period-sep { font-size: 13px; color: var(--text-sub); }

.period-btn {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--card);
  color: var(--text-sub);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.period-btn:hover { border-color: var(--primary); color: var(--primary); }

.period-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.stats-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 18px;
}

.stats-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 16px; }

.chart-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.chart { flex: 1; min-width: 300px; height: 300px; }

.stats-summary {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.summary-pill {
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
  border: 1px solid #E8ECF1;
  border-radius: 16px;
  padding: 12px 18px;
  text-align: center;
  min-width: 90px;
  box-shadow: 0 2px 8px rgba(26, 26, 26, 0.04);
}

.summary-pill .v { font-size: 18px; font-weight: 700; color: var(--primary); }
.summary-pill .l { font-size: 11px; color: var(--text-faint); }

/* 统计表：卡片式圆角 + 彩色分类胶囊，告别死板表格 */
.stats-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  font-size: 13px;
}

.stats-table thead th {
  text-align: left;
  padding: 4px 12px 8px;
  color: var(--text-faint);
  font-weight: 600;
  font-size: 11px;
  border: none;
  background: transparent;
  letter-spacing: 0.04em;
}

.stats-table tbody tr td {
  padding: 12px 14px;
  border: none;
  background: #FAFBFC;
  color: var(--text);
  vertical-align: middle;
}

.stats-table tbody tr td:first-child {
  border-radius: 14px 0 0 14px;
}
.stats-table tbody tr td:last-child {
  border-radius: 0 14px 14px 0;
}

.stats-table tbody tr:hover td {
  background: var(--primary-bg);
}

.stats-table .num {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--primary);
  text-align: right;
}

.stats-table .pct {
  font-size: 12px;
  color: var(--text-sub);
  text-align: right;
}

.stats-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  line-height: 1.6;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-chip.sub {
  font-weight: 500;
  background: #F3F4F6;
  border-color: #E5E7EB;
  color: var(--text-sub);
}

.stats-chip.cat-tone-task { background: #EEF4FF; border-color: #93C5FD; color: #1D4ED8; }
.stats-chip.cat-tone-tech { background: #ECFDF5; border-color: #6EE7B7; color: #0F766E; }
.stats-chip.cat-tone-prod { background: #FFFBEB; border-color: #FCD34D; color: #B45309; }
.stats-chip.cat-tone-mgmt { background: #EEF2FF; border-color: #A5B4FC; color: #4338CA; }
.stats-chip.cat-tone-other { background: #FDF2F8; border-color: #F9A8D4; color: #BE185D; }

.stats-empty {
  text-align: center;
  color: var(--text-faint);
  padding: 18px !important;
  border-radius: 14px !important;
}

.overtime-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.ot-card {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  border: 1px solid var(--border);
}

.ot-card .ot-label { font-size: 12px; color: var(--text-sub); margin-bottom: 4px; }
.ot-card .ot-value { font-size: 22px; font-weight: 700; }
.ot-card .ot-sub { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

.ot-card.normal { background: #F0FDF4; }
.ot-card.normal .ot-value { color: #16A34A; }

.ot-card.minor { background: #FFF7ED; }
.ot-card.minor .ot-value { color: #EA580C; }

.ot-card.deep { background: #FEF2F2; }
.ot-card.deep .ot-value { color: #DC2626; }

.ot-card.trip { background: #F8FAFC; }
.ot-card.trip .ot-value { color: #475569; }

.ot-card.avg { background: var(--accent-bg); }
.ot-card.avg .ot-value { color: var(--accent); }

/* ---------- 下班统计（卡通风） ---------- */
.ot-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px 26px;
  margin-bottom: 18px;
  border-radius: 24px;
  border: 3px solid #FBCFE8;
  background: linear-gradient(135deg, #FFF5FB 0%, #FDF2F8 45%, #EFF6FF 100%);
  box-shadow: 0 6px 0 #F9A8D4, 0 10px 28px rgba(236, 72, 153, 0.12);
}

.ot-hero-mascot {
  font-size: 42px;
  line-height: 1;
  flex-shrink: 0;
  animation: floaty 2.4s ease-in-out infinite;
}

.ot-hero-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.ot-hero-value {
  font-size: 42px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  margin: 4px 0 6px;
  font-variant-numeric: tabular-nums;
}

.ot-hero-unit {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-sub);
  margin-left: 6px;
}

.ot-hero-hint {
  font-size: 12px;
  color: var(--text-faint);
}

.ot-bucket-card {
  border: 2px dashed #FBCFE8;
  background: linear-gradient(180deg, #FFFFFF 0%, #FFFBFE 100%);
}

.ot-bucket-card h3 { margin-bottom: 6px; }

.ot-card-desc {
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 16px;
}

.ot-bucket-layout {
  display: flex;
  gap: 20px;
  align-items: stretch;
  flex-wrap: wrap;
}

.ot-donut {
  flex: 0 0 260px;
  min-width: 240px;
  height: 260px !important;
}

.ot-bucket-list {
  flex: 1;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
}

.ot-bucket-item {
  padding: 10px 14px;
  border-radius: 16px;
  background: #fff;
  border: 2px solid #F3F4F6;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.ot-bucket-item:hover {
  transform: translateX(4px);
  border-color: #FBCFE8;
}

.ot-bucket-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}

.ot-bucket-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.ot-bucket-emoji { font-size: 16px; line-height: 1; }

.ot-bucket-name {
  flex: 1;
  font-weight: 700;
  color: var(--text);
}

.ot-bucket-stat {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.ot-bucket-track {
  height: 10px;
  border-radius: 999px;
  background: #F3F4F6;
  overflow: hidden;
}

.ot-bucket-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.34, 1.4, 0.64, 1);
  min-width: 0;
}

.ot-bucket-empty {
  text-align: center;
  color: var(--text-faint);
  padding: 40px 16px;
  font-size: 13px;
  border-radius: 16px;
  background: #FAFBFC;
  border: 2px dashed #E5E7EB;
}

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.15s ease;
}

.modal {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  width: 380px;
  box-shadow: var(--shadow-hover);
}

.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 10px; }

.modal-body { font-size: 13px; color: var(--text-sub); margin-bottom: 20px; line-height: 1.8; }
.modal-body b { color: var(--text); }

.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

.modal-cancel {
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-sub);
  cursor: pointer;
  font-size: 13px;
}

.modal-cancel:hover { border-color: var(--text-sub); }

.modal-confirm {
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.modal-confirm:hover { background: var(--primary-light); }

/* ---------- 系统设置弹窗 ---------- */
.settings-modal { width: 440px; }

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.field { display: flex; flex-direction: column; gap: 5px; }

.field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.field-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field-input::placeholder { color: var(--text-faint); }
.field-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
  background: #fff;
}

.field-hint { font-size: 11px; color: var(--text-faint); }

.key-row { position: relative; display: flex; align-items: center; }

.key-row .field-input { padding-right: 40px; }

.eye-btn {
  position: absolute;
  right: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  color: var(--text-faint);
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.eye-btn:hover { color: var(--primary); background: var(--primary-bg); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: #fff;
  padding: 11px 22px;
  border-radius: 24px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.28s ease;
  z-index: 200;
  box-shadow: var(--shadow-hover);
  max-width: 80vw;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- AI Loading 柔和提示 ---------- */
.ai-loading-mask {
  position: fixed;
  inset: 0;
  background: rgba(248, 249, 250, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
}

.ai-loading-card {
  background: #fff;
  border: 2px solid #FBCFE8;
  border-radius: 24px;
  padding: 28px 36px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(236, 72, 153, 0.12);
  animation: floaty 2s ease-in-out infinite;
}

.ai-loading-spark {
  font-size: 32px;
  margin-bottom: 10px;
  animation: spin-soft 2.5s linear infinite;
}

.ai-loading-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes spin-soft {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.08); }
  100% { transform: rotate(360deg) scale(1); }
}

/* ---------- 本周历史记录 ---------- */
.week-history-card {
  border: 1.5px dashed #E8ECF1;
  background: linear-gradient(180deg, #FFFFFF 0%, #FAFBFC 100%);
}

.week-day-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-bg);
  padding: 3px 12px;
  border-radius: 999px;
  display: inline-block;
  margin: 6px 0 4px 4px;
}

.work-input:disabled,
.mini-input:disabled,
.save-check-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

/* ---------- 响应式：平板 / 手机 ---------- */
@media (max-width: 760px) {
  body {
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
  }

  .app-container {
    flex-direction: column;
    min-height: 100dvh;
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }

  /* 底部 Tab 导航 */
  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    height: auto;
    z-index: 60;
    flex-direction: column;
    padding: 0;
    border-right: none;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -4px 24px rgba(26, 26, 26, 0.06);
  }

  .sidebar-logo { display: none; }

  .sidebar-nav {
    flex-direction: row;
    justify-content: space-around;
    gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  }

  .nav-item {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    padding: 8px 2px;
    font-size: 11px;
    border-radius: 12px;
    text-align: center;
    min-height: 48px;
  }

  .nav-item.active {
    background: transparent;
    color: var(--primary);
  }

  .nav-item.active .nav-icon {
    transform: scale(1.08);
  }

  .nav-icon { font-size: 20px; line-height: 1; }
  .nav-label-full { display: none; }
  .nav-label-short { display: inline; font-weight: 600; }

  /* 设置 / 下班：吸顶右侧操作条 */
  .sidebar-footer {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    margin: 0;
    z-index: 55;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
  }

  .llm-status { display: none; }

  .settings-btn,
  .clockout-btn {
    padding: 8px 10px;
    font-size: 12px;
    gap: 4px;
    box-shadow: var(--shadow);
  }

  .settings-btn .btn-label,
  .clockout-btn .btn-label { display: none; }

  .settings-btn { min-width: 40px; min-height: 40px; }
  .clockout-btn { min-width: 40px; min-height: 40px; padding: 8px; }

  .main-content {
    padding: 16px 14px 24px;
    max-width: 100%;
    width: 100%;
  }

  .topbar {
    margin-bottom: 16px;
    padding-right: 96px; /* 给右上角设置/下班留空 */
    align-items: flex-start;
  }

  .greeting {
    font-size: 17px;
    line-height: 1.35;
    word-break: break-word;
  }

  .window-info {
    font-size: 11px;
    width: 100%;
  }

  .topbar-right { width: 100%; }

  /* 输入区：竖排适配 */
  .input-card { padding: 14px; }

  .input-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .work-input {
    flex: 1 1 100%;
    order: -1;
    padding: 12px 14px;
    font-size: 16px; /* 避免 iOS 自动缩放 */
  }

  .mini-date {
    flex: 1 1 auto;
    min-width: 0;
  }

  .mini-date-input {
    width: auto;
    min-width: 0;
    flex: 1;
    font-size: 15px;
  }

  .mini-hours { min-width: 72px; }

  .mini-hours-input { font-size: 15px; }

  .save-check-btn {
    width: 46px;
    min-height: 46px;
  }

  .category-row {
    flex-direction: column;
    align-items: stretch;
  }

  .cat-select.cat-pill,
  .log-cat-select.cat-pill,
  .log-sub-select.cat-pill {
    max-width: none;
    width: 100%;
  }

  /* 日志列表 */
  .today-logs-card { padding: 14px; }

  .log-item {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
  }

  .log-time {
    width: 100%;
    padding-top: 0;
  }

  .log-content { font-size: 14px; }

  .log-del {
    padding: 8px;
    margin-left: auto;
  }

  /* 周报 */
  .reports-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .reports-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .refresh-btn,
  .submit-btn {
    width: 100%;
    text-align: center;
    padding: 12px 10px;
  }

  .report-textarea {
    min-height: 160px;
    font-size: 16px;
  }

  /* 统计 / 图表 */
  .period-tabs {
    gap: 6px;
  }

  .period-select,
  .period-btn {
    flex: 1 1 auto;
    min-height: 40px;
    font-size: 14px;
  }

  .chart-row { gap: 8px; }

  .chart {
    flex: 1 1 100%;
    min-width: 0;
    height: 240px;
  }

  .ot-donut {
    flex: 1 1 100%;
    min-width: 0;
    height: 220px !important;
  }

  .ot-bucket-list { min-width: 0; }

  .ot-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 18px;
  }

  .ot-hero-value { font-size: 34px; }
  .ot-hero-mascot { font-size: 36px; }

  .summary-pill {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }

  /* 表格横向滚动 */
  .stats-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  .stats-table {
    min-width: 420px;
  }

  /* 弹窗 */
  .modal,
  .settings-modal {
    width: calc(100vw - 28px);
    max-width: 440px;
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    margin: 14px;
    padding: 20px 16px;
  }

  .modal-actions {
    flex-wrap: wrap;
  }

  .modal-cancel,
  .modal-confirm {
    flex: 1;
    min-height: 44px;
  }

  .ai-loading-card {
    margin: 16px;
    padding: 22px 20px;
    max-width: calc(100vw - 32px);
  }

  .field-input { font-size: 16px; }

  .toast {
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    max-width: calc(100vw - 32px);
  }
}

@media (max-width: 380px) {
  .greeting { font-size: 15px; }
  .reports-actions { grid-template-columns: 1fr; }
  .summary-pill { flex: 1 1 100%; }
}
