:root {
  --ink: #182420;
  --ink-2: #46564f;
  --muted: #8b978f;
  --paper: #f6f4ed;
  --card: #ffffff;
  --line: #e7e2d6;
  --line-soft: #f0ece2;
  --forest: #1c4a3e;
  --forest-2: #2f6b5a;
  --forest-soft: #e8f0ec;
  --clay: #bd6b3c;
  --high: #c04a3d;
  --mid: #c58a2c;
  --low: #5f8a83;
  --shadow-sm: 0 1px 2px rgba(24, 36, 32, .05), 0 4px 14px rgba(24, 36, 32, .04);
  --shadow-md: 0 8px 30px rgba(24, 36, 32, .09);
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1000px 520px at 78% -12%, rgba(47, 107, 90, .10), transparent 62%),
    radial-gradient(760px 420px at 4% 4%, rgba(189, 107, 60, .07), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }

/* ---------- boot ---------- */
.boot-screen {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 14px;
}
.boot-mark {
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--forest); color: #f4f1e7;
  display: grid; place-items: center;
  font-size: 20px; font-weight: 600;
  animation: breathe 1.6s ease-in-out infinite;
}
@keyframes breathe { 0%,100% { transform: scale(1); opacity: .9 } 50% { transform: scale(1.06); opacity: 1 } }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: .01em; }
.brand .mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--forest); color: #f3f0e6;
  display: grid; place-items: center; font-size: 17px; font-weight: 600;
}
.brand .mark.sm { width: 32px; height: 32px; border-radius: 10px; font-size: 15px; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-txt small { font-size: 9px; letter-spacing: .16em; color: var(--muted); font-weight: 500; }

/* ---------- login ---------- */
.login-screen {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: 60px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 40px;
}
.login-art { padding-right: 20px; }
.login-art .brand { color: rgba(244, 241, 233, .8); margin-bottom: 44px; }
.login-art .brand .mark { background: rgba(244, 241, 233, .14); backdrop-filter: blur(2px); }
.login-art h1 {
  font-size: clamp(34px, 4vw, 50px);
  line-height: 1.22;
  letter-spacing: -.02em;
  margin: 0 0 18px;
  font-weight: 700;
  color: #f4f1e9;
}
.login-art .lede {
  font-size: 15px;
  color: rgba(244, 241, 233, .72);
  max-width: 440px;
  margin: 0 0 38px;
}
.features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 18px; }
.features li { display: flex; flex-direction: column; gap: 3px; }
.features b { font-size: 14px; color: #f0ece1; font-weight: 600; }
.features span { font-size: 13px; color: rgba(240, 236, 225, .58); }

.login-screen::before {
  content: "";
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 52%;
  background:
    radial-gradient(700px 500px at 20% 15%, #2b6152 0%, transparent 70%),
    linear-gradient(160deg, #1a463b 0%, #14352c 55%, #102a23 100%);
  z-index: -1;
}
.login-screen::after {
  content: "";
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 52%;
  background-image: radial-gradient(rgba(255,255,255,.055) 1px, transparent 1px);
  background-size: 22px 22px;
  z-index: -1;
}

.login-card {
  background: var(--card);
  border-radius: 24px;
  padding: 36px 34px 28px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line-soft);
  width: 100%;
  max-width: 420px;
  justify-self: center;
}
.login-card h2 { margin: 0 0 6px; font-size: 21px; letter-spacing: -.01em; }
.login-sub { margin: 0 0 26px; font-size: 13px; color: var(--muted); }

label { display: block; font-size: 12px; color: var(--ink-2); margin: 16px 0 7px; font-weight: 550; letter-spacing: .02em; }

input[type="text"], input[type="tel"], input[type="date"], input[type="search"], input[type="number"], select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fdfcf8;
  border-radius: 11px;
  padding: 11px 13px;
  font-size: 14px;
  outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--forest-2);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 107, 90, .12);
}
textarea { resize: vertical; line-height: 1.6; }

