:root {
  --bg: #FFFFFF;
  --bg-card: #F7FBFE;
  --bg-sidebar: #EDF4FA;
  --bg-hover: #E5EEF6;
  --primary: #8FBCD4;
  --primary-light: #B8D4E8;
  --primary-lighter: #D6E8F2;
  --primary-dark: #6BA3C3;
  --text: #2C3E50;
  --text-secondary: #5A7A8A;
  --text-tertiary: #9AABB8;
  --border: #E1ECF4;
  --border-light: #EFF5FA;
  --success: #5DCAA5;
  --warning: #EF9F27;
  --danger: #E24B4A;
  --danger-bg: #FDE8E8;
  --success-bg: #E1F5EE;
  --warning-bg: #FAEEDA;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow: 0 2px 12px rgba(143, 188, 212, 0.12);
  --sidebar-w: 220px;
  --tab-h: 62px;
}

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

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

#app { display: flex; min-height: 100vh; overflow-x: hidden; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}
.sidebar-header {
  padding: 24px 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-light);
}
.logo-icon { font-size: 28px; line-height: 1; }
.logo-title { font-size: 16px; font-weight: 600; color: var(--text); }
.logo-subtitle { font-size: 11px; color: var(--text-tertiary); }
.nav-list { flex: 1; padding: 12px 12px; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  color: var(--text-secondary);
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active { background: var(--primary-lighter); color: var(--primary-dark); font-weight: 500; }
.nav-icon { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-icon svg { width: 20px; height: 20px; }
.nav-text { font-size: 14px; }
.sidebar-footer { padding: 12px 20px; border-top: 1px solid var(--border-light); }
.today-date { font-size: 12px; color: var(--text-tertiary); }

/* Main */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  overflow-x: hidden;
}
.main-header {
  padding: 20px 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-title { font-size: 20px; font-weight: 600; color: var(--text); }
.header-extra-btn {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.15s;
}
.header-extra-btn:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--primary-lighter);
}
.header-extra-btn svg { width: 18px; height: 18px; display: block; }
.content { flex: 1; padding: 20px 28px 32px; overflow-y: auto; overflow-x: hidden; min-width: 0; }

/* 弹窗里的「计时设置」专有容器（去掉卡片外框，与 modal-body 视觉融合） */
.modal-body .pomo-settings-body .pomo-settings-card,
.modal-body .pomo-settings-body { padding: 0; box-shadow: none; border: 0; }
.bottom-tab { display: none; }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  max-width: 100%;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title { font-size: 15px; font-weight: 600; color: var(--text); }
.card-subtitle { font-size: 12px; color: var(--text-tertiary); }

/* Metrics */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.metric {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
}
.metric-label { font-size: 12px; color: var(--text-tertiary); margin-bottom: 4px; }
.metric-value { font-size: 22px; font-weight: 600; color: var(--text); }
.metric-sub { font-size: 11px; margin-top: 4px; }
.metric-pos { color: var(--danger); }     /* 中国 A 股惯例：正红 */
.metric-neg { color: var(--success); }    /* 中国 A 股惯例：负绿 */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.btn:hover { background: var(--bg-hover); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent;
  border-radius: 50%; cursor: pointer;
  font-size: 16px; color: var(--text-secondary);
}
.btn-icon:hover { background: var(--bg-hover); }

/* Inputs */
.input, select.input, textarea.input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border 0.15s;
}
.input:focus { border-color: var(--primary); }
label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; margin-top: 14px; }
label:first-child { margin-top: 0; }
.input-search {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 10px 14px 10px 36px;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%239AABB8' stroke-width='1.8'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 16px;
}

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.tag:hover { border-color: var(--primary); }
.tag-active { background: var(--primary-lighter); border-color: var(--primary); color: var(--primary-dark); font-weight: 500; }
.tag-success { background: var(--success-bg); color: #0F6E56; }
.tag-danger { background: var(--danger-bg); color: var(--danger); }

/* Table */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-tertiary);
  font-weight: 500;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}
