/* ===== 工作管家 · 马卡龙色系 ===== */
:root {
  --bg: #FDF7F2;
  --card: #FFFFFF;
  --ink: #5C5266;
  --ink-soft: #9A8FA6;
  --pink: #FFD9E3;      --pink-deep: #E9839E;
  --mint: #CDEFE0;      --mint-deep: #5FB48F;
  --lavender: #E4DFF8;  --lavender-deep: #8A80D6;
  --butter: #FFF0C7;    --butter-deep: #D9A73E;
  --sky: #D5E9FA;       --sky-deep: #5E9BD6;
  --peach: #FFE4D1;     --peach-deep: #E58A5B;
  --danger: #E36D7C;
  --radius: 18px;
  --shadow: 0 6px 18px rgba(150, 120, 140, 0.10);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink);
  font-size: 15px; line-height: 1.5;
}
.hidden { display: none !important; }

/* ===== 登录页 ===== */
.auth-screen {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #FFE3EC 0%, #FDF7F2 40%, #E4F6EE 100%);
}
.auth-card {
  width: 100%; max-width: 360px; background: var(--card);
  border-radius: 24px; box-shadow: var(--shadow);
  padding: 36px 28px; text-align: center;
}
.auth-emoji { font-size: 44px; margin-bottom: 8px; }
.auth-card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-sub { color: var(--ink-soft); font-size: 13px; margin-bottom: 22px; }
.auth-card input {
  width: 100%; padding: 12px 14px; margin-bottom: 12px;
  border: 1.5px solid #F0DCE6; border-radius: 12px;
  font-size: 15px; background: #FFFBF9; outline: none; color: var(--ink);
}
.auth-card input:focus { border-color: var(--pink-deep); }
.auth-error { color: var(--danger); font-size: 13px; min-height: 20px; margin-bottom: 8px; }
.btn-primary {
  width: 100%; padding: 13px; border: none; border-radius: 14px;
  background: linear-gradient(135deg, var(--pink-deep), #F0A3B8);
  color: #fff; font-size: 16px; font-weight: 600; cursor: pointer;
}
.btn-primary:active { opacity: .85; }

/* ===== 顶栏 ===== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 18px 10px;
  background: rgba(253, 247, 242, 0.92); backdrop-filter: blur(10px);
}
.topbar-title { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; }
.logo-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #FFB7CC, var(--pink-deep));
}
.icon-btn {
  border: none; background: var(--card); font-size: 17px;
  width: 36px; height: 36px; border-radius: 12px;
  box-shadow: var(--shadow); cursor: pointer;
}

/* ===== 主体 ===== */
#content { padding: 6px 16px calc(90px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }

.section-title {
  font-size: 16px; font-weight: 700; margin: 18px 2px 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.section-title .link {
  font-size: 13px; font-weight: 500; color: var(--lavender-deep); cursor: pointer;
}

/* 问候卡 */
.greet {
  border-radius: var(--radius); padding: 16px 18px; margin-top: 4px;
  background: linear-gradient(135deg, var(--pink), var(--peach));
  color: #7A4B57; box-shadow: var(--shadow);
}
.greet h2 { font-size: 18px; margin-bottom: 2px; }
.greet p { font-size: 13px; opacity: .85; }
.greet-stats { display: flex; gap: 10px; margin-top: 12px; }
.greet-stat {
  flex: 1; background: rgba(255,255,255,.65); border-radius: 12px;
  padding: 8px 10px; text-align: center;
}
.greet-stat b { display: block; font-size: 20px; }
.greet-stat span { font-size: 11px; }

/* 卡片 */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 12px;
}

/* 固定事务行 */
.task-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px dashed #F2E6EC; }
.task-row:last-child { border-bottom: none; }
.task-check {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid #EBD8E0;
  background: #fff; font-size: 14px; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: transparent;
}
.task-check.done { background: var(--mint); border-color: var(--mint-deep); color: var(--mint-deep); }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 600; font-size: 14.5px; }
.task-title.overdue { color: var(--danger); }
.task-title.done-text { color: var(--ink-soft); text-decoration: line-through; }
.task-meta { font-size: 12px; color: var(--ink-soft); margin-top: 1px; }
.chip {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.chip-pink   { background: var(--pink);     color: var(--pink-deep); }
.chip-mint   { background: var(--mint);     color: var(--mint-deep); }
.chip-lav    { background: var(--lavender); color: var(--lavender-deep); }
.chip-butter { background: var(--butter);   color: var(--butter-deep); }
.chip-sky    { background: var(--sky);      color: var(--sky-deep); }
.chip-peach  { background: var(--peach);    color: var(--peach-deep); }
.chip-danger { background: #FBDDE1; color: var(--danger); }

/* 月份切换 */
.month-nav { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; }
.month-nav button {
  border: none; width: 32px; height: 32px; border-radius: 10px;
  background: var(--card); box-shadow: var(--shadow); cursor: pointer; font-size: 14px;
}
.month-nav .month-label { font-weight: 700; font-size: 15px; flex: 1; text-align: center; }

/* 空状态 */
.empty { text-align: center; color: var(--ink-soft); font-size: 13px; padding: 26px 0; }
.empty .big { font-size: 30px; display: block; margin-bottom: 6px; }

/* 项目时间线 */
.proj-head { display: flex; align-items: center; gap: 10px; }
.proj-head .p-name { font-weight: 700; font-size: 15px; flex: 1; }
.proj-note { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.timeline { margin-top: 12px; padding-left: 16px; border-left: 2px solid var(--lavender); }
.tl-item { position: relative; padding: 0 0 12px 14px; }
.tl-item::before {
  content: ""; position: absolute; left: -21px; top: 5px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--lavender-deep);
}
.tl-date { font-size: 11px; color: var(--ink-soft); }
.tl-text { font-size: 13.5px; margin-top: 1px; white-space: pre-wrap; word-break: break-word; }
.add-line { display: flex; gap: 8px; margin-top: 10px; }
.add-line input, .sheet-body input[type=text], .sheet-body input[type=number],
.sheet-body input[type=date], .sheet-body textarea, .sheet-body select {
  width: 100%; padding: 10px 12px; border: 1.5px solid #F0DCE6; border-radius: 12px;
  font-size: 14px; background: #FFFBF9; outline: none; color: var(--ink);
  font-family: inherit; margin-bottom: 10px;
}
.add-line input:focus, .sheet-body input:focus, .sheet-body textarea:focus { border-color: var(--lavender-deep); }
.add-line input { flex: 1; margin-bottom: 0; }
.btn-mini {
  border: none; border-radius: 12px; padding: 0 16px; cursor: pointer;
  background: var(--lavender); color: var(--lavender-deep); font-weight: 600; font-size: 14px;
}
.btn-mini:active { opacity: .8; }
.btn-del { background: none; border: none; color: var(--ink-soft); font-size: 13px; cursor: pointer; }
.form-row { display: flex; gap: 10px; }
.form-row > * { flex: 1; }

/* 记录页统计 */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.stat-cell {
  border-radius: var(--radius); padding: 12px 8px; text-align: center; box-shadow: var(--shadow);
}
.stat-cell b { display: block; font-size: 20px; }
.stat-cell span { font-size: 11px; opacity: .8; }
.sc-pink { background: var(--pink); color: #8A4A5C; }
.sc-mint { background: var(--mint); color: #37775C; }
.sc-sky  { background: var(--sky); color: #3E6C96; }
.bar-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 12.5px; }
.bar-label { width: 58px; flex-shrink: 0; text-align: right; color: var(--ink-soft); }
.bar-track { flex: 1; height: 10px; border-radius: 999px; background: #F6ECF1; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; }
.log-date { font-size: 12px; color: var(--ink-soft); margin: 14px 2px 6px; font-weight: 600; }
.log-content { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.log-foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; }

/* 灵感 */
.idea-input-wrap { margin-bottom: 14px; }
.idea-input-wrap textarea { min-height: 70px; resize: vertical; }
.idea-card { display: flex; gap: 10px; align-items: flex-start; }
.idea-card .i-text { flex: 1; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.idea-card.archived { opacity: .55; }
.idea-acts { display: flex; flex-direction: column; gap: 6px; }

/* 悬浮添加按钮 */
.fab {
  position: fixed; right: 20px; bottom: calc(84px + env(safe-area-inset-bottom));
  width: 52px; height: 52px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, var(--lavender-deep), #B3A7EC);
  color: #fff; font-size: 26px; cursor: pointer; z-index: 15;
  box-shadow: 0 8px 20px rgba(138, 128, 214, .4);
}
.fab:active { transform: scale(.94); }

/* 底部导航 */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 253, 251, 0.95); backdrop-filter: blur(12px);
  border-top: 1px solid #F5E6EE;
}
.tab {
  border: none; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  font-size: 11px; color: var(--ink-soft); padding: 4px 14px; border-radius: 12px;
}
.tab-ico { font-size: 20px; filter: grayscale(1) opacity(.55); }
.tab.active { color: var(--pink-deep); font-weight: 700; }
.tab.active .tab-ico { filter: none; }

/* 弹层 */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(90, 70, 85, .35); backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: 100%; max-width: 640px; max-height: 86dvh; overflow-y: auto;
  background: var(--bg); border-radius: 24px 24px 0 0; padding: 18px 20px calc(26px + env(safe-area-inset-bottom));
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head h2 { font-size: 17px; }
.sheet-body label { display: block; font-size: 12.5px; color: var(--ink-soft); margin: 4px 0 5px; }
.btn-block {
  width: 100%; padding: 12px; margin-top: 8px; border: none; border-radius: 13px;
  background: linear-gradient(135deg, var(--mint-deep), #8CD4B2);
  color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn-ghost {
  width: 100%; padding: 12px; margin-top: 10px; border: none; border-radius: 13px;
  background: var(--card); color: var(--danger); font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow);
}
.set-group { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px 16px; margin-bottom: 14px; }
.set-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px dashed #F2E6EC; font-size: 14px; }
.set-row:last-child { border-bottom: none; }
.set-row .grow { flex: 1; }

/* 银行分组标题 */
.bank-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 700; color: var(--ink);
  margin: 16px 2px 8px; padding-left: 10px;
  border-left: 4px solid var(--butter-deep); line-height: 1.4;
}
.bank-count { font-size: 11px; font-weight: 500; color: var(--ink-soft); }

/* 全年完成率统计 */
.stat-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.stats-table { border-collapse: collapse; width: 100%; min-width: 500px; font-size: 11px; }
.stats-table th, .stats-table td { border: 1px solid #F3E4EC; text-align: center; padding: 6px 3px; }
.stats-table th { background: #FFF8FB; font-weight: 600; }
.stats-table th:first-child, .stats-table td:first-child {
  text-align: left; padding-left: 8px; max-width: 118px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px;
}
.st-done { background: var(--mint); color: var(--mint-deep); font-weight: 700; }
.st-miss { background: #FBDDE1; color: var(--danger); font-weight: 700; }
.st-na { color: #D8CCD4; }
.rate-col { font-weight: 700; color: var(--lavender-deep); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 99;
  background: rgba(92, 82, 102, .92); color: #fff;
  padding: 9px 18px; border-radius: 999px; font-size: 13px;
  animation: fadein .2s ease;
}
@keyframes fadein { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (min-width: 640px) {
  .overlay { align-items: center; }
  .sheet { border-radius: 24px; padding-bottom: 26px; }
}