.phone-row { display: flex; gap: 8px; }
.phone-row input { flex: 1; }
.phone-row .ghost { flex: 0 0 auto; white-space: nowrap; font-size: 13px; padding: 0 14px; }

.field-error { min-height: 16px; margin: 5px 0 0; font-size: 12px; color: var(--high); }
.form-error { min-height: 18px; margin: 10px 0 0; font-size: 12.5px; color: var(--high); }

.primary {
  background: var(--forest);
  color: #f5f2e8;
  border: none;
  border-radius: 11px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 560;
  letter-spacing: .01em;
  transition: transform .12s, background .16s, opacity .16s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.primary:hover { background: #173e34; }
.primary:active { transform: translateY(1px); }
.primary:disabled { opacity: .55; cursor: default; }
.primary.block { width: 100%; margin-top: 20px; }

.ghost {
  background: #fbf9f3;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--ink-2);
  transition: background .16s, border-color .16s, color .16s;
}
.ghost:hover { background: #f4f1e7; border-color: #d9d3c4; color: var(--ink); }
.ghost.tiny { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.ghost:disabled { opacity: .5; cursor: default; }

.divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.wechat {
  width: 100%;
  padding: 11px;
  border-radius: 11px;
  border: 1px solid #d9e4d6;
  background: #f2f7ef;
  color: #2c6b3f;
  font-size: 14px;
  font-weight: 550;
  transition: background .16s;
}
.wechat:hover { background: #e9f2e5; }
.privacy { margin: 18px 0 0; font-size: 11.5px; color: var(--muted); text-align: center; line-height: 1.6; }

/* ---------- app shell ---------- */
.app-screen { position: relative; z-index: 1; min-height: 100vh; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1220px; margin: 0 auto;
  padding: 20px 32px 8px;
}
.user-box { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(145deg, #2f6b5a, #1c4a3e);
  color: #f2efe4; display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
}
.user-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-note { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
@media (max-width: 780px) {
  .session-note { display: none; }
}
.link-btn {
  background: none; border: none; padding: 2px 0 2px 8px;
  color: var(--muted); font-size: 12.5px;
  border-left: 1px solid var(--line);
}
.link-btn:hover { color: var(--ink); }

.main { max-width: 1220px; margin: 0 auto; padding: 10px 32px 80px; }

.card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ---------- composer ---------- */
.composer { padding: 24px 26px 20px; margin-bottom: 22px; }

/* 迷你录入条：移动端默认收起，点开完整面板 */
.composer-mini { display: none; }
.composer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.composer-head h2 { margin: 0 0 4px; font-size: 19px; letter-spacing: -.01em; }
.composer-head p { margin: 0; font-size: 13px; color: var(--muted); }
.hint-pill {
  font-size: 11px; color: var(--muted);
  background: #f7f4ea; border: 1px solid var(--line-soft);
  padding: 4px 10px; border-radius: 20px; white-space: nowrap;
}
#rawInput {
  background: #fcfbf7;
  border: 1px solid var(--line);
  font-size: 15px;
  padding: 14px 16px;
  min-height: 88px;
}
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; }
.samples { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  background: #f8f6ef;
  border: 1px solid var(--line-soft);
  color: var(--ink-2);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { background: var(--forest-soft); border-color: #cfe0d6; color: var(--forest); }

.spinner {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid rgba(245, 242, 232, .35);
  border-top-color: #f5f2e8;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

.parse-note {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--ink-2);
  background: var(--forest-soft);
  border: 1px solid #d5e5db;
  border-radius: 10px;
  padding: 9px 13px;
}
.parse-note.warn { background: #fdf5e9; border-color: #f0dfc2; color: #8a6320; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }

.stream { min-width: 0; }
.stream-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; background: #eeeade; padding: 4px; border-radius: 12px; }
.tab {
  border: none; background: transparent;
  padding: 7px 14px; border-radius: 9px;
  font-size: 13px; color: var(--ink-2);
  display: flex; align-items: center; gap: 6px;
  transition: background .16s, color .16s;
}
.tab:hover { color: var(--ink); }
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(24,36,32,.08); font-weight: 550; }
.tab-count {
  font-size: 11px; background: #e3ddcd; color: #6d6757;
  border-radius: 20px; padding: 0 6px; min-width: 18px; text-align: center;
}
.tab.active .tab-count { background: var(--forest-soft); color: var(--forest); }

.search-box { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.search-box input { padding-left: 36px; background: #fff; font-size: 13px; height: 38px; }
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; stroke: var(--muted); fill: none; stroke-width: 2; stroke-linecap: round;
}

/* ---------- list ---------- */
.list-area { display: flex; flex-direction: column; gap: 10px; }
.group-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted); letter-spacing: .04em;
  margin: 12px 2px 2px;
}
.group-label:first-child { margin-top: 0; }
.group-label b { color: var(--ink-2); font-weight: 600; font-size: 12px; }
.group-label .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.group-label .dot.high { background: var(--high); }
.group-label .dot.medium { background: var(--mid); }
.group-label .dot.low { background: var(--low); }
.group-label .line { flex: 1; height: 1px; background: var(--line-soft); }

.task {
  position: relative;
  display: flex;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 15px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .18s, transform .18s, border-color .18s;
}
.task:hover { box-shadow: 0 4px 18px rgba(24,36,32,.09); border-color: #e3ddce; }
.task.done { background: #fcfbf6; box-shadow: none; }
.prio-bar { width: 4px; flex: 0 0 4px; }
.prio-bar.high { background: var(--high); }
.prio-bar.medium { background: var(--mid); }
.prio-bar.low { background: var(--low); }
.prio-bar.finished { background: #cfd6cf; }

.task-main { flex: 1; min-width: 0; padding: 15px 17px 14px; }
.task-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.task h4 {
  margin: 0; font-size: 14.5px; font-weight: 600; letter-spacing: -.005em;
  line-height: 1.45; word-break: break-word;
}
.task.done h4 { color: #6d7a72; text-decoration: line-through; text-decoration-color: #c4cdc6; }
.task-detail { margin: 5px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.62; white-space: pre-wrap; word-break: break-word; }

.task-actions { display: flex; gap: 3px; flex: 0 0 auto; opacity: .35; transition: opacity .16s; }
.task:hover .task-actions { opacity: 1; }
.task-actions button {
  border: 1px solid transparent; background: transparent;
  color: var(--ink-2); font-size: 12px;
  padding: 3px 7px; border-radius: 7px;
  white-space: nowrap;
}
.task-actions button:hover { background: #f4f1e7; color: var(--ink); border-color: var(--line-soft); }
.task-actions button[data-act="del"]:hover { color: var(--high); background: #fdf1ef; }

.meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
  margin-top: 9px; font-size: 11.5px; color: var(--muted);
}
.meta .tag {
  background: #f5f2e8; border-radius: 6px; padding: 1px 7px; color: #6b6455;
}
.meta .tag.cat { background: var(--forest-soft); color: #30604f; }
.meta .due-soon { color: var(--high); font-weight: 550; }
.meta .due-over { color: #fff; background: var(--high); border-radius: 6px; padding: 1px 7px; }

.progress-row { display: flex; align-items: center; gap: 10px; margin-top: 11px; }

/* 推进记录输入框（点「推进」弹出） */
.advance-box { display: none; margin-top: 8px; padding: 8px 10px; background: #f7f5ee; border: 1px solid #e6e0cf; border-radius: 8px; }
.advance-box.open { display: block; }
.adv-input {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 44px;
  border: 1px solid var(--line-soft); border-radius: 6px; padding: 6px 8px;
  font-size: 12.5px; background: #fff; color: var(--ink); font-family: inherit; line-height: 1.5;
}
.adv-input:focus { outline: none; border-color: #4b8a75; }
.adv-btns { display: flex; gap: 8px; margin-top: 6px; }
.adv-ok { border-style: solid; border-color: #4b8a75; color: #2f6b5a; background: #eef5f0; }
.adv-ok:hover { background: #dfeede; }

/* 进展记录（展开卡可见） */
.task .plog { display: none; }
.task.expanded .plog { display: block; }
.plog { margin-top: 8px; font-size: 12px; line-height: 1.55; }
.plog b {
  display: block; color: var(--muted); font-weight: 600;
  font-size: 11.5px; margin-bottom: 3px;
}
.plog-item { display: flex; gap: 6px; align-items: baseline; }
.plog-date { color: var(--muted); flex: 0 0 auto; font-size: 11.5px; }
.plog-text { min-width: 0; overflow-wrap: anywhere; }
.plog-step { color: var(--muted); font-style: normal; font-size: 11px; flex: 0 0 auto; }
.bar { flex: 1; height: 5px; border-radius: 6px; background: #eeeade; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #4b8a75, #2f6b5a); transition: width .3s ease; }
.bar i.low { background: linear-gradient(90deg, #d7a04a, #c58a2c); }
.bar i.done { background: #b9c4bb; }
.pct { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; width: 34px; text-align: right; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.kw {
  font-size: 11.5px; color: #5b6a62;
  background: #f7f5ee; border: 1px solid var(--line-soft);
  border-radius: 6px; padding: 1px 7px;
}
.kw::before { content: "#"; opacity: .45; margin-right: 1px; }

.points {
  margin-top: 10px; padding: 9px 12px;
  background: #fbf9f3; border-left: 2px solid #d9cfb8; border-radius: 0 8px 8px 0;
  font-size: 12.5px; color: var(--ink-2);
}
.points b { color: var(--ink); font-weight: 600; }
.points div { margin: 2px 0; }

.related { margin-top: 9px; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.related .rel {
  border: 1px dashed #ddd7c8; background: transparent; border-radius: 6px;
  padding: 1px 7px; font-size: 11.5px; color: var(--ink-2);
}
.related .rel:hover { background: #f7f4ea; border-style: solid; }

/* 附件与关联文件夹 */
.files-block { margin-top: 10px; display: grid; gap: 8px; }
.folder-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fr-label { font-size: 12px; color: var(--muted); flex: 0 0 auto; }
.folder-input {
  flex: 1 1 180px; min-width: 0;
  border: 1px solid var(--line-soft); border-radius: 8px;
  padding: 6px 10px; font-size: 12.5px; background: #fbfaf5; color: var(--ink);
}
.folder-input:focus { outline: none; border-color: #4b8a75; background: #fff; }
.attach-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.attach-list { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; min-width: 0; }
.attach-empty { font-size: 12px; color: var(--muted); }
.file-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-soft); background: #f7f5ee;
  border-radius: 8px; padding: 3px 8px; font-size: 12px; max-width: 100%;
}
.ext {
  font-style: normal; font-size: 10px; font-weight: 700;
  border-radius: 4px; padding: 1px 4px; color: #fff; flex: 0 0 auto; letter-spacing: .02em;
}
.ext-doc { background: #2b579a; }
.ext-xls { background: #217346; }
.ext-ppt { background: #c43e1c; }
.ext-pdf { background: #b3261e; }
.ext-img { background: #7a6aa8; }
.ext-other { background: #8b938c; }
.fc-name {
  border: none; background: transparent; padding: 0;
  color: var(--ink); font-size: 12px;
  text-decoration: underline dotted #b9b29e; text-underline-offset: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px;
}
.fc-name:hover { color: #2f6b5a; }
.fc-size { color: var(--muted); font-size: 11px; flex: 0 0 auto; }
.fc-del { border: none; background: transparent; color: var(--muted); font-size: 14px; line-height: 1; padding: 0 1px; flex: 0 0 auto; }
.fc-del:hover { color: var(--high); }
.mini-btn {
  border: 1px dashed #cfc7b2; background: transparent; border-radius: 8px;
  padding: 4px 10px; font-size: 12px; color: var(--ink-2); flex: 0 0 auto;
}
.mini-btn:hover { background: #f4f1e7; color: var(--ink); border-style: solid; }
.drag-hint { font-size: 11.5px; color: var(--muted); }

/* 图片附件缩略图 */
.fc-thumb {
  width: 26px; height: 26px; border-radius: 5px; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  background: #ece8db; flex: 0 0 auto;
}
.fc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fc-thumb .ext { transform: scale(.9); }
.img-chip .fc-name { max-width: 150px; }

/* 图片预览灯箱 */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(20, 18, 12, .72);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
}
.lb-box {
  background: #fffdf8; border-radius: 14px; max-width: min(860px, 94vw);
  max-height: 92vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
}
.lb-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid #eee8d8; flex: 0 0 auto;
}
.lb-name {
  flex: 1 1 auto; font-size: 13px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lb-btn {
  border: 1px solid var(--line-soft); background: #f7f5ee; border-radius: 8px;
  padding: 4px 12px; font-size: 12.5px; color: var(--ink-2); flex: 0 0 auto;
}
.lb-btn:hover { background: #efe9d9; color: var(--ink); }
.lb-close { font-size: 16px; padding: 2px 10px; line-height: 1.2; }
.lb-body {
  padding: 12px; overflow: auto; display: flex;
  align-items: center; justify-content: center; min-height: 120px;
}
.lb-body img { max-width: 100%; max-height: 74vh; border-radius: 8px; display: block; }
.lb-loading { color: var(--muted); font-size: 13px; padding: 24px 0; }

/* 同步自检结果 */
.sync-diag {
  display: grid; gap: 4px; margin-top: 2px; padding: 8px 10px;
  background: #f7f5ee; border: 1px solid #e6e0cf; border-radius: 8px;
  font-size: 12px; line-height: 1.5;
}
.sync-diag.hidden { display: none; }
.diag-line { display: flex; gap: 6px; align-items: flex-start; }
.diag-line b { flex: 0 0 auto; width: 12px; font-weight: 700; }
.diag-line.good b { color: #2f7d5c; }
.diag-line.bad b { color: #b4442f; }
.diag-line.skip b { color: var(--muted); }
.diag-line.bad span { color: #8f3a29; }
.diag-tip { margin-top: 4px; padding-top: 6px; border-top: 1px dashed #ded7c4; color: var(--ink-2); font-size: 11.5px; }
.task.drag-over { outline: 2px dashed #4b8a75; outline-offset: 2px; background: #f3f7f2; }
.tag.att-badge { background: #eef2ea; color: #46624f; }

/* 任务卡默认收起（桌面/移动一致）：一行摘要 + 元信息，点卡片展开全部明细 */
.task { cursor: pointer; }
.task-detail {
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 3px;
}
.task .tags, .task .points, .task .related { display: none; }
.task.expanded .task-detail { display: block; -webkit-line-clamp: unset; }
.task.expanded .tags { display: flex; }
.task.expanded .points { display: block; }
.task.expanded .related { display: flex; }
/* 搜索时全部展开并高亮命中，清空后恢复收起 */
.list-area.searching .task-detail { display: block; -webkit-line-clamp: unset; }
.list-area.searching .tags { display: flex; }
.list-area.searching .points { display: block; }

.empty {
  text-align: center; padding: 56px 20px;
  background: #fbfaf5; border: 1px dashed #e2ddce; border-radius: 16px;
  color: var(--muted); font-size: 13.5px;
}
.empty b { display: block; color: var(--ink-2); font-size: 14px; margin-bottom: 6px; font-weight: 600; }

mark { background: #fdf0c8; color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- side ---------- */
.side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 18px; }
.stats, .insight { padding: 18px 20px; }
.side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.side-head h3 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--ink); }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: #fbf9f3; border: 1px solid var(--line-soft); border-radius: 11px; padding: 11px 12px; }
.stat b { display: block; font-size: 21px; line-height: 1.2; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11.5px; color: var(--muted); }

.cat-bars { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.cat-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-2); }
.cat-row .name { width: 32px; flex: 0 0 32px; }
.cat-row .track { flex: 1; height: 4px; background: #f0ece0; border-radius: 4px; overflow: hidden; }
.cat-row .track i { display: block; height: 100%; background: #8aa89c; border-radius: 4px; }
.cat-row .num { width: 16px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.insight-body { font-size: 13px; color: var(--ink-2); line-height: 1.72; white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow-y: auto; }
.insight-body .insight-empty { color: var(--muted); margin: 0; font-size: 12.5px; }
.insight-body h5 { margin: 12px 0 4px; font-size: 12.5px; color: var(--forest); letter-spacing: .02em; }
.insight-body h5:first-child { margin-top: 0; }
.insight-body .cursor { display: inline-block; width: 6px; height: 14px; background: var(--forest-2); vertical-align: -2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0 } }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; }
.modal-mask { position: absolute; inset: 0; background: rgba(20, 30, 26, .42); backdrop-filter: blur(2px); }
.modal-card {
  position: relative; width: 100%; max-width: 520px; max-height: 86vh; overflow-y: auto;
  background: #fff; border-radius: 18px; box-shadow: var(--shadow-md);
  animation: pop .18s ease;
}
@keyframes pop { from { transform: translateY(8px) scale(.985); opacity: 0 } to { transform: none; opacity: 1 } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 6px; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 6px 22px 4px; }
.modal-body label:first-child { margin-top: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px 20px; }
.icon-btn { border: none; background: transparent; font-size: 20px; line-height: 1; color: var(--muted); padding: 4px 6px; border-radius: 8px; }
.icon-btn:hover { background: #f4f1e7; color: var(--ink); }
input[type="range"] { width: 100%; accent-color: var(--forest-2); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 16px);
  background: #1f2f29; color: #f2efe4;
  padding: 10px 18px; border-radius: 10px;
  font-size: 13px; box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none; transition: opacity .22s, transform .22s;
  z-index: 80; max-width: 84vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #8f3529; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; flex-direction: row; flex-wrap: wrap; }
  .side > .card { flex: 1 1 260px; }
  .login-screen { grid-template-columns: 1fr; gap: 30px; padding: 40px 24px; }
  .login-art .brand { color: var(--muted); margin-bottom: 22px; }
  .login-art .brand .mark { background: var(--forest); color: #f3f0e6; }
  .login-art h1 { color: var(--ink); font-size: 30px; }
  .login-art .lede { color: var(--ink-2); margin-bottom: 22px; }
  .features { display: none; }
  .login-screen::before, .login-screen::after { display: none; }
  .login-card { justify-self: stretch; max-width: none; }
}

@media (max-width: 780px) {
  .main { padding: 8px 16px calc(60px + env(safe-area-inset-bottom)); }
  .topbar { padding: 14px 16px 4px; }
  .composer { padding: 0; margin-bottom: 12px; overflow: hidden; }

  /* 收起态：一行迷你条，让任务列表先露脸 */
  .composer-mini {
    display: flex; align-items: center; gap: 11px;
    width: 100%; text-align: left;
    background: transparent; border: none;
    padding: 13px 16px;
  }
  .mini-plus {
    width: 30px; height: 30px; flex: 0 0 30px; border-radius: 10px;
    background: var(--forest); color: #f3f0e6;
    display: grid; place-items: center; font-size: 17px; line-height: 1;
  }
  .mini-text { color: var(--muted); font-size: 14.5px; }
  .composer-full { display: none; }
  .composer.open .composer-mini { display: none; }
  .composer.open .composer-full { display: block; padding: 18px 16px 16px; }

  .composer-head { flex-direction: column; gap: 8px; }
  .hint-pill { display: none; }
  .composer-foot { flex-direction: column; align-items: stretch; }
  .samples { order: 2; }
  .stream-head { flex-direction: column; align-items: stretch; }
  .search-box { max-width: none; }
  .tab { padding: 8px 12px; font-size: 13px; }
  .side { flex-direction: column; }
  .field-row { grid-template-columns: 1fr; }

  /* 触控与输入：16px 防止 iOS Safari 聚焦时自动放大页面 */
  input, select, textarea { font-size: 16px; }
  .primary, .ghost, .wechat { min-height: 44px; }

  /* 任务卡收窄：操作按钮独占一行，不再挤压标题 */
  .task-top { flex-direction: column; gap: 8px; }
  .task-actions { opacity: 1; width: 100%; justify-content: flex-end; }
  .task-actions button { min-height: 32px; padding: 4px 10px; font-size: 12.5px; }
  .task-main { padding: 12px 14px; }
  .meta { margin-top: 7px; }
  .drag-hint { display: none; }
  .fc-name { max-width: 130px; }
  .progress-row { margin-top: 8px; }

  .toast { bottom: calc(28px + env(safe-area-inset-bottom)); }
  .modal { padding: 12px; }
  .modal-card { max-height: 88vh; }

  /* 外屏 / 手机：整体加大阅读字号 */
  .composer-head h2 { font-size: 21px; }
  .composer-head p { font-size: 13.5px; }
  .chip { font-size: 13px; padding: 7px 13px; }
  .tab { font-size: 14px; }
  .search-box input { font-size: 15px; }
  .task h4 { font-size: 16.5px; }
  .task-detail { font-size: 14.5px; }
  .meta { font-size: 12.5px; gap: 8px; }
  .meta .tag, .meta .due-over { font-size: 12px; }
  .kw { font-size: 12.5px; }
  .points { font-size: 13.5px; }
  .related { font-size: 12.5px; }
  .related .rel { font-size: 12.5px; }
  .pct { font-size: 12px; }
  .group-label { font-size: 12.5px; }
  .group-label b { font-size: 12.5px; }
  .empty { font-size: 15px; }
  .stat b { font-size: 25px; }
  .stat span { font-size: 12.5px; }
  .side-head h3 { font-size: 14.5px; }
  .insight-body { font-size: 14.5px; }
  .modal-head h3 { font-size: 17px; }
  .modal-body label { font-size: 13px; }
}

/* 折叠屏展开 / 小尺寸平板（约 780–1024px）：单列布局下放宽留白 */
@media (min-width: 780px) and (max-width: 1024px) {
  .main { padding: 10px 24px 60px; }
  .side > .card { flex: 1 1 300px; }
}

/* ============ 栏目切换页签 ============ */
.view-tabs {
  display: flex; gap: 8px; margin-bottom: 16px;
  border-bottom: 2px solid var(--line-soft);
  padding-bottom: 0;
}
.view-tab {
  appearance: none; border: none; background: none; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--muted);
  padding: 9px 16px 11px; border-radius: 8px 8px 0 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px; position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  transition: color .15s, background .15s;
}
.view-tab:hover { color: var(--ink); background: rgba(28, 74, 62, .05); }
.view-tab.active { color: var(--forest); border-bottom-color: var(--forest); }
.news-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #c04a3d; display: inline-block;
}

/* ============ 全球要闻滚动栏 + AI 行情解读 ============ */
.news-panel { margin-top: 18px; padding: 14px 16px 12px; }
#newsView .news-panel { margin-top: 4px; max-width: 860px; }
.news-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.news-head h3 { margin: 0; font-size: 14.5px; }
.news-meta { flex: 1; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-desc { margin: 0 0 12px; font-size: 12px; color: var(--muted); line-height: 1.5; }

.news-list { display: flex; flex-direction: column; }
.news-row {
  display: block;
  padding: 8px 4px; text-decoration: none;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2); font-size: 12.5px; line-height: 1.45;
}
.news-row:last-child { border-bottom: none; }
.news-row:hover { background: #f6f3ea; color: var(--forest); }
.news-row-top { display: flex; align-items: center; gap: 8px; }
.news-row-t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-row-arrow { color: var(--line); font-size: 15px; flex: none; }
.news-row-sum {
  display: block; margin-top: 3px; padding-left: 2px;
  font-size: 11.5px; color: var(--muted); line-height: 1.5;
}
.sum-tag {
  display: inline-block; font-size: 9.5px; font-weight: 600;
  color: var(--forest); background: var(--forest-soft);
  border-radius: 3px; padding: 0 4px; margin-right: 5px;
  vertical-align: 1px;
}
.sum-score { font-size: 10px; font-weight: 600; color: var(--mid); margin-left: 6px; }
.news-row-imp { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; padding-left: 2px; }
.imp {
  font-size: 10px; line-height: 1.5; padding: 0 5px; border-radius: 3px;
  border: 1px solid transparent; white-space: nowrap;
}
.imp-up   { color: #c04a3d; background: #f9e9e6; border-color: #f2d8d3; }
.imp-down { color: #1d7a4f; background: #e6f3ec; border-color: #d5e9de; }
.imp-flat { color: #a7ada5; background: #f4f2ea; border-color: #ece8dc; }
.tick-cat { font-weight: 600; font-size: 10.5px; border-radius: 4px; padding: 1px 5px; flex: none; }
.tick-world { color: #1c4a3e; background: #e8f0ec; }
.tick-fin { color: #8a5a12; background: #f7eeda; }
.tick-hot { color: #7a3b12; background: #f3e3e9; }
.tick-abroad { color: #1d3a6e; background: #e6edf7; }
.tick-flash { color: #5b3a7a; background: #efe8f6; }
.tick-time { color: var(--muted); font-style: normal; font-size: 11px; flex: none; }

.news-brief { margin: 12px 0 10px; font-size: 13px; color: var(--ink); line-height: 1.55; }
.focus-card {
  border: 1px solid var(--line-soft); border-radius: 8px;
  background: #fbfaf5; padding: 10px 12px;
}
.news-summary {
  margin-top: 10px; padding: 9px 12px;
  border-left: 3px solid var(--forest-2); border-radius: 0 8px 8px 0;
  background: var(--forest-soft);
}
.news-summary b { display: block; font-size: 12px; color: var(--forest); margin-bottom: 4px; }
.news-summary p { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.asset-top { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.asset-top b { font-size: 13.5px; }
.depth { font-size: 12px; letter-spacing: 1px; }
.depth-note { font-size: 11px; color: var(--muted); margin-left: auto; }
.dir { font-size: 11px; font-weight: 600; border-radius: 4px; padding: 1px 7px; }
.dir-up   { color: #c04a3d; background: #f9e9e6; }  /* 利多：红 */
.dir-down { color: #1d7a4f; background: #e6f3ec; }  /* 利空：绿 */
.dir-flat { color: var(--muted); background: #efede4; }
.focus-card p { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.news-ai-empty { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.news-ai-meta { margin: 10px 0 0; font-size: 11px; color: var(--muted); }

/* ---------------- 日常资料（收藏夹） ---------------- */
.docs-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.docs-head h3 { margin: 0; }
.docs-meta {
  color: var(--muted);
  font-size: 12px;
  margin-right: auto;
}
.docs-desc {
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}
#docsSearch {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  font-size: 14px;
  margin-bottom: 12px;
}
#docsSearch:focus { outline: none; border-color: var(--forest-2); background: #fff; }

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.docs-tip {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  padding: 18px 4px;
  text-align: center;
}

.doc-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}
.doc-thumb-wrap {
  border-radius: 9px;
  overflow: hidden;
  background: var(--line-soft);
  cursor: pointer;
}
.doc-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.doc-thumb-icon {
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.doc-thumb-icon span { font-size: 34px; line-height: 1; }
.doc-thumb-icon b { font-size: 12px; color: var(--ink-2); font-weight: 600; }

.doc-title {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-note {
  margin: 0;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.doc-sub {
  font-size: 11px;
  color: var(--muted);
}
.doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
}
.doc-actions .tiny { padding: 3px 7px; font-size: 11px; }
.doc-del { color: var(--high); }

@media (max-width: 480px) {
  .docs-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 资料栏：分类条 / 分类角标 / 拖拽高亮 */
.doc-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.doc-chip {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12.5px;
  cursor: pointer;
}
.doc-chip.active {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
}
.doc-cat-tag {
  display: inline-block;
  background: var(--forest-soft);
  color: var(--forest);
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
  width: fit-content;
}
.docs-panel.drag-over {
  outline: 2px dashed var(--forest-2);
  outline-offset: -6px;
  background: var(--forest-soft);
}
