/* ------------------------------------------------------------ tokens */
:root {
  --bg: #f4f3ef; --surface: #ffffff; --surface-2: #faf9f6; --sunken: #efede8;
  --ink: #1d1c1a; --muted: #6e6a62; --faint: #a09b91; --line: #e6e3dc; --line-strong: #d5d1c7;
  --accent: #3451d1; --accent-hover: #2a43b4; --accent-soft: #eaeefc; --on-accent: #fff;
  --unread: #6f6b63; --unread-bg: #eeece7;
  --reading: #9a5205; --reading-bg: #fdf0dc;
  --presented: #1f7a4a; --presented-bg: #e2f3e8;
  --leave: #8a3fc4; --leave-bg: #f3e9fb;
  --danger: #c33a2c; --danger-bg: #fbe9e7;
  --shadow: 0 1px 2px rgba(40, 32, 15, .04), 0 6px 20px rgba(40, 32, 15, .05);
  --shadow-lg: 0 20px 60px rgba(20, 16, 8, .22);
  --radius: 14px; --radius-sm: 9px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Noto Serif TC", "Songti TC", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131416; --surface: #1c1d20; --surface-2: #202125; --sunken: #18191b;
    --ink: #ebe9e4; --muted: #a29e96; --faint: #6f6c66; --line: #2d2e32; --line-strong: #3b3c41;
    --accent: #7c93ff; --accent-hover: #93a6ff; --accent-soft: #232a45; --on-accent: #0d1020;
    --unread: #aaa69e; --unread-bg: #2a2b2f;
    --reading: #f2b062; --reading-bg: #3a2a14;
    --presented: #6cd49a; --presented-bg: #17321f;
    --leave: #cfa2ff; --leave-bg: #2e2142;
    --danger: #ff8a7e; --danger-bg: #3d1d1a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 20px 60px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

/* ------------------------------------------------------------ base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.25; font-weight: 650; }
h1 { font-family: var(--serif); font-size: 1.85rem; letter-spacing: -.01em; margin: 0; font-weight: 600; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
h3 { font-size: .92rem; margin: 1.2rem 0 .5rem; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .85rem; }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.spacer { flex: 1; }
.grow { flex: 1; min-width: 200px; }
.hide { display: none !important; }

/* ------------------------------------------------------------ header */
.top { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top-inner { max-width: 1180px; margin: 0 auto; padding: .55rem 16px; display: flex; align-items: center; gap: .5rem 1.5rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .15rem; }
.brand-link { display: flex; align-items: center; gap: .5rem; color: var(--ink); font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }
.brand-link:hover { text-decoration: none; }
.logo { width: 24px; height: 24px; }
.logo rect { fill: var(--accent); }
.logo path { stroke: var(--surface); stroke-width: 2; stroke-linecap: round; }
nav { display: flex; gap: .15rem; flex: 1; flex-wrap: wrap; }
nav a { padding: .38rem .75rem; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: .95rem; }
nav a:hover { color: var(--ink); background: var(--sunken); text-decoration: none; }
nav a.active { color: var(--ink); background: var(--sunken); box-shadow: inset 0 -2px 0 var(--accent); }
.top-actions { display: flex; align-items: center; gap: .6rem; }
.who { display: flex; align-items: center; gap: .45rem; padding: .2rem .75rem .2rem .25rem; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); cursor: pointer; min-height: 34px; }
.who:hover { border-color: var(--line-strong); background: var(--sunken); }
.who-name { font-weight: 600; max-width: 8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-switch { font-size: .78rem; color: var(--faint); }
.who-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .5rem; }
.who-opt { display: flex; align-items: center; gap: .55rem; padding: .5rem .6rem; border: 1px solid var(--line-strong); border-radius: 11px;
  background: var(--surface); cursor: pointer; text-align: left; font-weight: 500; min-width: 0; }
.who-opt span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-opt:hover { border-color: var(--accent); background: var(--accent-soft); }
.who-opt.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
@media (max-width: 760px) {
  .top-inner { gap: .4rem .75rem; }
  nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; margin: 0 -4px; }
  nav a { white-space: nowrap; }
  .top-actions { margin-left: auto; }
}

main { max-width: 1180px; margin: 0 auto; padding: 1.75rem 16px 5rem; }

