/* ============================================================
   一刻 · 样式
   设计基调：暖白纸感、单一强调色、大圆角、留白充足、不用渐变花活
   ============================================================ */

:root {
  --bg: #F6F4F0;
  --bg-deep: #EFEBE5;
  --card: #FFFFFF;
  --text: #1E1B18;
  --text-2: #6D675F;
  --text-3: #A09890;
  --line: #EBE6DF;
  --line-2: #DDD6CD;
  --accent: #E25B34;
  --accent-2: #F0865E;
  --accent-soft: #FCEAE2;
  --danger: #CE4646;
  --danger-soft: #FBEBEB;
  --ok: #3F8F63;
  --shadow-sm: 0 1px 2px rgba(38, 28, 18, .05);
  --shadow-md: 0 10px 30px -14px rgba(38, 28, 18, .25), 0 2px 6px rgba(38, 28, 18, .05);
  --shadow-lg: 0 -18px 50px -20px rgba(38, 28, 18, .35);
  --r-xl: 24px;
  --r-lg: 18px;
  --r-md: 13px;
  --r-sm: 9px;
  --tab-h: 58px;
  --composer-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
          "MiSans", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141312;
    --bg-deep: #0F0E0D;
    --card: #1D1B19;
    --text: #F1EDE7;
    --text-2: #A7A099;
    --text-3: #7B746C;
    --line: #2B2825;
    --line-2: #3A3531;
    --accent: #F0714A;
    --accent-2: #F58E68;
    --accent-soft: #2E1D16;
    --danger: #E06A6A;
    --danger-soft: #2B1A1A;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 10px 30px -14px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .3);
    --shadow-lg: 0 -18px 50px -20px rgba(0, 0, 0, .8);
  }
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
}

body {
  font-family: var(--font);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: 16px;
  color: inherit;
}
button { border: 0; background: none; padding: 0; cursor: pointer; }
input, textarea, select {
  border: 0;
  background: none;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
::selection { background: var(--accent-soft); }

/* ---------- 骨架 ---------- */
#app {
  max-width: 540px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  display: flex;
  flex-direction: column;
}

@media (min-width: 620px) {
  body { background: var(--bg-deep); }
  #app {
    background: var(--bg);
    min-height: 100dvh;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .04), 0 30px 80px -40px rgba(0, 0, 0, .3);
  }
}

.view {
  display: none;
  flex: 1;
  padding: 0 20px;
  padding-top: calc(14px + var(--safe-t));
  padding-bottom: calc(var(--tab-h) + var(--composer-h) + var(--safe-b) + 34px);
}
.view.active { display: block; }

/* ---------- 页头 ---------- */
.page-head { padding: 10px 2px 16px; }
.page-head .eyebrow {
  margin: 0 0 6px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--accent);
  text-transform: none;
}
.page-head h1 {
  margin: 0;
  font-size: 27px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -.015em;
}
.page-head .lede {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--text-3);
}
.head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.progress {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.progress .bar {
  flex: 1;
  height: 5px;
  border-radius: 99px;
  background: var(--bg-deep);
  overflow: hidden;
}
.progress .bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: var(--accent);
  transition: width .4s cubic-bezier(.22, .8, .3, 1);
}
.progress span {
  font-size: 11.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* ---------- 圆形功能按钮 ---------- */
.round-btn {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--card);
  color: var(--text-2);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--line);
  transition: transform .15s, background .15s;
}
.round-btn:active { transform: scale(.93); }
.round-btn.accent { background: var(--accent); color: #fff; box-shadow: 0 6px 16px -6px rgba(226, 91, 52, .7); }
.round-btn svg { width: 19px; height: 19px; }

/* ---------- 分组列表 ---------- */
.section { margin-bottom: 22px; }
.section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px 8px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--text-3);
}
.section-head .count {
  font-weight: 500;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.section-head .grow { flex: 1; }
.section-head.overdue { color: var(--danger); }
.section-head .link {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

/* ---------- 待办 ---------- */
.todo {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px 14px 12px;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .12s ease, opacity .2s;
  position: relative;
}
.todo:active { transform: scale(.985); }

.check {
  flex: none;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1.8px solid var(--line-2);
  background: transparent;
  display: grid;
  place-items: center;
  transition: all .18s;
}
.check::after {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform .18s cubic-bezier(.2, 1.5, .4, 1);
}
.todo.is-done .check { border-color: var(--accent); background: var(--accent); }
.todo.is-done .check::after { display: none; }
.todo.is-done .check svg { opacity: 1; }
.check svg { width: 14px; height: 14px; color: #fff; opacity: 0; transition: opacity .15s; }

.todo-body { flex: 1; min-width: 0; }
.todo-title {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.todo.is-done .todo-title { color: var(--text-3); text-decoration: line-through; }

.todo-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.todo-meta .tm { display: inline-flex; align-items: center; gap: 3px; }
.todo-meta .tm svg { width: 12px; height: 12px; }
.todo-meta .tm.overdue { color: var(--danger); font-weight: 600; }
.todo-meta .flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--bg-deep);
  color: var(--text-2);
  font-size: 11.5px;
}
.todo-meta .flag.hot { background: var(--danger-soft); color: var(--danger); }
.todo-meta .flag.rep { background: var(--accent-soft); color: var(--accent); }
.todo-meta .flag.subs { background: transparent; color: var(--text-3); padding: 0; }

.todo.priority .todo-title::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  margin-right: 7px;
  vertical-align: 2px;
}

.todo.flash { animation: flash .9s ease; }
@keyframes flash {
  0% { box-shadow: 0 0 0 2px var(--accent); }
  100% { box-shadow: var(--shadow-sm); }
}

/* ---------- 空状态 ---------- */
.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--text-3);
}
.empty svg { width: 42px; height: 42px; opacity: .5; margin-bottom: 12px; }
.empty p { margin: 0; font-size: 14px; }
.empty .small { margin-top: 6px; font-size: 12.5px; color: var(--text-3); opacity: .8; }