tr:hover td { background: var(--bg-card); }

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 16px;
}
.tab-btn {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  border: none;
  background: transparent;
  font-family: inherit;
  transition: all 0.15s;
}
.tab-btn.active { background: var(--bg); color: var(--primary-dark); font-weight: 500; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.tab-btn:hover:not(.active) { color: var(--text); }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(44, 62, 80, 0.4);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--bg);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(44, 62, 80, 0.15);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-light);
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-body { padding: 20px 24px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: #fff;
  padding: 10px 24px;
  border-radius: 24px;
  font-size: 13px;
  opacity: 0;
  transition: all 0.25s;
  z-index: 2000;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-tertiary);
}

/* ==================== Module: Inspiration ==================== */

/* Top row: 3 rankings + inspo — 4 equal columns, never overflow */
.inspo-top-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}
.inspo-top-col {
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.inspo-top-col .ranking-card {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.inspo-top-col .ranking-card .ranking-table-wrap {
  flex: 1;
  overflow-y: auto;
}

/* Inspiration column: card panel */
.inspo-col-inspo {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.inspo-col-inspo .inspo-right-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px;
  border-bottom: 1px solid var(--border-light);
  min-width: 0;
  gap: 6px;
}
.inspo-col-inspo .inspo-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px 10px;
}

/* Ranking cards */
.ranking-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  min-width: 0;
  overflow: hidden;
}
.inspo-section-title { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-light);
  min-width: 0;
}
.ranking-header-left { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ranking-icon { font-size: 14px; line-height: 1; flex-shrink: 0; }
.ranking-title { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranking-meta { font-size: 10px; color: var(--text-tertiary); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranking-source-link {
  font-size: 11px; color: var(--text-tertiary); text-decoration: none;
  padding: 2px 4px; border-radius: var(--radius-sm); transition: all 0.15s;
  flex-shrink: 0; white-space: nowrap;
}
.ranking-source-link:hover { background: var(--bg-hover); color: var(--primary-dark); }
.ranking-table-wrap { max-height: 300px; overflow-y: auto; overflow-x: hidden; }
.ranking-table { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.ranking-table thead { position: sticky; top: 0; z-index: 1; }
.ranking-table th {
  padding: 6px 6px; color: var(--text-tertiary); font-weight: 500; font-size: 10px;
  background: var(--bg-card); border-bottom: 1px solid var(--border);
}
.rank-num-th { width: 28px; text-align: center; }
.rank-name-th { text-align: left; }
.rank-vote-th { width: 42px; text-align: right; }
.rank-row td { padding: 4px 6px; border-bottom: 1px solid var(--border-light); }
.rank-row:hover td { background: var(--bg-hover); }
.rank-num { text-align: center; font-size: 11px; color: var(--text-tertiary); font-weight: 500; width: 28px; }
.rank-name { font-weight: 400; color: var(--text); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-vote { text-align: right; font-size: 11px; color: var(--text-secondary); font-weight: 500; width: 42px; }
.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 4px; font-size: 11px; font-weight: 600; color: #fff;
}
.rank-b1 { background: #E2B04A; }
.rank-b2 { background: #9BAFC0; }
.rank-b3 { background: #C08B5C; }
.rank-top1 td, .rank-top2 td, .rank-top3 td { background: rgba(143, 188, 212, 0.06); }

/* Inspiration row items */
.inspo-row-item {
  border-bottom: 1px solid var(--border-light);
  padding: 12px 4px;
  transition: background 0.1s;
}
.inspo-row-item:last-child { border-bottom: none; }
.inspo-row-item:hover { background: var(--bg-hover); border-radius: var(--radius-sm); padding-left: 8px; padding-right: 8px; }
.inspo-row-title { font-weight: 500; font-size: 14px; color: var(--text); margin-bottom: 3px; }
.inspo-row-content { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; line-height: 1.5; }
.inspo-row-meta {
  display: flex; align-items: center; gap: 8px; margin-top: 4px;
}
.inspo-row-date { font-size: 11px; color: var(--text-tertiary); }
.inspo-row-tags { font-size: 11px; color: var(--primary-dark); background: var(--primary-lighter); padding: 0 6px; border-radius: 10px; }

/* Product table — own horizontal scroll, does not push page width */
.prod-table-outer {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  max-width: 100%;
}
.prod-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 500px;
  max-width: 100%;
}
.prod-table {
  border-collapse: collapse;
  font-size: 13px;
  min-width: 100%;
}
.prod-table th, .prod-table td {
  border: 1px solid var(--border-light);
  padding: 6px 10px;
  white-space: nowrap;
}
.prod-col-header {
  position: relative;
  font-weight: 600;
  font-size: 12px;
  color: var(--text);
  background: var(--primary-lighter);
  min-width: 80px;
  cursor: pointer;
}
.prod-col-header:hover { background: var(--primary-light); }
.prod-hdr-text { cursor: pointer; }
.prod-col-del {
  position: absolute; top: 2px; right: 2px;
  width: 16px; height: 16px; font-size: 11px;
  border: none; background: transparent; border-radius: 50%;
  color: var(--text-tertiary); cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  line-height: 1; padding: 0;
  opacity: 0; transition: opacity 0.15s;
}
.prod-col-header:hover .prod-col-del { opacity: 1; }
.prod-col-del:hover { background: var(--danger-bg); color: var(--danger); }
.prod-fix-col {
  position: sticky; left: 0; z-index: 2;
  background: var(--bg-sidebar); min-width: 44px; width: 44px;
  text-align: center; font-weight: 500; color: var(--text-secondary); font-size: 12px;
  border-right: 2px solid var(--border);
}
.prod-fix-header { background: var(--primary-lighter) !important; z-index: 3; }
.prod-row-num { position: relative; }
.prod-row-del {
  position: absolute; top: 2px; right: 2px;
  width: 16px; height: 16px; font-size: 11px;
  border: none; background: transparent; border-radius: 50%;
  color: var(--text-tertiary); cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  line-height: 1; padding: 0;
  opacity: 0; transition: opacity 0.15s;
}
.prod-fix-col:hover .prod-row-del { opacity: 1; }
.prod-row-del:hover { background: var(--danger-bg); color: var(--danger); }
.prod-cell {
  background: var(--bg); min-width: 60px; outline: none;
}
.prod-cell:focus {
  background: #fff; box-shadow: inset 0 0 0 2px var(--primary);
  border-radius: 2px;
}
.prod-cell:hover { background: var(--bg-card); }
.prod-hint {
  font-size: 11px; color: var(--text-tertiary); margin-top: 10px;
  text-align: center;
}

/* Responsive for inspiration */
@media (max-width: 1100px) {
  .inspo-top-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .inspo-top-row { grid-template-columns: minmax(0, 1fr); }
  .ranking-table-wrap { max-height: 200px; }
}

/* Module: Cost */
.cost-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.cost-item { text-align: center; padding: 12px; background: var(--bg-card); border-radius: var(--radius-md); border: 1px solid var(--border-light); }
.cost-item-label { font-size: 12px; color: var(--text-tertiary); }
.cost-item-val { font-size: 18px; font-weight: 600; }

/* Module: Lifestyle */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}
.section-title { font-size: 15px; font-weight: 600; }
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}
.record-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}
.record-row:last-child { border-bottom: none; }
.record-label { font-size: 13px; color: var(--text-secondary); }
.record-value { font-size: 14px; font-weight: 500; }
.pill {
  display: inline-block;
  padding: 2px 10px;
  font-size: 11px;
  border-radius: 12px;
}
.pill-blue { background: var(--primary-lighter); color: var(--primary-dark); }
.pill-green { background: var(--success-bg); color: #0F6E56; }
.pill-amber { background: var(--warning-bg); color: #854F0B; }
.pill-pink { background: #FBEAF0; color: #993556; }

/* Module: BiPlan (周历) */
/* 近期重点任务 - 内嵌标题栏 */
.biplan-header-row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}
.biplan-header-row .header-title {
  flex-shrink: 0;
}
.biplan-keys-inline {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.biplan-keys-label {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 600;
}
.biplan-keys-input {
  width: 100%;
  resize: vertical;
  font-size: 13px;
  line-height: 1.5;
  min-height: 32px;
  padding: 4px 8px;
}
.inv-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.inv-header-time {
  font-size: 12px;
  color: var(--text-tertiary);
}

.biplan-week {
  margin-bottom: 32px;
}
.biplan-week-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.biplan-week-dates {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-tertiary);
}
.past-week .biplan-week-title {
  color: var(--text-secondary);
}
.past-week .biplan-week-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 16px;
  background: var(--border);
  border-radius: 2px;
}

/* 日期表头 */
.biplan-week-header {
  display: grid;
  grid-template-columns: 3fr 3fr 3fr 3fr 3fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
.biplan-day-header {
  text-align: center;
  padding: 8px 4px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}
.biplan-day-header.today {
  background: var(--primary-lighter);
  border-color: var(--primary);
}
.biplan-day-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}
.biplan-day-header.today .biplan-day-name {
  color: var(--primary-dark);
}
.biplan-day-date {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-top: 2px;
}
.biplan-day-header.today .biplan-day-date {
  color: var(--primary-dark);
}

/* 计划格子区域 */
.biplan-week-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.biplan-grid-row {
  display: grid;
  grid-template-columns: 3fr 3fr 3fr 3fr 3fr 1fr 1fr;
  gap: 8px;
}

/* 格子 */
.biplan-cell {
  min-height: 360px;
  min-width: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  padding: 10px;
  position: relative;
  overflow: hidden;
}

/* 新建计划弹窗 - 类型选择 */
.biplan-type-select {
  display: flex;
  gap: 18px;
  margin-bottom: 4px;
  align-items: center;
}
/* 自定义 radio 按钮容器 + 用 box-shadow 内嵌法完全自绘 */
.biplan-radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  line-height: 18px;
  padding: 0;
  min-height: 22px;
  white-space: nowrap;
  user-select: none;
  margin: 0;
}
.biplan-radio input[type="radio"] {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  -ms-appearance: none !important;
  appearance: none !important;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
  padding: 0;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px;
  min-height: 18px;
  max-width: 18px;
  max-height: 18px;
  border: 2px solid #cfcfcf !important;
  border-radius: 50% !important;
  background: #fff !important;
  background-image: none !important;
  display: inline-block;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  flex-grow: 0;
  vertical-align: middle;
  box-sizing: border-box;
  outline: none !important;
  transition: border-color 0.15s, background-color 0.15s;
  box-shadow: none !important;
  accent-color: transparent !important;
}
.biplan-radio input[type="radio"]:hover {
  border-color: var(--primary) !important;
}
.biplan-radio input[type="radio"]:checked {
  border-color: var(--primary) !important;
  background-color: var(--primary) !important;
  /* 内嵌白圈形成圆点效果 */
  box-shadow: inset 0 0 0 4px #fff !important;
}
.empty-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
  min-height: 360px;
  padding: 10px;
  box-sizing: border-box;
  border-style: dashed;
  border-color: var(--border);
  background: var(--bg-card);
}

/* 新增按钮 */
.biplan-add-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px dashed var(--primary-light);
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
}
.biplan-add-btn:hover {
  background: var(--primary-lighter);
  border-color: var(--primary);
  border-style: solid;
  transform: scale(1.05);
}

/* 计划格子 */
.plan-cell {
  background: var(--primary-lighter);
  border: 1px solid var(--primary-light);
}
.plan-cell.all-done {
  background: var(--success-bg);
  border-color: var(--success);
}

.biplan-plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.biplan-plan-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.biplan-plan-badge {
  font-size: 13px;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.7);
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}