/* ------------------------------------------------------------ page head */
.page-head { display: flex; align-items: flex-end; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head .sub { color: var(--muted); margin: .3rem 0 0; }
.page-head .grow { min-width: 0; }
.section-title { display: flex; align-items: baseline; gap: .6rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 650; margin: 2rem 0 .8rem; }
.section-title a { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: .88rem; }
.back { display: inline-block; color: var(--muted); font-size: .9rem; margin-bottom: .8rem; }

/* ------------------------------------------------------------ surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.25rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.card.flush { padding: 0; overflow: hidden; }
.empty { color: var(--muted); padding: 2rem 1rem; text-align: center; }
.empty .btn { margin-top: .75rem; }

.kpis { display: flex; gap: .6rem; flex-wrap: wrap; margin-left: auto; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .55rem .95rem; min-width: 92px; color: var(--ink); box-shadow: var(--shadow); }
.kpi:hover { text-decoration: none; border-color: var(--line-strong); }
.kpi b { display: block; font-size: 1.45rem; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi span { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; }

/* ------------------------------------------------------------ controls */
input, select, textarea, button { font: inherit; color: inherit; }
input[type=text], input[type=password], input[type=search], input[type=number], input[type=date],
input[type=time], input[type=datetime-local], select, textarea {
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: .48rem .65rem; max-width: 100%; min-height: 38px; }
textarea { width: 100%; min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; }
.btn { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--line-strong); background: var(--surface);
  border-radius: var(--radius-sm); padding: .45rem .9rem; cursor: pointer; white-space: nowrap; font-weight: 500; color: var(--ink); min-height: 38px; }
.btn:hover { background: var(--sunken); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--sunken); color: var(--ink); }
.btn.sm { padding: .25rem .65rem; font-size: .85rem; min-height: 30px; border-radius: 7px; }
.icon-btn { border: 0; background: none; cursor: pointer; color: var(--faint); padding: .3rem; border-radius: 6px; display: inline-flex; line-height: 1; }
.icon-btn:hover { color: var(--accent); background: var(--accent-soft); }
.link-btn { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; font-size: inherit; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

.field { display: flex; flex-direction: column; gap: .3rem; }
.field > span { font-size: .82rem; color: var(--muted); font-weight: 500; }
.field input[type=text], .field textarea, .field select { width: 100%; }
.fields { display: grid; gap: .9rem; }
.fields.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .fields.two { grid-template-columns: 1fr; } }
.check { display: flex; gap: .5rem; align-items: center; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.search { position: relative; flex: 1; min-width: 220px; }
.search input { width: 100%; padding-left: 2.1rem; min-height: 42px; border-radius: 11px; }
.search svg { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--faint); }

