:root{
  --blue:#2563eb; --blue-d:#1d4ed8; --bg:#f4f6fb; --card:#fff; --txt:#1e293b;
  --sub:#64748b; --line:#e2e8f0; --green:#16a34a; --red:#dc2626; --amber:#d97706;
  --radius:14px; --shadow:0 1px 3px rgba(15,23,42,.08),0 4px 16px rgba(15,23,42,.05);
  --safe-b:env(safe-area-inset-bottom,0px);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%}
body{font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;
  background:var(--bg);color:var(--txt);font-size:15px;line-height:1.5}
.hidden{display:none!important}
button{font-family:inherit;cursor:pointer;border:none;background:none}
input,select,textarea{font-family:inherit;font-size:15px}

/* 登录 */
.auth-screen{min-height:100%;display:flex;align-items:center;justify-content:center;
  background:linear-gradient(160deg,#2563eb,#1e40af);padding:24px}
.auth-card{background:#fff;border-radius:20px;padding:32px 26px;width:100%;max-width:360px;
  box-shadow:0 20px 60px rgba(0,0,0,.25);text-align:center}
.auth-logo{font-size:52px}
.auth-card h1{margin:6px 0 2px;font-size:24px}
.auth-sub{color:var(--sub);margin:0 0 20px;font-size:13px}
.auth-tabs{display:flex;background:var(--bg);border-radius:10px;padding:4px;margin-bottom:16px}
.auth-tab{flex:1;padding:8px;border-radius:8px;color:var(--sub);font-weight:600}
.auth-tab.active{background:#fff;color:var(--blue);box-shadow:var(--shadow)}
.inp{width:100%;padding:12px 14px;border:1px solid var(--line);border-radius:10px;margin-bottom:12px;outline:none}
.inp:focus{border-color:var(--blue)}
.btn-primary{width:100%;padding:13px;background:var(--blue);color:#fff;border-radius:10px;font-weight:600;font-size:16px}
.btn-primary:active{background:var(--blue-d)}
.auth-msg{color:var(--red);font-size:13px;min-height:18px;margin:8px 0 0}
.auth-hint{color:var(--sub);font-size:12px;margin:14px 0 0}

/* 顶栏/底栏 */
#app{min-height:100%;display:flex;flex-direction:column}
.topbar{position:sticky;top:0;z-index:20;background:var(--card);display:flex;align-items:center;
  justify-content:space-between;padding:14px 18px;border-bottom:1px solid var(--line)}
.topbar-title{font-size:19px;font-weight:700}
.topbar-user{width:34px;height:34px;border-radius:50%;background:var(--blue);color:#fff;
  display:flex;align-items:center;justify-content:center;font-weight:700;font-size:15px}
main{flex:1;padding:16px 16px 96px;max-width:640px;width:100%;margin:0 auto}
.tabbar{position:fixed;bottom:0;left:0;right:0;z-index:30;background:var(--card);
  display:flex;border-top:1px solid var(--line);padding-bottom:var(--safe-b)}
.tab{flex:1;padding:8px 0 6px;display:flex;flex-direction:column;align-items:center;gap:2px;
  color:var(--sub);font-size:11px}
.tab-ico{font-size:21px;line-height:1}
.tab.active{color:var(--blue);font-weight:600}
.fab{position:fixed;right:20px;bottom:calc(76px + var(--safe-b));z-index:25;width:56px;height:56px;
  border-radius:50%;background:var(--blue);color:#fff;font-size:30px;line-height:1;
  box-shadow:0 6px 20px rgba(37,99,235,.45);display:flex;align-items:center;justify-content:center}
.fab:active{transform:scale(.94)}

/* 卡片/通用 */
.card{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow);padding:14px 16px;margin-bottom:12px}
.sec-title{font-size:13px;font-weight:700;color:var(--sub);margin:18px 4px 8px;text-transform:uppercase;letter-spacing:.5px}
.empty{text-align:center;color:var(--sub);padding:40px 20px;font-size:14px}
.empty .big{font-size:44px;display:block;margin-bottom:10px}
.row{display:flex;align-items:center;gap:12px}
.grow{flex:1;min-width:0}
.muted{color:var(--sub);font-size:13px}
.chip{display:inline-block;padding:2px 9px;border-radius:20px;font-size:12px;background:var(--bg);color:var(--sub)}
.chip.blue{background:#dbeafe;color:var(--blue)}
.chip.green{background:#dcfce7;color:var(--green)}
.chip.amber{background:#fef3c7;color:var(--amber)}
.chip.red{background:#fee2e2;color:var(--red)}

/* 任务行 */
.task{display:flex;align-items:flex-start;gap:12px;padding:13px 14px;background:var(--card);
  border-radius:var(--radius);box-shadow:var(--shadow);margin-bottom:10px}
.task.done{opacity:.55}
.check{width:24px;height:24px;border-radius:50%;border:2px solid var(--line);flex-shrink:0;margin-top:1px;
  display:flex;align-items:center;justify-content:center;font-size:14px;color:#fff}
.check.on{background:var(--green);border-color:var(--green)}
.task-title{font-weight:600;word-break:break-word}
.task.done .task-title{text-decoration:line-through}
.task-meta{display:flex;flex-wrap:wrap;gap:6px;margin-top:5px;align-items:center}
.prio{width:4px;border-radius:4px;align-self:stretch;flex-shrink:0}
.prio.p5{background:var(--red)} .prio.p3{background:var(--amber)} .prio.p1{background:var(--blue)} .prio.p0{background:var(--line)}

/* 清单 */
.list-item{display:flex;align-items:center;gap:12px;padding:14px 16px;background:var(--card);
  border-radius:var(--radius);box-shadow:var(--shadow);margin-bottom:10px}
.list-dot{width:12px;height:12px;border-radius:50%;flex-shrink:0}
.list-count{margin-left:auto;color:var(--sub);font-size:13px}

/* 日历 */
.cal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.cal-nav{width:36px;height:36px;border-radius:10px;background:var(--card);box-shadow:var(--shadow);font-size:18px}
.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}
.cal-wd{text-align:center;font-size:12px;color:var(--sub);padding:4px 0}
.cal-cell{aspect-ratio:1;background:var(--card);border-radius:10px;display:flex;flex-direction:column;
  align-items:center;justify-content:center;font-size:14px;position:relative;box-shadow:var(--shadow)}
.cal-cell.other{opacity:.35}
.cal-cell.today{background:var(--blue);color:#fff;font-weight:700}
.cal-cell.sel{outline:2px solid var(--blue)}
.cal-dots{display:flex;gap:2px;position:absolute;bottom:4px}
.cal-dot{width:4px;height:4px;border-radius:50%;background:var(--amber)}
.cal-cell.today .cal-dot{background:#fff}
.cal-lunar{font-size:9px;opacity:.7;line-height:1}

/* 习惯 */
.habit{display:flex;align-items:center;gap:12px;padding:14px 16px;background:var(--card);
  border-radius:var(--radius);box-shadow:var(--shadow);margin-bottom:10px}
.habit-ico{font-size:26px;width:44px;height:44px;border-radius:12px;background:var(--bg);
  display:flex;align-items:center;justify-content:center;flex-shrink:0}
.habit-check{width:44px;height:44px;border-radius:50%;border:2px solid var(--line);flex-shrink:0;
  font-size:20px;display:flex;align-items:center;justify-content:center;color:var(--sub)}
.habit-check.on{background:var(--green);border-color:var(--green);color:#fff}
.streak{font-size:12px;color:var(--amber);font-weight:600}

/* 纪念日 */
.anni{display:flex;align-items:center;gap:14px;padding:16px;background:var(--card);
  border-radius:var(--radius);box-shadow:var(--shadow);margin-bottom:10px}
.anni-days{width:60px;height:60px;border-radius:16px;background:linear-gradient(160deg,#f472b6,#db2777);
  color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;flex-shrink:0}
.anni-days .n{font-size:24px;font-weight:800;line-height:1}
.anni-days .u{font-size:11px}
.anni-days.soon{background:linear-gradient(160deg,#fb923c,#ea580c)}

/* 模态 */
.modal-mask{position:fixed;inset:0;z-index:50;background:rgba(15,23,42,.5);display:flex;
  align-items:flex-end;justify-content:center}
.modal{background:var(--card);width:100%;max-width:640px;max-height:88vh;overflow-y:auto;
  border-radius:20px 20px 0 0;padding:20px 18px calc(20px + var(--safe-b));animation:up .22s ease}
@keyframes up{from{transform:translateY(40px);opacity:.6}to{transform:translateY(0);opacity:1}}
.modal h3{margin:0 0 16px;font-size:18px}
.field{margin-bottom:14px}
.field label{display:block;font-size:13px;color:var(--sub);margin-bottom:6px;font-weight:600}
.field .inp,.field select,.field textarea{margin-bottom:0}
textarea.inp{resize:vertical;min-height:64px}
.seg{display:flex;flex-wrap:wrap;gap:8px}
.seg button{padding:8px 14px;border-radius:10px;background:var(--bg);color:var(--sub);font-size:14px}
.seg button.on{background:var(--blue);color:#fff;font-weight:600}
.modal-actions{display:flex;gap:10px;margin-top:20px}
.btn-ghost{flex:1;padding:12px;border-radius:10px;background:var(--bg);color:var(--sub);font-weight:600}
.btn-danger{padding:12px 16px;border-radius:10px;background:#fee2e2;color:var(--red);font-weight:600}
.btn-primary.flex{flex:1}

/* 我的 */
.me-head{display:flex;align-items:center;gap:14px;padding:18px;background:var(--card);
  border-radius:var(--radius);box-shadow:var(--shadow);margin-bottom:14px}
.me-avatar{width:56px;height:56px;border-radius:50%;background:var(--blue);color:#fff;
  display:flex;align-items:center;justify-content:center;font-size:24px;font-weight:700}
.menu-item{display:flex;align-items:center;gap:12px;padding:15px 16px;background:var(--card);
  border-radius:var(--radius);box-shadow:var(--shadow);margin-bottom:10px;width:100%;text-align:left;font-size:15px}
.menu-item .mi-ico{font-size:20px}
.menu-item .mi-arrow{margin-left:auto;color:var(--sub)}
.token-box{font-family:monospace;font-size:12px;background:var(--bg);padding:10px;border-radius:8px;
  word-break:break-all;color:var(--sub)}

/* toast */
.toast{position:fixed;left:50%;bottom:calc(100px + var(--safe-b));transform:translateX(-50%);z-index:99;
  background:rgba(15,23,42,.92);color:#fff;padding:11px 20px;border-radius:24px;font-size:14px;
  max-width:80%;text-align:center;animation:up .2s ease}
@media(min-width:641px){.modal{border-radius:20px;margin-bottom:20px}.modal-mask{align-items:center}}
