/* ===== 本地自托管字体（不依赖外部网络，任何设备稳定显示飘逸效果） ===== */
@font-face {
  font-family: "Zhi Mang Xing";
  src: url("fonts/zhi-mang-xing.woff2?v=2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Great Vibes";
  src: url("fonts/great-vibes.woff2?v=2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Quicksand";
  src: url("fonts/quicksand-400.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "Quicksand";
  src: url("fonts/quicksand-500.woff2") format("woff2");
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: "Quicksand";
  src: url("fonts/quicksand-600.woff2") format("woff2");
  font-weight: 600; font-display: swap;
}

:root {
  /* 更柔、更淡的低饱和配色 */
  --bg: #F6F2EC;
  --surface: #FFFFFF;
  --primary: #BCD6C6;
  --primary-d: #A8C8B6;
  --primary-soft: #ECF3EE;
  --accent: #F2CEC0;
  --accent-soft: #FBF0EB;
  --ink: #6F7E73;
  --muted: #AAB2AC;
  --line: #ECE7DE;
  /* 大圆角 + 柔影，去掉硬边 */
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 8px 24px rgba(150, 178, 162, 0.16);
  --shadow-sm: 0 3px 12px rgba(150, 178, 162, 0.12);
  --shadow-hover: 0 12px 30px rgba(150, 178, 162, 0.22);
  /* 圆润、非等宽、轻盈的字形 */
  --font: "Quicksand", ui-rounded, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  /* 品牌标题：衬线中文 + 意大利斜体英文 */
  --font-serif: "Songti SC", "STSong", serif;
  --font-display: Georgia, "Times New Roman", serif;
  /* 飘逸标题：中文行书 + 英文手写花体 */
  --font-serif-flow: "Zhi Mang Xing", var(--font-serif), "STXingkai", "KaiTi", serif;
  --font-display-flow: "Great Vibes", var(--font-display), cursive;
  --accent-d: #E2A488;
  --ink-strong: #5C6B61;
  /* 记账语义色：收入=柔绿，支出=陶色 */
  --income-ink: #4A7A61;
  --expense-ink: #A9613C;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: linear-gradient(165deg, #FAF7F2 0%, #F2EDE5 100%);
  color: var(--ink);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.2px;
}
/* 柔和的色块背景，营造随性轻松感 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(42% 36% at 10% 6%, rgba(188,214,198,0.38), transparent 70%),
    radial-gradient(40% 34% at 90% 20%, rgba(242,206,192,0.34), transparent 70%),
    radial-gradient(46% 40% at 72% 96%, rgba(206,216,232,0.28), transparent 70%);
}
/* 极淡的点状纹理，增加设计感而不喧宾夺主 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='2' cy='2' r='1.1' fill='%237a8a7e' fill-opacity='0.07'/%3E%3C/svg%3E");
  background-size: 24px 24px;
}
.hidden { display: none !important; }
button { font-family: var(--font); cursor: pointer; transition: all .22s ease; }

/* ---------- 登录 ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 340px;
  max-width: 100%;
  background: var(--surface);
  border: none;
  border-radius: var(--radius);
  padding: 34px 28px;
  box-shadow: var(--shadow);
}
.auth-logo {
  font-family: var(--font-serif-flow);
  font-size: 80px;
  font-weight: 400;
  text-align: center;
  letter-spacing: 8px;
  padding-left: 8px; /* 平衡末字后的字距，保持视觉居中 */
  color: var(--ink-strong);
  line-height: 1.25;
}
.auth-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 300;
  margin: 12px 0 24px;
  letter-spacing: 2px;
}
.auth-sub::before, .auth-sub::after {
  content: '';
  flex-shrink: 0;
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #D8D2C6 40%, #D8D2C6 60%, transparent);
}
.tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.tab {
  flex: 1;
  background: var(--bg);
  border: none;
  border-radius: 999px;
  padding: 9px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
.tab.active { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.auth-card input {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  transition: all .22s ease;
}
.auth-card input:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: var(--shadow-sm); }
.auth-msg { color: var(--accent); font-size: 12px; min-height: 16px; margin-bottom: 8px; text-align: center; }
.auth-msg.err { color: #C25B6B; font-weight: 600; font-size: 13px; }
.btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--primary);
  border: none;
  border-radius: 999px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 3px;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--primary-d); box-shadow: var(--shadow); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  padding: 7px 16px;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary-d); }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 190px;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(6px);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 26px 16px;
  flex-shrink: 0;
}
.brand {
  font-family: var(--font-serif-flow);
  font-size: 40px;
  font-weight: 400;
  letter-spacing: 6px;
  padding-left: 6px;
  text-align: center;
  margin-bottom: 28px;
  color: var(--ink-strong);
}
.sidebar nav { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.nav-item {
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  text-align: left;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
}
.nav-item:hover { background: var(--primary-soft); }
.nav-item.active {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.side-foot { border-top: 1px solid var(--line); padding-top: 14px; }
.side-name { font-size: 13px; color: var(--ink); font-weight: 600; margin-bottom: 2px; cursor: pointer; }
.side-name:hover { color: var(--primary-d); }
.side-name.placeholder { color: var(--muted); font-weight: 400; font-style: italic; }
.side-name::after {
  content: " \270F";
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 2px;
}
.side-name:hover::after { color: var(--primary-d); }
.side-name:has(input)::after { content: none; }
.side-name .name-edit {
  font: inherit; font-weight: 600; color: var(--ink);
  background: var(--primary-soft); border: 1px solid var(--primary); border-radius: 8px;
  padding: 2px 6px; width: 100%; outline: none;
}
.side-mail { font-size: 11px; color: var(--muted); margin-bottom: 10px; word-break: break-all; font-weight: 300; }

.content { flex: 1; padding: 30px; overflow-y: auto; }
.view { max-width: 720px; margin: 0 auto; }

.bottom-nav { display: none; }

/* ---------- 通用卡片 ---------- */
.card {
  background: var(--surface);
  border: none;
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  transition: box-shadow .25s ease, transform .25s ease;
}
.card:hover { box-shadow: var(--shadow-hover); }
.card.accent { background: linear-gradient(160deg, #fff 0%, var(--accent-soft) 100%); }
.card-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 14px;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.greeting { font-size: 24px; font-weight: 600; margin: 6px 0 22px; letter-spacing: 1px; }
.muted { color: var(--muted); font-size: 13px; font-weight: 300; }

/* ---------- 表单 ---------- */
.row { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.row input[type="text"], .row input[type="number"], .row input[type="date"], .row input[type="time"], textarea {
  flex: 1;
  min-width: 120px;
  padding: 11px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  transition: all .22s ease;
}
textarea { width: 100%; min-height: 72px; resize: vertical; }
/* 金额框：去掉浏览器原生上下箭头，与其它输入框视觉统一 */
.row input[type="number"]::-webkit-outer-spin-button,
.row input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.row input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.row input:focus, textarea:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: var(--shadow-sm); }
.btn-sm {
  background: var(--primary);
  border: none;
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 11px 20px;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.btn-sm:hover { background: var(--primary-d); transform: translateY(-1px); }
.btn-sm.accent { background: var(--accent); }
.btn-del {
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  font-size: 12px;
  padding: 5px 12px;
}
.btn-del:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 待办 ---------- */
.task {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}
.task:last-child { border-bottom: none; }
.checkbox {
  width: 22px; height: 22px;
  border: 2px solid var(--primary);
  border-radius: 8px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px;
  transition: all .2s ease;
}
.task.done .checkbox { background: var(--primary); }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-title { flex: 1; font-size: 14px; font-weight: 400; }
.task-due { font-size: 11px; color: var(--muted); font-weight: 300; }
.task-due.over { color: var(--accent); font-weight: 500; }

/* ---------- 日历 ---------- */
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.cal-head button { background: var(--bg); border: none; border-radius: 999px; padding: 6px 16px; color: var(--ink); font-weight: 500; box-shadow: var(--shadow-sm); }
.cal-head button:hover { background: var(--primary-soft); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-dow { text-align: center; font-size: 12px; color: var(--muted); padding: 6px 0; font-weight: 500; }
.cal-cell {
  aspect-ratio: 1 / 1;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 14px; position: relative;
  background: var(--bg);
  font-weight: 400;
  transition: all .2s ease;
}
.cal-cell.empty { border: none; background: transparent; }
.cal-cell:hover { background: var(--primary-soft); }
.cal-cell.today { background: var(--primary-soft); color: var(--primary-d); font-weight: 600; }
.cal-cell.sel { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.cal-dot { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; margin-top: 4px; }

/* ---------- 心情 ---------- */
.mood-faces { display: flex; gap: 12px; margin: 12px 0; flex-wrap: wrap; }
.mood-face {
  min-width: 54px; height: 62px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  background: var(--bg);
  transition: all .2s ease;
}
.mf-num { font-size: 18px; font-weight: 600; color: var(--ink); line-height: 1; }
.mf-cap { font-size: 10px; color: var(--muted); font-weight: 400; }
.mood-face:hover { background: var(--primary-soft); transform: translateY(-2px); }
.mood-face.sel { border-color: var(--primary); background: var(--primary-soft); box-shadow: var(--shadow-sm); }
.mood-face.sel .mf-num, .mood-face.sel .mf-cap { color: var(--primary-d); }
.mood-hist { display: flex; flex-direction: column; gap: 10px; }
.mood-row { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; }
.mood-row .date { color: var(--muted); font-size: 12px; min-width: 86px; font-weight: 300; }

/* ---------- 想法 / 媒体 ---------- */
.note { padding: 14px 4px; border-bottom: 1px solid var(--line); }
.note:last-child { border-bottom: none; }
.note-text { font-size: 14px; font-weight: 400; white-space: pre-wrap; word-break: break-word; margin-bottom: 8px; line-height: 1.8; }
.note-meta { font-size: 11px; color: var(--muted); font-weight: 300; }
.note img { max-width: 100%; border-radius: var(--radius-sm); margin-top: 8px; display: block; box-shadow: var(--shadow-sm); }
.note audio { width: 100%; margin-top: 8px; }
.media-bar { display: flex; gap: 10px; margin: 10px 0; flex-wrap: wrap; }
.attach { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); border: 1.5px solid var(--primary); border-radius: 999px; padding: 8px 14px; background: var(--bg); font-weight: 500; transition: all .2s ease; }
.attach:hover { background: var(--primary-soft); }
.attach input { display: none; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); display: inline-block; }
.recording { background: var(--accent) !important; color: #fff !important; border-color: var(--accent) !important; }
.preview-img { max-width: 130px; border-radius: var(--radius-sm); margin-top: 8px; box-shadow: var(--shadow-sm); }

/* ---------- 提醒条 ---------- */
.reminder {
  background: linear-gradient(135deg, var(--accent) 0%, #F4D8CC 100%);
  color: #7a5a4d;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

/* ---------- 响应式：手机 ---------- */
@media (max-width: 720px) {
  .sidebar { display: none; }
  .content { padding: 18px 16px 90px; }
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--line);
    z-index: 10;
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav .nav-item {
    flex: 1; text-align: center; border: none; border-radius: 999px;
    font-size: 12px; padding: 8px 0; color: var(--muted); font-weight: 500;
  }
  .bottom-nav .nav-item.active { background: var(--primary-soft); color: var(--primary-d); }
  .greeting { font-size: 21px; }
  .auth-logo { font-size: 62px; letter-spacing: 6px; padding-left: 6px; }
  .logo-en { font-size: 22px; }
  /* 手机端放大：登录页与主界面均不再偏小 */
  .auth-card { padding: 40px 26px; }
  .auth-card input { font-size: 16px; padding: 14px 18px; margin-bottom: 16px; }
  .btn-primary { font-size: 16px; padding: 15px; min-height: 50px; }
  .tabs .tab { font-size: 15px; padding: 11px; }
  .auth-sub { font-size: 14px; }
  .content { font-size: 15px; line-height: 1.7; }
  .card { padding: 20px 18px; }
  .greeting { font-size: 23px; }
  .task-title, .note-text, .mood-row { font-size: 15px; }
  .attach, .mood-save, .note-add, .cal-add { min-height: 46px; font-size: 15px; }
}

/* ---------- 此间 品牌 / 模块副标题 / 概览卡 ---------- */
.logo-en, .brand-en {
  font-family: var(--font-display-flow);
  font-style: normal;
  font-weight: 400;
  color: var(--accent-d);
  letter-spacing: 1px;
}
.logo-en { font-size: 26px; margin-left: 10px; vertical-align: 2px; }
.brand-en { font-size: 16px; margin-left: 6px; vertical-align: 2px; }
.nav-en { font-size: 11px; opacity: .55; margin-left: 5px; font-weight: 400; letter-spacing: .5px; }
.sub { color: var(--muted); font-size: 13px; font-weight: 300; margin: 0 0 16px; line-height: 1.7; }
.sub-center { text-align: center; margin: -10px 0 18px; }
.en-sub { display: inline-block; margin-top: 3px; opacity: .65; font-size: 12px; letter-spacing: .3px; font-style: italic; }
.overview { cursor: pointer; }
.overview:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.remind-chk { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 13px; color: var(--ink); cursor: pointer; user-select: none; }
.remind-chk input { width: 15px; height: 15px; accent-color: var(--primary); }
.remind-badge { font-size: 10px; color: var(--primary-d); background: var(--primary-soft); border-radius: 999px; padding: 2px 8px; font-weight: 500; }

/* ---------- 涓流（记账） ---------- */
.seg { display: inline-flex; background: var(--bg); border-radius: 999px; padding: 4px; margin-bottom: 14px; gap: 4px; }
.seg-btn { border: none; background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; padding: 8px 22px; border-radius: 999px; cursor: pointer; transition: all .2s ease; font-family: var(--font); }
.seg-btn.active { background: var(--accent); color: var(--expense-ink); box-shadow: var(--shadow-sm); }
.seg-btn.active[data-type="income"] { background: var(--primary); color: var(--income-ink); }
.seg-btn[data-type="expense"]:not(.active):hover { color: var(--expense-ink); }
.seg-btn[data-type="income"]:not(.active):hover { color: var(--income-ink); }
/* 记一笔按钮跟随当前类型：支出=陶色，收入=柔绿 */
.ledger-add.is-expense { background: var(--accent); color: var(--expense-ink); }
.ledger-add.is-expense:hover { background: var(--accent-d); }
.ledger-add.is-income { background: var(--primary); color: var(--income-ink); }
.ledger-add.is-income:hover { background: var(--primary-d); }
.ledger-summary { display: flex; gap: 10px; margin-top: 6px; }
.ls-item { flex: 1; text-align: center; padding: 12px 6px; background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.ls-num { font-size: 19px; font-weight: 600; margin-bottom: 4px; }
.ls-num.income { color: var(--primary-d); }
.ls-num.expense { color: var(--accent-d); }
.ls-num.balance { color: var(--ink-strong); }
.ls-lab { font-size: 12px; color: var(--muted); font-weight: 400; }
.cat-bars { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.cat-bar-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink); margin-bottom: 5px; }
.cat-bar-track { height: 9px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.cat-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent) 0%, var(--accent-d) 100%); border-radius: 999px; }
.ledger-row { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 10px; padding: 13px 2px; border-bottom: 1px solid var(--line); }
.ledger-row:last-child { border-bottom: none; }
.lr-main { min-width: 0; }
.lr-cat { font-size: 14px; color: var(--ink-strong); font-weight: 500; }
.lr-note { font-size: 12px; color: var(--muted); font-weight: 300; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lr-amt { font-size: 15px; font-weight: 600; white-space: nowrap; }
.lr-amt.income { color: var(--primary-d); }
.lr-amt.expense { color: var(--ink); }
.lr-meta { font-size: 11px; color: var(--muted); white-space: nowrap; }