/* ---------- 灵感 ---------- */
.idea-tools { display: flex; gap: 8px; margin: 4px 0 14px; }
.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  background: var(--card);
  border-radius: 99px;
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--line);
  color: var(--text-3);
}
.search-box svg { width: 16px; height: 16px; flex: none; }
.search-box input { flex: 1; font-size: 14px; color: var(--text); }

.chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  margin: 0 -2px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  height: 31px;
  padding: 0 13px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--card);
  box-shadow: 0 0 0 1px var(--line);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s;
  white-space: nowrap;
}
.chip:active { transform: scale(.96); }
.chip.on { background: var(--text); color: var(--bg); box-shadow: none; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--text-3)); }
.chip .n { font-size: 11.5px; opacity: .55; font-variant-numeric: tabular-nums; }

.idea {
  padding: 14px 16px;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .12s;
}
.idea:active { transform: scale(.985); }
.idea-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.62;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.idea-text .hl { background: var(--accent-soft); color: var(--accent); border-radius: 3px; padding: 0 1px; }
.idea-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-3);
}
.idea-foot .spacer { flex: 1; }
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 23px;
  padding: 0 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--c, var(--text-2));
  background: color-mix(in srgb, var(--c, #999) 12%, transparent);
}
.tag-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--text-3)); }
.tag-pill.none { color: var(--text-3); background: var(--bg-deep); }

.mini {
  height: 27px;
  padding: 0 11px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.mini:active { opacity: .7; }
.mini.gray { color: var(--text-2); background: var(--bg-deep); }
.idea.converted .idea-text { color: var(--text-2); }

/* ---------- 输入条 ---------- */
.composer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--tab-h) + var(--safe-b));
  z-index: 30;
  padding: 8px 16px 8px;
  max-width: 540px;
  margin: 0 auto;
  background: linear-gradient(to top, var(--bg) 62%, transparent);
}
.composer-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 7px 7px 7px 14px;
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow-md), 0 0 0 1px var(--line);
}
.composer-box textarea {
  flex: 1;
  resize: none;
  max-height: 108px;
  padding: 8px 0;
  line-height: 1.45;
  font-size: 15.5px;
  background: transparent;
}
.composer-box textarea::placeholder { color: var(--text-3); }
.circle {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-2);
  transition: all .15s;
}
.circle svg { width: 20px; height: 20px; }
.circle:active { transform: scale(.9); }
.circle.mic.listening { background: var(--accent); color: #fff; animation: pulse 1.4s infinite; }
.circle.send {
  background: var(--accent);
  color: #fff;
  opacity: .35;
  pointer-events: none;
  transition: opacity .18s, transform .12s;
}
.circle.send.on { opacity: 1; pointer-events: auto; }
.circle.send.on:active { transform: scale(.9); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(226, 91, 52, .45); }
  70% { box-shadow: 0 0 0 14px rgba(226, 91, 52, 0); }
  100% { box-shadow: 0 0 0 0 rgba(226, 91, 52, 0); }
}

