@font-face {
  font-family: "Moyang Kai";
  src: local("KaiTi"), local("STKaiti"), local("Kaiti SC"), local("Kaiti TC");
  font-weight: normal;
}

:root {
  --paper: #faf8f3;
  --paper-2: #f3efe6;
  --ink: #33302b;
  --ink-soft: #857c6e;
  --ink-faint: #a89e8f;
  --line: #e9e3d6;
  --blue: #d6e6f5;
  --blue-deep: #3570a8;
  --orange: #fbe3cc;
  --orange-deep: #b3712c;
  --yellow: #fff3c4;
  --green: #dff0dc;
  --pink: #fbe0e2;
  --shadow: 6px 8px 16px rgba(90, 74, 46, .10);
  --shadow-lift: 10px 14px 26px rgba(90, 74, 46, .16);
  --radius: 12px;
  --hand: "Moyang Kai", "LXGW WenKai", "KaiTi", "STKaiti", "楷体", serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 27px,
    rgba(120, 100, 70, .045) 27px,
    rgba(120, 100, 70, .045) 28px
  );
  color: var(--ink);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.7;
}

body { padding-bottom: 72px; }

/* ---------- 顶部导航 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: rgba(250, 248, 243, .94);
  backdrop-filter: blur(6px);
  border-bottom: 1px dashed rgba(120, 100, 70, .18);
}
.topbar h1 {
  margin: 0;
  font-family: var(--hand);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 3px;
}
.topbar .sub { display: none; }
.topbar .spacer { flex: 1; }

.icon-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 4px 9px;
  font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
}
.bell { position: relative; font-size: 16px; }
.bell.has::after {
  content: "";
  position: absolute;
  top: 2px; right: 4px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #e2563f;
}

/* ---------- 待办条 ---------- */
.todo-wrap { padding: 10px 16px 0; max-width: 720px; margin: 0 auto; }
.todo-bar {
  display: inline-block;
  padding: 7px 13px;
  border-radius: 8px;
  background: var(--yellow);
  box-shadow: 3px 4px 8px rgba(120, 100, 60, .10);
  font-size: 12.5px;
  color: #7a6220;
  transform: rotate(-.4deg);
}

/* ---------- 筛选胶囊（便签夹） ---------- */
.chips {
  display: flex;
  gap: 10px;
  padding: 12px 16px 4px;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 720px;
  margin: 0 auto;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 4px 14px;
  border-radius: 7px 7px 9px 9px;
  border: none;
  box-shadow: 2px 3px 6px rgba(90, 74, 46, .10);
  background: #fff;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: var(--hand);
}
.chip.on {
  background: var(--ink);
  color: #faf8f3;
  transform: translateY(-1px);
}

/* ---------- 主区 ---------- */
.view { padding: 14px 16px 30px; max-width: 720px; margin: 0 auto; }

/* ---------- 便利贴卡片 ---------- */
.card {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 15px 13px;
  margin-bottom: 16px;
  transition: transform .16s ease, box-shadow .16s ease;
}
.card:active { transform: translateY(-2px); box-shadow: var(--shadow-lift); }

.card.mine { background: var(--blue); }
.card.theirs { background: var(--orange); }
.card.plain { background: #fff; }

.card.tilt-l { transform: rotate(-.7deg); }
.card.tilt-r { transform: rotate(.6deg); }

/* 图钉 */
.card.pin::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  margin-left: -5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e35f4b, #b23a28 70%);
  box-shadow: 0 2px 3px rgba(80, 30, 20, .35);
  z-index: 2;
}
/* 胶带 */
.card.tape::after {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  margin-left: -26px;
  width: 52px;
  height: 16px;
  background: rgba(214, 200, 170, .45);
  border-left: 1px dashed rgba(255, 255, 255, .5);
  border-right: 1px dashed rgba(255, 255, 255, .5);
  transform: rotate(-1.2deg);
  z-index: 2;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 7px;
}
.avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-family: var(--hand);
  background: #fff;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1.5px rgba(120, 100, 70, .15);
}
.avatar.b { border-color: var(--blue-deep); color: var(--blue-deep); }
.avatar.o { border-color: var(--orange-deep); color: var(--orange-deep); }