/* 计划格子内任务列表 */
.biplan-plan-tasks {
  max-height: 400px;
  overflow-y: auto;
}
.biplan-task {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 3px 0;
  font-size: 14px;
}
.biplan-task .task-checkbox {
  width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 12px;
  flex-shrink: 0;
  margin-top: 3px;
  cursor: pointer;
  color: var(--text-tertiary);
}
.biplan-task.done .task-checkbox {
  color: var(--success);
}
.biplan-task.done .task-text-input {
  text-decoration: line-through;
  color: var(--text-tertiary);
}
.biplan-task .task-content {
  flex: 1;
  min-width: 0;
}
.biplan-task .task-text-input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  font-size: 14px;
  color: var(--text-primary);
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.biplan-task .task-text-input:hover {
  border-color: var(--border-light);
  background: rgba(0,0,0,0.02);
}
.biplan-task .task-text-input:focus {
  border-color: var(--primary-light);
  background: rgba(143, 188, 212, 0.06);
}
.biplan-task .task-times {
  display: flex;
  gap: 8px;
  margin-top: 2px;
  padding-left: 4px;
}
.biplan-task .task-time-group {
  display: flex;
  align-items: center;
  gap: 3px;
}
.biplan-task .task-time-label {
  font-size: 11px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}
.biplan-task .task-time-input {
  width: 50px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1px 4px;
  font-size: 11px;
  color: var(--text-secondary);
  background: transparent;
  outline: none;
}
.biplan-task .task-time-input:focus {
  border-color: var(--primary-light);
}
.biplan-task .task-time-input::placeholder {
  color: var(--text-tertiary);
  font-size: 10px;
}