.seg { display: inline-flex; background: var(--sunken); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; border-radius: 8px; padding: .3rem .75rem; cursor: pointer; color: var(--muted); font-size: .88rem; font-weight: 500; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ------------------------------------------------------------ badges / avatars */
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.st-unread { color: var(--unread); background: var(--unread-bg); }
.st-reading { color: var(--reading); background: var(--reading-bg); }
.st-presented, .st-done { color: var(--presented); background: var(--presented-bg); }
.st-leave { color: var(--leave); background: var(--leave-bg); }
.st-scheduled { color: var(--accent); background: var(--accent-soft); }
.read-toggle { cursor: pointer; border: 0; }
.read-toggle:hover { filter: brightness(.96); }
.read-1 { color: var(--presented); background: var(--presented-bg); }
.read-0 { color: var(--unread); background: var(--unread-bg); }
.tag { font-size: .72rem; font-weight: 600; padding: .05rem .45rem; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; }

.avatar { --s: 32px; width: var(--s); height: var(--s); flex: 0 0 var(--s); border-radius: 50%; display: inline-grid; place-items: center;
  color: #fff; font-weight: 650; font-size: calc(var(--s) * .44); background: var(--faint); }
.avatar.xs { --s: 24px; }
.avatar.lg { --s: 44px; }
.avatar.xl { --s: 56px; }

/* ------------------------------------------------------------ overview: meeting cards */
.meet-grid, .member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1rem; }
.meet { display: flex; flex-direction: column; gap: .75rem; padding: 1.1rem 1.15rem; position: relative; }
.meet.is-me { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.meet-head { display: flex; align-items: center; gap: .6rem; }
.meet-name { color: var(--ink); font-weight: 650; }
.meet-when { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.meet-date { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; letter-spacing: -.01em; }
.meet-rel { color: var(--muted); font-size: .88rem; }
.meet-rel .soon { color: var(--reading); font-weight: 600; }
.meet-title { font-size: .85rem; color: var(--muted); margin-top: -.5rem; }
.meet-paper { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; font-size: .9rem; }
.meet-paper .lbl { display: block; font-size: .72rem; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .1rem; }
.meet-paper a { color: var(--ink); font-weight: 500; }
.meet-none { color: var(--muted); padding: .6rem 0; }
.leave-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; font-size: .85rem; }
.leave-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; color: var(--muted); }
.leave-list .when { color: var(--ink); text-decoration: line-through; text-decoration-color: var(--leave); }
.meet-foot { display: flex; gap: .4rem; margin-top: auto; padding-top: .25rem; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; align-items: baseline; }
.feed li:last-child { border-bottom: 0; }
.feed time { color: var(--faint); font-size: .8rem; white-space: nowrap; min-width: 5.5rem; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ members */
.member { display: flex; flex-direction: column; gap: .85rem; }
.member-head { display: flex; gap: .75rem; align-items: center; }
.member-head .name { font-weight: 650; font-size: 1.05rem; color: var(--ink); }
.member-head .list { font-size: .82rem; color: var(--muted); }
.member-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; text-align: center; }
.member-stats div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: .4rem .2rem; }
.member-stats b { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.member-stats span { font-size: .75rem; color: var(--muted); }
.progress { height: 6px; background: var(--sunken); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--presented); border-radius: 99px; }
.kv { display: flex; justify-content: space-between; gap: .5rem; font-size: .85rem; color: var(--muted); }
.kv b { color: var(--ink); font-weight: 500; }
.mini-list { list-style: none; padding: 0; margin: 0; font-size: .88rem; display: flex; flex-direction: column; gap: .25rem; }
.mini-list a { color: var(--ink); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list .more { color: var(--muted); font-size: .8rem; }
.member-foot { display: flex; gap: .3rem; border-top: 1px solid var(--line); padding-top: .7rem; margin-top: auto; flex-wrap: wrap; }

/* ------------------------------------------------------------ paper list */
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.plist { list-style: none; margin: 0; padding: 0; }
.prow { display: grid; grid-template-columns: minmax(0, 1fr) 110px 140px 150px 120px; gap: 1rem; align-items: center;
  padding: .85rem 1.25rem; border-bottom: 1px solid var(--line); }
.prow:last-child { border-bottom: 0; }
.prow:hover { background: var(--surface-2); }
.prow.head { padding-top: .6rem; padding-bottom: .6rem; font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); font-weight: 650; background: var(--surface-2); }
.prow.head:hover { background: var(--surface-2); }
.ptitle a { color: var(--ink); font-weight: 600; }
.ptitle .meta { color: var(--muted); font-size: .82rem; margin-top: .1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner { display: flex; align-items: center; gap: .45rem; font-size: .9rem; min-width: 0; }
.owner a { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pwhen { font-size: .86rem; font-variant-numeric: tabular-nums; }
.pact { display: flex; gap: .35rem; justify-content: flex-end; flex-wrap: wrap; }
.lbl-m { display: none; }
@media (max-width: 860px) {
  .prow.head { display: none; }
  .prow { grid-template-columns: 1fr auto; gap: .45rem .75rem; }
  .prow .ptitle { grid-column: 1 / -1; }
  .prow .pwhen { grid-column: 1 / -1; }
  .lbl-m { display: inline; color: var(--faint); font-size: .8rem; margin-right: .3rem; }
}

/* ------------------------------------------------------------ paper detail */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; align-items: start; }
@media (max-width: 900px) { .detail { grid-template-columns: 1fr; } }
.paper-title { font-size: 1.75rem; }
.paper-meta { color: var(--muted); margin-top: .45rem; }
.paper-link { font-size: .88rem; word-break: break-all; margin-top: .35rem; }
.controls { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-end; margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.history { list-style: none; padding: 0; margin: 0; font-size: .88rem; }
.history li { padding: .45rem 0; border-bottom: 1px solid var(--line); display: flex; gap: .75rem; }
.history li:last-child { border-bottom: 0; }
.history time { color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; font-size: .82rem; }
.people { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.people li { display: flex; align-items: center; gap: .55rem; }
.people a { color: var(--ink); flex: 1; }
.agenda { list-style: none; margin: 0; padding: 0; }
.agenda li { display: flex; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; font-size: .9rem; }
.agenda li:last-child { border-bottom: 0; }
.agenda .when { font-variant-numeric: tabular-nums; color: var(--muted); }
.match-box { border: 1px solid var(--line); border-radius: 11px; padding: .75rem .9rem; margin-top: .25rem; font-size: .9rem; }
.match-box.exact { border-color: color-mix(in srgb, var(--reading) 40%, var(--line)); background: var(--reading-bg); }
.match-box.similar { background: var(--surface-2); }
.match-box ul { margin: .4rem 0 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .35rem; }

/* ------------------------------------------------------------ tabs */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin: -.25rem 0 1rem; }
.tabs button { border: 0; background: none; padding: .55rem .85rem; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 500; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }

/* ------------------------------------------------------------ calendar */
.cal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.cal-month { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; min-width: 9.5rem; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-wd { padding: .5rem .6rem; font-size: .75rem; font-weight: 650; color: var(--faint); text-transform: uppercase; letter-spacing: .06em;
  background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cal-cell { min-height: 118px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: .35rem .35rem .5rem;
  display: flex; flex-direction: column; gap: 3px; cursor: pointer; transition: background .12s; min-width: 0; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell:hover { background: var(--surface-2); }
.cal-cell.out { background: var(--sunken); }
.cal-cell.out .cal-day { color: var(--faint); }
.cal-cell.weekend .cal-day { color: var(--muted); }
.cal-day { font-size: .82rem; font-weight: 600; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-variant-numeric: tabular-nums; }
.cal-cell.today .cal-day { background: var(--accent); color: var(--on-accent); }
.cal-cell .add-hint { display: none; margin-left: auto; color: var(--faint); font-size: .9rem; line-height: 1; }
.cal-cell:hover .add-hint { display: block; }
.cal-top { display: flex; align-items: center; }
.ev { --u: var(--accent); display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--u); cursor: pointer;
  background: color-mix(in srgb, var(--u) 12%, var(--surface)); border-radius: 5px; padding: .2rem .4rem; font-size: .76rem; line-height: 1.3; min-width: 0; }
.ev:hover { background: color-mix(in srgb, var(--u) 22%, var(--surface)); }
.ev .t { font-weight: 650; font-variant-numeric: tabular-nums; }
.ev .n { font-weight: 500; }
.ev .p { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev .l1 { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev.leave { background: repeating-linear-gradient(135deg, var(--leave-bg), var(--leave-bg) 4px, var(--surface) 4px, var(--surface) 8px); border-left-color: var(--leave); }
.ev.leave .l1 { text-decoration: line-through; color: var(--muted); }
.ev.done { opacity: .6; }
.cal-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .82rem; color: var(--muted); margin-top: .8rem; }
.cal-legend span { display: inline-flex; align-items: center; gap: .35rem; }
@media (max-width: 720px) {
  .cal-cell { min-height: 74px; padding: .2rem; }
  .cal-wd { padding: .4rem .2rem; text-align: center; }
  .ev { padding: .1rem .2rem; font-size: .68rem; }
  .ev .p, .ev .n { display: none; }
  .cal-day { width: 22px; height: 22px; font-size: .75rem; }
}

/* ------------------------------------------------------------ modal / toast */
dialog.modal { border: 0; padding: 0; border-radius: 16px; background: var(--surface); color: var(--ink); width: min(520px, calc(100vw - 32px));
  box-shadow: var(--shadow-lg); max-height: calc(100vh - 48px); }
dialog.modal::backdrop { background: rgba(15, 12, 6, .45); backdrop-filter: blur(2px); }
.modal-body { padding: 1.4rem 1.5rem 1.25rem; display: flex; flex-direction: column; gap: .9rem; }
.modal-body h2 { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; margin: 0; display: flex; align-items: center; gap: .5rem; }
.modal-body input[type=password] { width: 100%; }
.modal-actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; padding-top: .4rem; }
.modal-actions .left { margin-right: auto; display: flex; gap: .4rem; flex-wrap: wrap; }
.weekdays { display: flex; gap: .3rem; flex-wrap: wrap; }
.weekdays label { border: 1px solid var(--line-strong); border-radius: 8px; width: 38px; height: 34px; display: grid; place-items: center; cursor: pointer; user-select: none; font-size: .9rem; }
.weekdays input { position: absolute; opacity: 0; pointer-events: none; }
.weekdays label:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.err { color: var(--danger); min-height: 1.2em; margin: 0; font-size: .9rem; }
#toast { position: fixed; bottom: 1.4rem; left: 50%; transform: translate(-50%, 8px); background: var(--ink); color: var(--surface);
  padding: .6rem 1.1rem; border-radius: 10px; opacity: 0; transition: opacity .18s, transform .18s; pointer-events: none;
  max-width: calc(100vw - 32px); z-index: 50; font-size: .92rem; box-shadow: var(--shadow-lg); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--danger); color: #fff; }

/* ------------------------------------------------------------ v3 additions */
.status-pill { appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px; min-height: 0; padding: .14rem 1.5rem .14rem .65rem;
  font-size: .8rem; font-weight: 600; cursor: pointer; max-width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .5rem center; }
.status-pill.st-unread { background-color: var(--unread-bg); }
.status-pill.st-reading { background-color: var(--reading-bg); }
.status-pill.st-presented { background-color: var(--presented-bg); }
.status-pill:hover { filter: brightness(.96); }
.status-pill option { color: var(--ink); background: var(--surface); }
.mine { display: inline-flex; align-items: center; gap: .3rem; }
.choice-list { display: flex; flex-direction: column; gap: .5rem; }
.choice { display: flex; gap: .7rem; align-items: flex-start; padding: .7rem .85rem; border: 1px solid var(--line-strong); border-radius: 11px; cursor: pointer; }
.choice:hover { background: var(--surface-2); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { margin-top: .25rem; accent-color: var(--accent); }
.choice > span { display: flex; flex-direction: column; gap: .1rem; }
.choice > span > span { font-size: .85rem; color: var(--muted); }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-solid:hover { filter: brightness(.92); background: var(--danger); }
.prow.inset { padding-left: 0; padding-right: 0; }
.prow.cols-list { grid-template-columns: minmax(0, 1fr) 100px 130px 100px auto; }
.prow.cols-owned { grid-template-columns: minmax(0, 1fr) 100px 170px 90px; }
@media (max-width: 860px) { .prow.cols-list, .prow.cols-owned { grid-template-columns: 1fr auto; } }
/* ------------------------------------------------------------ v4: 正在看 / 想要看 */
.prow.cols-papers { grid-template-columns: minmax(0, 1fr) 100px 125px 115px 95px 150px; }
.prow.cols-user { grid-template-columns: minmax(0, 1fr) 110px 130px auto; }
@media (max-width: 860px) { .prow.cols-papers, .prow.cols-user { grid-template-columns: 1fr auto; } }
.seg.mini { padding: 2px; border-radius: 8px; }
.seg.mini button { padding: .12rem .5rem; font-size: .78rem; border-radius: 6px; }
.mine-tag { display: inline-block; font-size: .78rem; font-weight: 650; color: var(--reading); background: var(--reading-bg); padding: .12rem .55rem; border-radius: 7px; }
.stack { display: inline-flex; align-items: center; }
.stack .avatar { border: 2px solid var(--surface); margin-left: -6px; }
.stack .avatar:first-child { margin-left: 0; }
.stack .faint { margin-left: .3rem; }
.meet-paper .mini-list { margin-top: .2rem; }
.mine-seg button.on.v-none { color: var(--muted); }
.mine-seg button.on.v-want { color: var(--accent); }
.mine-seg button.on.v-read { color: var(--presented); }
/* ------------------------------------------------------------ PDF */
.pdf-link { display: inline-flex; align-items: center; gap: .2rem; margin-left: .45rem; padding: .05rem .4rem; border-radius: 6px;
  font-size: .72rem; font-weight: 650; line-height: 1.35; color: var(--danger); background: var(--danger-bg); vertical-align: middle; }
.pdf-link svg { width: 12px; height: 12px; flex: 0 0 auto; }
.pdf-link:hover { text-decoration: none; filter: brightness(.95); }
.pdf-box { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-top: 1rem; padding: .75rem .9rem;
  border: 1px dashed var(--line-strong); border-radius: 11px; background: var(--surface-2); }
.pdf-box.drag { border-color: var(--accent); background: var(--accent-soft); }
.pdf-box .btn svg { flex: 0 0 auto; }
.pdf-name { font-weight: 500; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