.card h2 {
  margin: 2px 0 6px;
  font-family: var(--hand);
  font-size: 17.5px;
  font-weight: 700;
  line-height: 1.45;
}
.card .body {
  color: #3b362f;
  font-size: 14.5px;
  white-space: pre-wrap;
  word-break: break-word;
}
.card .body.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-soft);
}
.tag {
  padding: 1px 8px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .75);
  color: #7a6f5f;
  font-size: 11px;
  font-family: var(--hand);
  box-shadow: 1px 1px 2px rgba(90, 74, 46, .08);
}
.link-mark {
  padding: 1px 8px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .6);
  color: var(--blue-deep);
  font-size: 11px;
}
.hl {
  background: linear-gradient(transparent 58%, rgba(255, 233, 120, .85) 58%);
  padding: 0 1px;
}

.empty {
  text-align: center;
  color: var(--ink-faint);
  font-size: 13px;
  padding: 56px 20px;
  line-height: 2;
  font-family: var(--hand);
}

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: flex;
  height: 56px;
  background: rgba(250, 248, 243, .97);
  backdrop-filter: blur(8px);
  border-top: 1px dashed rgba(120, 100, 70, .2);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1;
  text-align: center;
  padding: 6px 0 0;
  font-size: 11px;
  color: var(--ink-faint);
  cursor: pointer;
  font-family: var(--hand);
}
.tab .ico { display: block; font-size: 18px; line-height: 1.25; }
.tab.on { color: var(--ink); font-weight: 700; }

/* ---------- FAB（像一枚图钉） ---------- */
.fab {
  position: fixed;
  right: 18px;
  bottom: 76px;
  z-index: 40;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 34% 28%, #ff8f74, #d64a32 58%, #a83321);
  color: #fff;
  font-size: 25px;
  line-height: 1;
  box-shadow: 0 4px 8px rgba(120, 40, 25, .35), inset 0 -3px 6px rgba(0, 0, 0, .18);
  cursor: pointer;
}
.fab:active { transform: scale(.94); }

/* ---------- 弹层 ---------- */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(60, 50, 35, .32);
  z-index: 50;
  display: none;
}
.mask.on { display: block; }
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  max-height: 86vh;
  overflow-y: auto;
  transform: translateY(102%);
  transition: transform .23s ease;
  background-image: repeating-linear-gradient(0deg, transparent 0 27px, rgba(120,100,70,.05) 27px 28px);
}
.sheet.on { transform: translateY(0); }
.sheet h3 {
  margin: 0 0 14px;
  font-family: var(--hand);
  font-size: 18px;
}

input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
  margin-bottom: 10px;
}
textarea { min-height: 160px; resize: vertical; line-height: 1.75; }
input:focus, textarea:focus { border-color: #c8bda6; box-shadow: 0 0 0 3px rgba(200, 189, 166, .18); }

.btn {
  width: 100%;
  border: none;
  border-radius: 9px;
  padding: 12px;
  font: inherit;
  font-weight: 600;
  background: var(--ink);
  color: #faf8f3;
  cursor: pointer;
}
.btn.ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  font-weight: 400;
}
.btn:active { opacity: .84; }

.row { display: flex; gap: 10px; }

/* ---------- 统计 ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.stat {
  background: #fff;
  border-radius: 10px;
  padding: 13px 8px;
  text-align: center;
  box-shadow: 3px 4px 9px rgba(90, 74, 46, .09);
}
.stat b { display: block; font-size: 19px; font-weight: 700; font-family: var(--hand); }
.stat span { font-size: 11px; color: var(--ink-soft); }

.section-title {
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 1px;
  margin: 20px 0 9px;
  font-family: var(--hand);
}

/* ---------- 详情页 ---------- */
.detail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.back {
  border: none;
  background: none;
  font-size: 18px;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0 4px;
}
.detail-body {
  font-size: 15px;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
}
.comment {
  background: #fff;
  border-radius: 9px;
  padding: 11px 12px;
  margin-bottom: 10px;
  box-shadow: 2px 3px 7px rgba(90, 74, 46, .07);
}
.comment-mini { font-size: 12px; color: var(--ink-soft); }