/* 计划格子内操作按钮 */
.biplan-plan-del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 16px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  opacity: 0;
  transition: all 0.15s;
}
.plan-cell:hover .biplan-plan-del {
  opacity: 1;
}
.biplan-plan-del:hover {
  background: var(--danger-bg);
  color: var(--danger);
}
.biplan-task-add {
  margin-top: 4px;
  width: 100%;
  padding: 4px;
  border: 1px dashed var(--primary-light);
  background: transparent;
  color: var(--primary);
  font-size: 14px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.biplan-task-add:hover {
  background: rgba(143, 188, 212, 0.15);
  border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 1024px) {
  .biplan-grid-row {
    gap: 4px;
  }
  .biplan-cell {
    min-height: 280px;
    padding: 6px;
  }
  .biplan-plan-tasks {
    max-height: 320px;
  }
}

@media (max-width: 768px) {
  .biplan-day-header {
    padding: 4px 2px;
  }
  .biplan-day-name { font-size: 14px; }
  .biplan-day-date { font-size: 12px; }
  .biplan-cell {
    min-height: 240px;
    padding: 4px;
  }
  .biplan-plan-title { font-size: 13px; }
  .biplan-task { font-size: 13px; }
  .biplan-task .task-text-input { font-size: 13px; }
  .biplan-task .task-times { gap: 4px; }
  .biplan-task .task-time-input { width: 42px; font-size: 10px; }
  .biplan-task .task-time-label { font-size: 10px; }
  .biplan-plan-tasks { max-height: 120px; }
}

/* Module: Investment (投资复盘) */
.inv-dashboard {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}
.inv-board {
  flex: 1;
  border-radius: var(--radius);
  padding: 16px 20px;
  border: 1px solid var(--border-light);
}
.inv-board-risk {
  background: linear-gradient(135deg, rgba(143,188,212,0.08), rgba(143,188,212,0.02));
  border-color: var(--primary-light);
}
.inv-board-total {
  background: linear-gradient(135deg, rgba(76,175,80,0.06), rgba(76,175,80,0.01));
  border-color: rgba(76,175,80,0.2);
}
.inv-board-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.inv-board-sub {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-tertiary);
}
.inv-board-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}
.inv-board-returns {
  display: flex;
  gap: 20px;
}
.inv-ret {
  display: flex;
  align-items: center;
  gap: 4px;
}
.inv-ret label {
  font-size: 11px;
  color: var(--text-tertiary);
}
.inv-ret b {
  font-size: 14px;
  font-weight: 600;
}
.inv-holdings-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.inv-section {
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--bg);
}
/* 基金：整行拉满 */
.inv-section-full {
  grid-column: span 6;
}
/* 理财 / 黄金 / 股票 / 现金：两两并列各占半行 */
.inv-section-half {
  grid-column: span 3;
}
.inv-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.inv-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.inv-section-sum {
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--border-light);
}