.parse-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 8px 6px 0;
  padding: 5px 11px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  width: fit-content;
  animation: rise .2s ease;
}
.parse-hint svg { width: 13px; height: 13px; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  max-width: 540px;
  margin: 0 auto;
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 500;
  transition: color .18s;
  position: relative;
}
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--text); }
.tab .badge {
  position: absolute;
  top: 7px;
  left: 50%;
  margin-left: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  display: none;
}
.tab .badge.on { display: block; }

/* ---------- 浮层 ---------- */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 12, .38);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s;
}
.scrim.show { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  max-width: 540px;
  margin: 0 auto;
  background: var(--bg);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-lg);
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.22, .9, .28, 1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overflow: hidden;
  pointer-events: none;
}
.sheet.show { transform: translateY(0); pointer-events: auto; }

.sheet-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 10px;
}
.sheet-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.sheet-head .sub { margin: 2px 0 0; font-size: 12.5px; color: var(--text-3); font-weight: 400; }
.sheet-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-deep);
  color: var(--text-2);
  display: grid;
  place-items: center;
}
.sheet-close svg { width: 15px; height: 15px; }
.sheet-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 20px 20px;
}
.sheet-foot {
  flex: none;
  padding: 12px 20px calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.sheet-foot .btn { flex: 1; }

.btn {
  height: 48px;
  border-radius: 15px;
  font-size: 15.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: transform .12s, opacity .15s;
  background: var(--bg-deep);
  color: var(--text);
}
.btn:active { transform: scale(.98); opacity: .9; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px -10px rgba(226, 91, 52, .9); }
.btn.ghost { background: transparent; color: var(--text-2); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.wide { width: 100%; }

/* ---------- 表单 ---------- */
.field { padding: 13px 0; border-bottom: 1px solid var(--line); }
.field:last-child { border-bottom: 0; }
.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 9px;
}
.ed-title {
  width: 100%;
  padding: 6px 0 4px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.45;
  resize: none;
  background: transparent;
}
.ed-title::placeholder { color: var(--text-3); font-weight: 400; }

.seg {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-deep);
  border-radius: 12px;
  gap: 2px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  height: 32px;
  padding: 0 13px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: all .15s;
}
.seg button.on {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
  font-weight: 600;
}

.dt-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dt-input {
  height: 38px;
  padding: 0 12px;
  border-radius: 11px;
  background: var(--bg-deep);
  font-size: 14px;
  color: var(--text);
  min-width: 0;
}
.dt-input:invalid { color: var(--text-3); }
.dt-input::-webkit-calendar-picker-indicator { opacity: .45; filter: none; }
input[type="date"].dt-input { width: 148px; }
input[type="time"].dt-input { width: 112px; }
select.dt-input { padding-right: 28px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='3'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; }

.wd-row { display: flex; gap: 6px; margin-top: 10px; }
.wd {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-deep);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  display: grid;
  place-items: center;
  transition: all .15s;
}
.wd.on { background: var(--accent); color: #fff; font-weight: 600; }

.ed-notes {
  width: 100%;
  min-height: 60px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-deep);
  font-size: 14.5px;
  line-height: 1.55;
  resize: vertical;
}

.subs { display: flex; flex-direction: column; gap: 6px; }
.sub-item { display: flex; align-items: center; gap: 9px; }
.sub-check {
  flex: none;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 1.6px solid var(--line-2);
  display: grid;
  place-items: center;
}
.sub-check svg { width: 11px; height: 11px; color: var(--accent); opacity: 0; }
.sub-item.done .sub-check { border-color: var(--accent); }
.sub-item.done .sub-check svg { opacity: 1; }
.sub-item.done input { color: var(--text-3); text-decoration: line-through; }
.sub-item input {
  flex: 1;
  height: 34px;
  font-size: 14.5px;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.sub-del { flex: none; width: 26px; height: 26px; color: var(--text-3); display: grid; place-items: center; }
.sub-del svg { width: 13px; height: 13px; }
.sub-add { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--accent); }
.sub-add input { flex: 1; height: 36px; font-size: 14.5px; background: transparent; }
.sub-add input::placeholder { color: var(--text-3); }