/* ---------- 子 tab ---------- */
.seg { display: flex; gap: 4px; padding: 0 0 12px; }
.seg button {
  flex: 1; padding: 7px 0; border: none; background: none; font: inherit;
  font-size: 13px; color: #857c6e; border-bottom: 2px solid transparent;
  font-family: var(--hand); cursor: pointer;
}
.seg button.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 700; }

/* ---------- 热力图 ---------- */
.heat { display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; }
.heat i { display: block; padding-top: 100%; border-radius: 3px; background: #eee7d9; }
.heat i.l1 { background: #fdf0cf; }
.heat i.l2 { background: #f8d79a; }
.heat i.l3 { background: #efb268; }
.heat i.l4 { background: #d47b3c; }
.heat-legend { display: flex; gap: 10px; font-size: 11px; color: #a89e8f; margin-top: 8px; }

/* ---------- 划线批注 ---------- */
.quote-block {
  border-left: 3px solid #f2c94c;
  background: linear-gradient(transparent 56%, rgba(255, 233, 120, .5) 56%);
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 14px;
  margin-bottom: 8px;
  line-height: 1.7;
}

/* ---------- 状态徽章 ---------- */
.badge {
  font-size: 11px; padding: 1px 8px; border-radius: 999px;
  border: 1px solid #ddd3c0; color: #7a6f5f; background: #fff;
}
.badge.ok { background: #e6f2e0; border-color: #cfe6c7; color: #4b7a3c; }
.badge.warn { background: #fdf0d9; border-color: #f0ddb4; color: #8a6420; }

/* ---------- 列表行 ---------- */
.row-item {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border-radius: 10px; padding: 11px 12px;
  margin-bottom: 9px; box-shadow: 2px 3px 7px rgba(90, 74, 46, .07);
}
.row-item .main { flex: 1; min-width: 0; }
.row-item .t { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-item .m { font-size: 11px; color: #a89e8f; margin-top: 3px; }
.mini-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 5px 10px; font-size: 12px; color: var(--ink-soft); cursor: pointer;
}

/* ---------- 月份卡 ---------- */
.month-card {
  background: #fff; border-radius: 12px; padding: 13px 14px;
  margin-bottom: 10px; box-shadow: var(--shadow);
}
.month-card .h { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; }
.month-card .h b { font-family: var(--hand); }
.month-card .kw { margin-top: 4px; }
.month-card .hl { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }

/* ---------- 快捷标签 ---------- */
.tagpick { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.tagpick button {
  border: 1px dashed #d8cfbd; background: #fff; border-radius: 999px;
  padding: 3px 11px; font-size: 12px; color: #7a6f5f; cursor: pointer;
}
.tagpick button.on { background: #fdf0d9; border-style: solid; border-color: #f0ddb4; color: #8a6420; }

/* ---------- 浮动划线按钮 ---------- */
.sel-btn {
  position: fixed; z-index: 70; transform: translate(-50%, -120%);
  background: var(--ink); color: #faf8f3; border: none; border-radius: 999px;
  padding: 7px 15px; font-size: 13px; box-shadow: 0 6px 14px rgba(40, 30, 20, .25);
  display: none;
}
.sel-btn.on { display: block; }

/* ---------- 资料卡 ---------- */
.profile-head {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border-radius: 14px; padding: 16px;
  box-shadow: var(--shadow); margin-bottom: 12px;
}
.profile-head .big {
  width: 58px; height: 58px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-family: var(--hand);
  font-size: 22px; background: var(--orange); border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(120, 100, 70, .12);
}
.profile-head .name { font-family: var(--hand); font-size: 18px; font-weight: 700; }
.profile-head .desc { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