/* Pie chart */
.inv-board-pie {
  flex: 1.4;
  display: flex;
  align-items: center;
}
.pie-chart-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
}
.pie-svg {
  width: 150px;
  height: 150px;
  flex-shrink: 0;
}
.pie-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pie-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pie-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.pie-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
}
.pie-sub {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-tertiary);
  margin-left: 4px;
}
.pie-pct {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.cell-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 768px) {
  .inv-holdings-grid { grid-template-columns: 1fr; }
  .inv-section, .inv-section-full, .inv-section-half { grid-column: span 1; }
  .inv-dashboard { flex-direction: column; }
  .inv-board-pie { flex: 1; }
}

/* Module: Diary */
.diary-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.diary-controls .input-search { flex: 1; }

/* 常驻编辑区 */
.diary-editor {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}
.diary-editor-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.diary-editor-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}
.diary-img-area {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.diary-img-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  padding: 0 14px;
  border: 1.5px dashed var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
  color: var(--text-tertiary);
  transition: all 0.15s;
  flex-shrink: 0;
}
.diary-img-add:hover { border-color: var(--primary); color: var(--primary); }
.diary-img-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.diary-img-thumb {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.diary-img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.diary-img-del {
  position: absolute;
  top: 0;
  right: 0;
  width: 18px;
  height: 18px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  border-radius: 0 0 0 6px;
  font-size: 12px;
  line-height: 18px;
  cursor: pointer;
  padding: 0;
}

/* 标签栏 */
.diary-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.tag-selectable { cursor: pointer; user-select: none; }
.tag-manage { position: relative; cursor: pointer; user-select: none; padding-right: 8px; }
.tag-actions {
  display: none;
  position: absolute;
  right: -2px;
  top: -8px;
  gap: 0;
}
.tag-manage:hover .tag-actions { display: flex; }
.tag-edit-btn, .tag-del-btn {
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  font-size: 9px;
  line-height: 16px;
  cursor: pointer;
  padding: 0;
  margin-left: 2px;
}
.tag-edit-btn { background: var(--primary); color: #fff; }
.tag-del-btn { background: var(--danger); color: #fff; }
.tag-add {
  cursor: pointer;
  border: 1px dashed var(--border-light);
  color: var(--text-tertiary);
}
.tag-add:hover { border-color: var(--primary); color: var(--primary); }

/* 日记卡片 */
.diary-entry {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 10px;
  transition: all 0.15s;
}
.diary-entry:hover { border-color: var(--primary); }
.diary-entry-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.diary-entry-tags-inline {
  display: inline-flex;
  gap: 4px;
  flex-shrink: 0;
}
.diary-entry-tags-inline .tag-sm {
  font-size: 11px;
  padding: 1px 6px;
  background: rgba(143, 188, 212, 0.15);
  color: #5a8fa8;
  border-radius: 4px;
}
.diary-entry-title { font-weight: 500; font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diary-entry-date { font-size: 12px; color: var(--text-tertiary); white-space: nowrap; flex-shrink: 0; }

.diary-entry-body {
  display: flex;
  gap: 12px;
}
.diary-entry-left { flex-shrink: 0; }
.diary-entry-thumb {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
}
.diary-entry-thumb:hover { opacity: 0.85; }
.diary-entry-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.diary-entry-thumb-count {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 8px;
}
.diary-entry-right {
  flex: 1;
  min-width: 0;
}
.diary-entry-preview {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}

.diary-entry-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}
.diary-entry-actions .diary-entry-date {
  margin-right: auto;
}

/* 编辑模式卡片 */
.diary-entry-editing {
  border-color: var(--primary);
  border-width: 2px;
}
.diary-entry-editing .diary-entry-actions {
  justify-content: space-between;
}

/* "更多"弹窗 */
.diary-more-meta {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.diary-more-tags {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.diary-more-content {
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 12px;
}
.diary-more-images {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.diary-more-img {
  width: 100%;
  max-width: 300px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: opacity 0.15s;
}
.diary-more-img:hover { opacity: 0.85; }
.diary-more-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

/* 全屏图片查看 */
@keyframes diaryFadeIn { from { opacity: 0; } to { opacity: 1; } }
.diary-fullimg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: diaryFadeIn 0.15s;
}
.diary-fullimg-overlay img {
  max-width: 95vw;
  max-height: 95vh;
  border-radius: 4px;
}

/* Bar chart */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 100px;
  padding: 8px 0;
}
.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.bar-fill {
  width: 100%;
  max-width: 40px;
  border-radius: 4px 4px 0 0;
  background: var(--primary-light);
  transition: height 0.3s;
  min-height: 4px;
}
.bar-label { font-size: 10px; color: var(--text-tertiary); margin-top: 4px; }

/* Mobile Responsive */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding-bottom: var(--tab-h); }
  .main-header { padding: 16px 16px 0; }
  .content { padding: 16px; }

  .bottom-tab {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--tab-h);
    background: var(--bg);
    border-top: 1px solid var(--border);
    z-index: 100;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 64px;
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 10px;
    cursor: pointer;
    padding: 8px 6px;
    transition: all 0.15s;
    flex-shrink: 0;
  }
  .tab-item.active { color: var(--primary-dark); }
  .tab-icon { width: 22px; height: 22px; }
  .tab-icon svg { width: 22px; height: 22px; }
  .tab-label { font-size: 10px; }

  .cost-summary { grid-template-columns: repeat(3, 1fr); }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .inspo-grid { grid-template-columns: 1fr; }
  .modal { max-width: 100%; margin: 0 8px; }
}

/* ==================== 登录页 ==================== */
#login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #EDF4FA 0%, #D6E8F2 100%);
  z-index: 9999;
}