/* ---------- 标签选择 ---------- */
.tag-grid { display: flex; flex-wrap: wrap; gap: 9px; margin: 4px 0 4px; }
.tag-opt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 15px;
  border-radius: 99px;
  background: var(--card);
  box-shadow: 0 0 0 1.5px var(--line);
  font-size: 14px;
  font-weight: 500;
  transition: all .15s;
}
.tag-opt .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--text-3)); }
.tag-opt.on { box-shadow: 0 0 0 2px var(--c, var(--accent)); background: color-mix(in srgb, var(--c, #999) 10%, var(--card)); }
.tag-opt:active { transform: scale(.97); }
.tag-new {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.tag-new input {
  flex: 1;
  height: 42px;
  padding: 0 14px;
  border-radius: 13px;
  background: var(--bg-deep);
  font-size: 15px;
}
.tag-new button {
  flex: none;
  height: 42px;
  padding: 0 16px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.swatches { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 0 var(--bg);
  transition: box-shadow .15s;
  position: relative;
}
.swatch.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--c); }

/* ---------- 设置 ---------- */
.card {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 4px 16px;
  margin-bottom: 14px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  min-height: 54px;
}
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-size: 14.5px; font-weight: 500; }
.row .d { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.row .v { font-size: 13.5px; color: var(--text-3); }
.row .chev { color: var(--text-3); width: 16px; height: 16px; flex: none; }

.switch {
  width: 46px;
  height: 28px;
  border-radius: 99px;
  background: var(--line-2);
  position: relative;
  transition: background .2s;
  flex: none;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .2s cubic-bezier(.2, .9, .3, 1);
}
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(18px); }

.tag-row { display: flex; align-items: center; gap: 10px; }
.tag-row .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }

.note {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-3);
  padding: 0 4px 10px;
}
.note b { color: var(--text-2); font-weight: 600; }

/* ---------- 提醒弹层 ---------- */
.alert-card { text-align: left; padding: 6px 0 4px; }
.alert-card .bell {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}
.alert-card .bell svg { width: 23px; height: 23px; }
.alert-card h3 { margin: 0 0 6px; font-size: 21px; line-height: 1.35; font-weight: 700; }
.alert-card .when { font-size: 13px; color: var(--text-3); }
.alert-card .nt { margin-top: 10px; font-size: 14px; color: var(--text-2); white-space: pre-wrap; }
.alert-actions { display: flex; gap: 8px; margin-top: 20px; }
.alert-actions .btn { flex: 1; height: 44px; font-size: 14.5px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + var(--composer-h) + var(--safe-b) + 16px);
  transform: translate(-50%, 10px);
  z-index: 80;
  max-width: 88vw;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(30, 27, 24, .92);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .6);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-color-scheme: dark) {
  .toast { background: rgba(240, 236, 230, .95); color: #17150F; }
}

/* ---------- 安全区/滚动 ---------- */
.hidden { display: none !important; }
[hidden] { display: none !important; }

/* 线性图标统一描边；符号里的 path 没有写属性，靠继承生效 */
svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.sheet-body::-webkit-scrollbar { width: 0; }

/* ---------- 图片 ---------- */
.thumb-strip {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.thumb {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 11px;
  overflow: hidden;
  background: var(--bg-deep);
  padding: 0;
  flex: none;
  display: block;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumb .rm {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  display: grid;
  place-items: center;
}
.thumb .rm svg { width: 10px; height: 10px; }
.thumb.add {
  display: grid;
  place-items: center;
  color: var(--text-3);
  border: 1.5px dashed var(--line-2);
  background: transparent;
}
.thumb.add svg { width: 20px; height: 20px; }
.thumb-more {
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, .45);
  position: absolute;
  right: 0;
  bottom: 0;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  margin: 3px;
}
.thumb .count {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2px 5px;
  font-size: 10.5px;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, .55));
  text-align: right;
}

.composer-previews {
  display: flex;
  gap: 7px;
  padding: 0 4px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.composer-previews::-webkit-scrollbar { display: none; }
.composer-previews .thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
}

.viewer {
  display: grid;
  place-items: center;
  padding: 4px 0 12px;
}
.viewer img {
  max-width: 100%;
  max-height: 68dvh;
  border-radius: 14px;
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