.login-box {
  background: #fff;
  padding: 40px 32px;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(143, 188, 212, 0.25);
  width: 320px;
  max-width: calc(100vw - 32px);
  text-align: center;
}

.login-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.login-box h2 {
  font-size: 20px;
  color: var(--text);
  margin: 0 0 24px 0;
  font-weight: 600;
}

.login-box input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--primary-lighter);
  border-radius: 8px;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 12px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.login-box input:focus {
  border-color: var(--primary);
}

.login-box button {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.login-box button:hover {
  background: var(--primary-dark);
}

.login-box button:active {
  transform: scale(0.98);
}

.login-error {
  color: #e74c3c;
  font-size: 13px;
  margin-top: 12px;
  min-height: 18px;
}

/* 登出按钮 */
.logout-btn {
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.logout-btn:hover {
  opacity: 1;
}

/* ==================== Module: Pomodoro ==================== */
.pomo-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.pomo-bottom {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.pomo-top {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: stretch;
}

/* 左侧：计时圆盘 */
.pomo-timer-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  height: 100%;
  box-sizing: border-box;
}

.pomo-circle {
  position: relative;
  width: 280px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pomo-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.pomo-ring {
  transition: stroke-dashoffset 0.5s linear;
}

.pomo-circle-center {
  position: relative;
  z-index: 1;
  text-align: center;
}

.pomo-time-display {
  font-size: 56px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  line-height: 1;
}

.pomo-time-label {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-top: 8px;
}

.pomo-timer-area.running .pomo-time-display {
  color: var(--primary-dark);
}

/* 开始/停止按钮 */
.pomo-start-btn {
  margin-top: 32px;
  padding: 14px 56px;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 28px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  box-shadow: 0 4px 16px rgba(143, 188, 212, 0.4);
}
.pomo-start-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(143, 188, 212, 0.5);
}
.pomo-start-btn:active {
  transform: scale(0.98);
}

.pomo-stop-btn {
  padding: 14px 56px;
  font-size: 18px;
  font-weight: 600;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  border-radius: 28px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.pomo-stop-btn:hover {
  background: #FADADA;
}

/* 按钮容器（暂停+停止 并排） */
.pomo-timer-btns {
  margin-top: 32px;
  display: flex;
  gap: 12px;
  align-items: center;
}

/* 暂停按钮 */
.pomo-pause-btn {
  padding: 14px 40px;
  font-size: 18px;
  font-weight: 600;
  color: var(--warning);
  background: var(--warning-bg);
  border: 1px solid var(--warning);
  border-radius: 28px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.pomo-pause-btn:hover {
  background: #FDF4E0;
}

/* 休息态绿色主题 */
.pomo-timer-area.breaking .pomo-time-display {
  color: #2E9B75;
}
.pomo-timer-area.breaking.paused .pomo-time-display {
  color: var(--text-tertiary);
}

/* 暂停态文字变灰 */
.pomo-timer-area.running.paused .pomo-time-display {
  color: var(--text-tertiary);
}

/* 右侧区域 */
.pomo-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pomo-settings-card {
  padding: 20px;
}

.pomo-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.pomo-preset {
  padding: 8px 16px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.pomo-preset:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}
.pomo-preset.active {
  background: var(--primary-lighter);
  border-color: var(--primary);
  color: var(--primary-dark);
  font-weight: 600;
}

.pomo-custom {
  padding-top: 4px;
}

/* 设置区分隔线 */
.pomo-settings-divider {
  height: 1px;
  background: var(--border-light);
  margin: 16px 0;
}

.pomo-settings-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pomo-settings-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* 统计卡片 */
.pomo-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.pomo-stat {
  text-align: center;
  padding: 16px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.pomo-stat-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-dark);
}

.pomo-stat-label {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* ===== Focus Trend 趋势卡片 ===== */
.pomo-trend-card {
  padding: 20px;
}
.pomo-trend-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.pomo-trend-metric {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 8px;
  text-align: center;
}
.pomo-trend-metric-label {
  font-size: 12px;
  color: var(--text-tertiary);
}
.pomo-trend-metric-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.pomo-trend-delta {
  font-size: 11px;
  margin-top: 4px;
}
/* 国内习惯：涨红跌绿 */
.pomo-trend-delta.up { color: #E0665C; }
.pomo-trend-delta.down { color: #4EA98B; }
.pomo-trend-delta.flat { color: var(--text-tertiary); }

/* 周切换导航 */
.pomo-trend-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pomo-trend-nav-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.pomo-trend-nav-btn:hover:not(.disabled) {
  border-color: var(--primary);
  color: var(--primary-dark);
}
.pomo-trend-nav-btn.disabled {
  opacity: 0.35;
  cursor: default;
}
.pomo-trend-nav-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 92px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.25;
}
.pomo-trend-nav-range {
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.pomo-trend-chart {
  border-top: 1px dashed var(--border-light);
  padding-top: 14px;
}
.pomo-trend-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 110px;
}
.pomo-trend-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.pomo-trend-colbars {
  width: 18px;
  margin: 0 auto;
  display: flex;
  flex-direction: column-reverse;
  gap: 0;
  justify-content: flex-end;
  border-radius: 10px;
  overflow: hidden;
  background: transparent;
}
.pomo-trend-colbars.empty {
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pomo-trend-seg {
  border-radius: 0;
  min-height: 2px;
  transition: height 0.3s;
  flex-shrink: 0;
}
.pomo-trend-empty {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary);
  opacity: 0.35;
  flex-shrink: 0;
}
.pomo-trend-xlabels {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.pomo-trend-xlabel {
  flex: 1;
  text-align: center;
  font-size: 11px;
  color: var(--text-tertiary);
}
.pomo-trend-xlabel.today {
  color: var(--primary-dark);
  font-weight: 700;
}
.pomo-trend-xlabel.future {
  opacity: 0.45;
}
.pomo-trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.pomo-trend-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-secondary);
}

/* ===== 专注事项分类 ===== */
.pomo-cat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.pomo-cat-manage {
  border-top: 1px dashed var(--border-light);
  margin-top: 16px;
  padding-top: 12px;
}
.pomo-cat-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.pomo-cat-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-secondary);
}
.pomo-cat-x {
  cursor: pointer;
  color: var(--text-tertiary);
  font-size: 14px;
  line-height: 1;
}
.pomo-cat-x:hover {
  color: var(--danger);
}
.pomo-cat-add {
  display: flex;
  gap: 8px;
}
.pomo-cat-add input { flex: 1; }

/* 完成弹窗里的分类 pills */
.pomo-cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.pomo-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.pomo-cat-pill.active {
  border-color: var(--primary);
  background: var(--primary-lighter);
  color: var(--primary-dark);
  font-weight: 600;
}

/* 历史记录里的分类下拉 */
.pomo-cat-select {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg);
  color: var(--text-secondary);
  font-family: inherit;
  cursor: pointer;
  max-width: 120px;
}
.pomo-history-row-top { gap: 8px; }

/* 历史记录 */
.pomo-history-list {
  display: flex;
  flex-direction: column;
}

.pomo-history-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border-light);
}
.pomo-history-row:last-child {
  border-bottom: none;
}

.pomo-history-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pomo-history-time {
  font-size: 13px;
  color: var(--text-secondary);
}

.pomo-history-dur {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.pomo-history-note {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
}

.pomo-history-feel {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* 删除按钮 */
.pomo-delete-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
  padding: 0;
  flex-shrink: 0;
}
.pomo-delete-btn:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

/* Responsive */
@media (max-width: 1024px) {
  .pomo-top {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .pomo-timer-area {
    min-height: 360px;
    padding: 32px 16px;
  }
  .pomo-circle {
    width: 220px;
    height: 220px;
  }
  .pomo-time-display {
    font-size: 42px;
  }
  .pomo-start-btn, .pomo-stop-btn, .pomo-pause-btn {
    padding: 12px 40px;
    font-size: 16px;
  }
  .pomo-timer-btns {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ==================== 访客只读模式 ==================== */
.inv-readonly .btn { display: none !important; }
.inv-readonly .empty-state::after {
  content: '（访客模式 · 仅查看）';
  display: block;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 4px;
}
