:root {
  --bg: #ffffff; --panel: #ffffff; --text: #111111; --muted: #6e6e6e; --line: #e4e4e4;
  --accent: #111111; --accent-ink: #ffffff; --soft: #f4f4f4; --outlook: #8a8a8a; --danger: #c0392b; --today: #f6f6f6;
  --shadow: none;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 6px 12px; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.ghost { background: transparent; }
button.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 7px 9px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.sync { color: var(--muted); font-size: 12px; margin-right: 4px; }
.sync.err { color: var(--danger); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; padding: 16px; max-width: 1500px; margin: 0 auto; }
.cal-wrap, .todos { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.cal-wrap { padding: 12px; min-width: 0; }
.todos { padding: 14px; align-self: start; position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; }
.todos h2 { margin: 0 0 10px; font-size: 16px; }
.todo-add { display: grid; gap: 6px; margin-bottom: 10px; }
.todos ul { list-style: none; margin: 0; padding: 0; }
.todos li { display: flex; gap: 8px; align-items: flex-start; padding: 7px 2px; border-bottom: 1px solid var(--line); }
.todos li input[type=checkbox] { width: auto; margin-top: 4px; }
.todos li .t { flex: 1; min-width: 0; word-break: break-word; }
.todos li .due { display: block; font-size: 12px; color: var(--muted); }
.todos li .due.late { color: var(--danger); }
.todos li .x { border: none; background: none; color: var(--muted); padding: 0 4px; visibility: hidden; }
.todos li:hover .x { visibility: visible; }
#doneList li .t { text-decoration: line-through; color: var(--muted); }
details summary { cursor: pointer; color: var(--muted); margin-top: 12px; font-size: 13px; }

/* FullCalendar 主题 */
.fc { --fc-border-color: var(--line); --fc-page-bg-color: var(--panel); --fc-neutral-bg-color: var(--soft);
      --fc-today-bg-color: var(--today); --fc-event-bg-color: var(--accent); --fc-event-border-color: var(--accent);
      --fc-button-bg-color: var(--panel); --fc-button-text-color: var(--text); --fc-button-border-color: var(--line);
      --fc-button-hover-bg-color: var(--soft); --fc-button-hover-border-color: var(--line);
      --fc-button-active-bg-color: var(--accent); --fc-button-active-border-color: var(--accent);
      --fc-list-event-hover-bg-color: var(--soft); }
.fc .fc-button-primary:not(:disabled).fc-button-active { color: var(--accent-ink); }
.fc .fc-toolbar-title { font-size: 18px; }
.fc .fc-toolbar { flex-wrap: wrap; gap: 8px; }
.fc-event.src-outlook { --fc-event-bg-color: var(--outlook); --fc-event-border-color: var(--outlook); }
.fc-daygrid-dot-event.src-outlook .fc-daygrid-event-dot { border-color: var(--outlook); }
.fc a { color: inherit; text-decoration: none; }

dialog { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text);
         width: min(460px, calc(100vw - 32px)); padding: 18px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(10,14,25,.45); }
dialog h3 { margin: 0 0 12px; }
dialog label { display: block; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
dialog label input, dialog label select, dialog label textarea { margin-top: 4px; color: var(--text); }
.row-check { display: flex !important; align-items: center; gap: 6px; }
.row-check input { width: auto; margin: 0 !important; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dlg-actions { display: flex; gap: 8px; align-items: center; margin-top: 14px; }
.spacer { flex: 1; }
.src-note { background: var(--soft); padding: 6px 10px; border-radius: 8px; font-size: 13px; color: var(--muted); }
.copy-row { display: flex; gap: 6px; margin-top: 4px; }
.copy-row input { margin-top: 0 !important; font-size: 12px; }
.muted { color: var(--muted); font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--panel);
         padding: 8px 16px; border-radius: 20px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: .92; }

.login-page { display: grid; place-items: center; padding: 16px; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px 24px;
              width: min(320px, 100%); display: grid; gap: 12px; text-align: center; box-shadow: var(--shadow); }
.login-card img { margin: 0 auto; }
.login-card h1 { margin: 0 0 6px; font-size: 22px; }
.login-card .err { color: var(--danger); margin: 0; min-height: 1.2em; font-size: 13px; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; padding: 10px 16px; }
  .todos { position: static; max-height: none; }
  .sync { display: none; }
  .fc .fc-toolbar-title { font-size: 16px; }
  .row2 { grid-template-columns: 1fr; }
}

/* 黑白风格细节 */
.fc .fc-day-today .fc-daygrid-day-number { background: var(--text); color: var(--panel); border-radius: 50%; min-width: 26px; text-align: center; }
.fc .fc-daygrid-day-number, .fc .fc-col-header-cell-cushion { color: var(--text); }
.fc .fc-daygrid-day:hover { background: var(--soft); cursor: pointer; }
.fc-event.src-outlook { color: #fff; }
.fc-daygrid-event.src-outlook:not(.fc-daygrid-block-event) { color: var(--muted); }
.fc .fc-list-day-cushion { background: var(--soft); }
.top { border-bottom: 1px solid var(--text); }
.brand span { letter-spacing: .06em; }
.brand img, .login-card img { border-radius: 50%; }
dialog::backdrop { background: rgba(0,0,0,.35); }

/* 顶部导航 */
.nav { display: flex; gap: 4px; margin-right: auto; margin-left: 16px; }
.nav a { color: var(--muted); text-decoration: none; padding: 5px 10px; border-radius: 8px; }
.nav a.on { color: var(--text); font-weight: 600; background: var(--soft); }

/* 机器人设置页 */
.bots-page { max-width: 820px; margin: 0 auto; padding: 16px; }
.bot-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.bot-tabs button { border-radius: 20px; padding: 6px 16px; }
.bot-tabs button.on { background: var(--text); color: var(--panel); border-color: var(--text); }
.status-line { color: var(--muted); font-size: 13px; margin: 10px 2px 14px; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; background: var(--panel); }
.card h2 { font-size: 16px; margin: 0 0 10px; }
.card label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.card label input, .card label select, .card label textarea { margin-top: 4px; color: var(--text); }
.card input[type=range] { padding: 0; accent-color: var(--text); }
.card textarea { font-size: 14px; line-height: 1.6; resize: vertical; }
.card b { color: var(--text); font-weight: 600; }
.hint { color: var(--muted); font-size: 12px; margin: 0 0 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 12px; }
.row-end { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.row-end input { width: auto; flex: 1; min-width: 140px; }
.row-end .hint { margin: 0; margin-right: auto; }
.btn-end { display: flex; align-items: flex-end; padding-bottom: 12px; }
button:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 640px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .nav { margin-left: 8px; }
  .brand span { display: none; }
}

.voice-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 16px; }
.voice-bar .status-line { margin: 0; color: var(--text); font-size: 14px; }

/* 用量页 */
.usage-page { max-width: 960px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.tile { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--panel); }
.tile-title { font-size: 12px; color: var(--muted); }
.tile-value { font-size: 26px; font-weight: 700; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.tile-sub { font-size: 12px; color: var(--muted); line-height: 1.4; }
.meter { height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; margin-bottom: 6px; }
.meter-fill { height: 100%; background: var(--text); border-radius: 3px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.card-head .hint { margin: 0; }
.bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 2px; height: 140px; align-items: end;
        border-bottom: 1px solid var(--line); margin-top: 8px; }
.bar-col { height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: default; }
.bar-col:hover { background: var(--soft); }
.bar { width: min(70%, 28px); background: var(--text); border-radius: 4px 4px 0 0; }
.bar-axis { display: grid; grid-template-columns: repeat(14, 1fr); font-size: 11px; color: var(--muted); text-align: center; margin-top: 4px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 10px; }
.seg button { border: none; border-radius: 0; padding: 5px 12px; background: var(--panel); }
.seg button.on { background: var(--text); color: var(--panel); }
.table-wrap { overflow-x: auto; }
.utable { width: 100%; border-collapse: collapse; font-size: 13px; }
.utable th { text-align: left; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); padding: 6px 8px; white-space: nowrap; }
.utable td { border-bottom: 1px solid var(--line); padding: 7px 8px; white-space: nowrap; }
.utable td.n { text-align: right; font-variant-numeric: tabular-nums; }
.utable th:nth-child(n+4) { text-align: right; }
.utable td.bad { color: var(--danger); font-weight: 600; }
.utable td.empty { text-align: center; color: var(--muted); padding: 18px; }
.tip { position: fixed; z-index: 20; background: var(--text); color: var(--panel); font-size: 12px; padding: 6px 9px;
       border-radius: 6px; white-space: pre; pointer-events: none; }
@media (max-width: 760px) { .tile-value { font-size: 22px; } }
@media (max-width: 420px) { .tiles { grid-template-columns: 1fr; } }

/* 正在做 */
.doing-strip { display: block; max-width: 1500px; margin: 12px auto 0; padding: 9px 16px; border: 1px solid var(--line); border-radius: 10px;
               color: var(--text); text-decoration: none; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doing-strip:hover { background: var(--soft); }
@media (min-width: 861px) { .doing-strip { margin: 12px 16px 0; } }
.doing-page { max-width: 860px; }
.doing-add { display: grid; grid-template-columns: 2fr 3fr; gap: 8px; margin-bottom: 12px; }
.doing-list { display: grid; gap: 10px; }
.doing-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 8px; }
.doing-card.st-paused { background: var(--soft); }
.doing-card.st-done .doing-title { text-decoration: line-through; color: var(--muted); }
.doing-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.doing-title { font-weight: 600; }
.doing-meta { font-size: 12px; color: var(--muted); }
.doing-note { font-size: 13px; color: var(--muted); }
.doing-sugg { font-size: 13px; background: var(--soft); border-radius: 8px; padding: 7px 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.doing-sugg button { padding: 3px 10px; font-size: 13px; }
.doing-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.doing-acts button { padding: 4px 10px; font-size: 13px; }
.sess-list { display: grid; gap: 8px; }
.sess { border-bottom: 1px solid var(--line); padding: 8px 2px 10px; }
.sess-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.sess-title { font-weight: 600; }
.sess-meta { font-size: 12px; color: var(--muted); margin: 2px 0 4px; overflow-wrap: anywhere; }
.sess-line { font-size: 13px; }
.sess-line.muted { color: var(--muted); }
.badge { font-size: 12px; border-radius: 20px; padding: 2px 9px; border: 1px solid var(--line); white-space: nowrap; }
.badge.wait { background: var(--text); color: var(--panel); border-color: var(--text); }
.badge.open { border-color: var(--text); }
.badge.idle { color: var(--muted); }
a.btn { display: inline-block; text-decoration: none; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; }
#tokenRow { margin-top: 10px; }
@media (max-width: 640px) { .doing-add { grid-template-columns: 1fr; } }

/* 位置标签：醒目、带文字（不只靠颜色） */
.loc { display: inline-block; font-size: 12px; font-weight: 700; line-height: 1; padding: 4px 8px; border-radius: 6px;
       color: #fff; background: #5f6673; vertical-align: 2px; margin-right: 4px; letter-spacing: .02em; }
.loc[data-loc="本机"] { background: #1f5fd6; }
.loc[data-loc="工作站"] { background: #b4470f; }
.loc[data-loc="服务器"] { background: #111111; }
.loc[data-loc="浏览器"] { background: #157a3c; }
.loc[data-loc="本机临时"] { background: #6b5bd2; }
.loc[data-loc=""] { background: transparent; color: var(--muted); border: 1px dashed var(--line); font-weight: 500; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.chip { border-radius: 20px; padding: 5px 14px; font-weight: 600; }
.chip.on { background: var(--text); color: var(--panel); border-color: var(--text); }
.chip[data-loc]:not(.on)::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; background: #5f6673; }
.chip[data-loc="本机"]:not(.on)::before { background: #1f5fd6; }
.chip[data-loc="工作站"]:not(.on)::before { background: #b4470f; }
.chip[data-loc="服务器"]:not(.on)::before { background: #111111; }
.chip[data-loc="浏览器"]:not(.on)::before { background: #157a3c; }
.chip[data-loc="本机临时"]:not(.on)::before { background: #6b5bd2; }
.scan-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.scan-info { display: grid; gap: 3px; min-width: 0; }
.scan-info .hint { margin: 0; }
.scan-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.loc-sel { width: auto; padding: 3px 6px; font-size: 13px; }
.doing-add { grid-template-columns: 2fr 3fr 1.2fr; }
#rules { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }

/* 投稿 */
.sub-page { max-width: 860px; }
.sub-add { display: grid; grid-template-columns: 2fr 1fr 2fr auto; gap: 8px; }
.sub-list { display: grid; gap: 14px; margin-bottom: 14px; }
.sub-card { margin-bottom: 0; display: grid; gap: 4px; }
.sub-card.st-accepted { border-color: #157a3c; }
.sub-card.st-rejected, .sub-card.st-withdrawn { opacity: .7; }
.sub-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 8px; }
.sub-left { min-width: 0; }
.sub-venue { font-size: 20px; font-weight: 700; }
.sub-paper { color: var(--muted); margin-top: 2px; }
.sub-count { text-align: right; flex: none; }
.sub-days { font-size: 34px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.sub-days.urgent { color: var(--danger); }
.sub-days.past, .sub-days.none { color: var(--muted); font-size: 22px; }
.sub-unit { font-size: 14px; font-weight: 600; }
.sub-dl { font-size: 12px; color: var(--muted); margin-top: 4px; }
.sub-steps { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.step { font-size: 12px; padding: 3px 9px; border-radius: 20px; color: var(--muted); }
.step.on { background: var(--text); color: var(--panel); border-color: var(--text); font-weight: 600; }
.sub-field { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.sub-field input, .sub-field textarea { margin-top: 3px; color: var(--text); }
details.card > summary { color: var(--muted); }
@media (max-width: 640px) { .sub-add { grid-template-columns: 1fr; } .sub-head { flex-direction: column; } .sub-count { text-align: left; } }

/* ---------- 事项 ---------- */
.threads-box { margin-bottom: 16px; }
.th-head { display: flex; align-items: center; justify-content: space-between; }
.th-head h2 { margin: 0 0 8px; }
button.small { padding: 2px 9px; font-size: 14px; }
.thread-list { list-style: none; margin: 0; padding: 0; }
.todos li.thread-item { cursor: pointer; border-left: 4px solid var(--c); padding-left: 8px; border-radius: 4px; }
.todos li.thread-item:hover { background: color-mix(in srgb, var(--c) 8%, transparent); }
.th-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; margin-top: 6px; }
.thread-item .th-dot { display: none; }
.th-dot.big { width: 16px; height: 16px; margin: 0; }
.thread-dlg { width: min(560px, 94vw); }
.th-title-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.th-title-input { font-size: 18px; font-weight: 600; border: none; border-bottom: 2px solid var(--c); border-radius: 0; padding: 4px 2px; }
.swatches { display: flex; gap: 8px; margin-bottom: 10px; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; padding: 0; cursor: pointer; }
.swatch.on { outline: 2px solid var(--text); outline-offset: 2px; }
.timeline { list-style: none; margin: 14px 0; padding: 0 0 0 14px; border-left: 2px solid var(--c); max-height: 52vh; overflow: auto; }
.tl-step { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 8px 4px 8px 6px; border-radius: 6px; }
.tl-step::before { content: ''; position: absolute; left: -21px; top: 13px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--panel); border: 2px solid var(--c); }
.tl-step.done::before { background: var(--c); }
.tl-step input { width: auto; margin-top: 3px; }
.tl-main { flex: 1; min-width: 0; }
.tl-when { font-size: 12px; color: var(--muted); font-weight: 600; }
.tl-title { word-break: break-word; }
.tl-notes { font-size: 12px; color: var(--muted); white-space: pre-wrap; }
.tl-step.done .tl-title { text-decoration: line-through; color: var(--muted); }
.tl-step.late .tl-when { color: var(--danger); }
.tl-step.focus { background: color-mix(in srgb, var(--c) 12%, transparent); }
.tl-step .x { border: none; background: none; color: var(--muted); visibility: hidden; }
.tl-step:hover .x { visibility: visible; }
.tl-today { font-size: 12px; color: var(--c); font-weight: 700; margin: 4px 0 4px -14px; padding-left: 8px; border-top: 1px dashed var(--c); padding-top: 4px; }
.th-add { display: grid; grid-template-columns: 140px 140px 1fr; gap: 6px; }
@media (max-width: 600px) { .th-add { grid-template-columns: 1fr 1fr; } .th-add #stTitle { grid-column: 1 / -1; } }
.th-note { color: var(--muted); }
.fc .step-done { opacity: .5; text-decoration: line-through; }

/* ---------- 投稿：进度和小事 ---------- */
.sub-tasks { margin: 12px 0; padding: 10px 12px; background: var(--soft); border-radius: 10px; }
.sub-tasks-head { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.sub-bar { flex: 1; max-width: 220px; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.sub-bar span { display: block; height: 100%; background: #7048e8; }
.task-list { list-style: none; margin: 0; padding: 0; }
.task-list li { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.task-list li input[type=checkbox] { width: auto; }
.task-list .tt { flex: 1; min-width: 0; word-break: break-word; cursor: text; }
.task-list .due-t { font-size: 12px; color: var(--muted); white-space: nowrap; }
.task-list li.late .due-t { color: var(--danger); }
.task-list li.done .tt { text-decoration: line-through; color: var(--muted); }
.task-list .task-due { width: 132px; padding: 3px 6px; font-size: 12px; opacity: .55; }
.task-list li:hover .task-due { opacity: 1; }
.task-list .x { border: none; background: none; color: var(--muted); padding: 0 4px; visibility: hidden; }
.task-list li:hover .x { visibility: visible; }
.task-add { display: grid; grid-template-columns: 1fr 140px; gap: 6px; margin-top: 8px; }
.sub-card.flash { outline: 3px solid #7048e8; outline-offset: 2px; }

/* ---------- 任务（主线 / 支线） ---------- */
.q-add { display: grid; grid-template-columns: 90px 90px 1fr 150px auto; gap: 8px; }
@media (max-width: 640px) { .q-add { grid-template-columns: 1fr 1fr; } .q-add #aTitle { grid-column: 1 / -1; } }
.q-sec { font-size: 15px; margin: 18px 2px 10px; }
.q-card { border-left: 5px solid var(--c); }
.q-badges { display: inline-flex; gap: 4px; margin-bottom: 4px; }
.q-badge { font-size: 11px; padding: 1px 8px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); }
.q-badge.main { background: var(--c, #111); color: #fff; border-color: transparent; }
.q-badge.side { border-color: var(--c); color: var(--text); }
.editable { cursor: text; }
.editable:hover { background: var(--soft); border-radius: 4px; }
.ghost-text { opacity: .45; font-size: 12px; }
.inline-edit { font: inherit; padding: 2px 6px; }
.q-card .timeline, .q-row .timeline { max-height: none; border-left-color: var(--c); }
.tl-tools { display: flex; gap: 6px; align-items: center; margin-top: 4px; opacity: 0; transition: opacity .15s; }
.tl-step:hover .tl-tools, .tl-tools:focus-within { opacity: 1; }
.tl-tools input { width: 132px; padding: 2px 6px; font-size: 12px; }
.tl-tools .hint { margin: 0; }
.tl-step .tl-tools .x { visibility: visible; }
.q-settings { margin-top: 10px; font-size: 13px; }
.q-settings summary { color: var(--muted); cursor: pointer; }
.q-set-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.q-set-row select { width: auto; }
.q-side-list { display: grid; gap: 8px; margin-bottom: 14px; }
.q-row { border: 1px solid var(--line); border-left: 5px solid var(--c); border-radius: 10px; background: var(--panel); }
.q-row-head { display: flex; gap: 10px; align-items: center; padding: 10px 12px; cursor: pointer; }
.q-row-head input[type=checkbox] { width: auto; }
.q-row-mid { flex: 1; min-width: 0; }
.q-row-title { font-weight: 600; word-break: break-word; }
.q-row-sub { font-size: 12px; color: var(--muted); display: flex; gap: 8px; }
.q-prog { font-weight: 700; color: var(--text); }
.q-next.late, .q-row.late .q-next { color: var(--danger); }
.q-row-body { padding: 0 14px 12px 14px; border-top: 1px dashed var(--line); }
.q-row-name { font-size: 17px; font-weight: 700; margin: 10px 0 0; }
.q-row.flash, .q-card.flash { outline: 3px solid var(--c); outline-offset: 2px; }

/* ---------- 日历侧栏：近期 DDL ---------- */
.ddl-list { list-style: none; margin: 0; padding: 0; }
.todos li.ddl { border-left: 4px solid var(--c); padding-left: 8px; border-radius: 3px; }
.todos li.ddl a.t { color: var(--text); text-decoration: none; }
.todos li.ddl a.t:hover span:first-child { text-decoration: underline; }
.ddl-q { display: block; font-size: 12px; color: var(--muted); }
.ddl-flag { width: 16px; text-align: center; }
.th-head a.hint { margin: 0; text-decoration: none; }

/* ---------- 提醒页 ---------- */
.rules-list { margin: 0 0 12px 18px; padding: 0; font-size: 13px; line-height: 1.9; }
.rules-list select { width: auto; padding: 2px 6px; }
.rem-add { display: grid; grid-template-columns: 1fr 200px auto; gap: 8px; }
@media (max-width: 640px) { .rem-add { grid-template-columns: 1fr; } }
.rem-day { font-size: 12px; font-weight: 700; color: var(--muted); margin: 12px 0 4px; }
.rem { display: flex; gap: 10px; align-items: center; padding: 7px 4px 7px 10px; border-left: 4px solid var(--c, var(--line)); border-bottom: 1px solid var(--line); }
.rem-time { width: 190px; flex: none; padding: 3px 6px; font-size: 13px; }
.rem-mid { flex: 1; min-width: 0; }
.rem-msg { word-break: break-word; }
.rem-meta { font-size: 12px; color: var(--muted); }
.rem-meta a { color: var(--muted); }
.rem.off .rem-msg, .rem.gone .rem-msg { text-decoration: line-through; color: var(--muted); }
.rem .x { border: none; background: none; color: var(--muted); }
@media (max-width: 640px) { .rem { flex-wrap: wrap; } .rem-time { width: 100%; } }

/* ---------- 任务日志（游戏任务界面风格：粗边框、硬阴影、小号字距标签） ---------- */
.ql { display: grid; grid-template-columns: 340px 1fr; gap: 18px; max-width: 1180px; margin: 0 auto; padding: 18px 16px 40px; align-items: start; }
.panel { background: var(--panel); border: 2px solid var(--text); border-radius: 6px; box-shadow: 4px 4px 0 var(--text); }
.ql-list { position: sticky; top: 70px; max-height: calc(100vh - 90px); display: flex; flex-direction: column; overflow: hidden; }
.ql-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 2px solid var(--text); }
.ql-tab { border: none; border-radius: 0; background: var(--panel); padding: 10px 4px; font-weight: 700; font-size: 13px; letter-spacing: .04em; color: var(--muted); }
.ql-tab + .ql-tab { border-left: 2px solid var(--text); }
.ql-tab.on { background: var(--text); color: var(--panel); }
.ql-entries { overflow: auto; flex: 1; padding: 6px 0; }
.ql-group { font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--muted); padding: 10px 14px 4px; }
.ql-entry { display: grid; grid-template-columns: 18px 1fr auto; gap: 2px 8px; align-items: start; width: 100%; text-align: left;
  border: none; border-radius: 0; background: none; padding: 9px 14px; border-left: 4px solid transparent; cursor: pointer; }
.ql-entry:hover { background: var(--soft); }
.ql-entry.on { background: color-mix(in srgb, var(--c) 10%, var(--panel)); border-left-color: var(--c); }
.ql-mark { color: var(--c); font-size: 14px; line-height: 1.35; }
.ql-entry-mid { min-width: 0; display: flex; flex-direction: column; }
.ql-entry-title { font-weight: 600; line-height: 1.35; word-break: break-word; }
.ql-entry.on .ql-entry-title { font-weight: 800; }
.ql-entry-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ql-chip { font-size: 11px; font-weight: 700; border: 1.5px solid var(--text); border-radius: 3px; padding: 0 5px; line-height: 18px; white-space: nowrap; }
.ql-chip.hot { background: var(--text); color: var(--panel); }
.ql-chip.late { background: var(--danger); border-color: var(--danger); color: #fff; }
.ql-chip.done { color: var(--muted); border-color: var(--line); }
.ql-mini { grid-column: 2 / 4; height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: 3px; }
.ql-mini span { display: block; height: 100%; background: var(--c); }
.ql-warn { font-size: 12px; color: var(--danger); margin: 6px 14px; }
.ql-empty { color: var(--muted); padding: 16px 14px; margin: 0; }
.ql-new { border-top: 2px solid var(--text); padding: 10px; }
.ql-new > input { border: 1.5px dashed var(--muted); }
.ql-new-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.ql-new-opts input[type=date] { grid-column: 1 / -1; }
.ql-new-opts button { grid-column: 1 / -1; }

.ql-detail { padding: 22px 26px 18px; min-height: 60vh; border-top: 8px solid var(--c, var(--text)); }
.ql-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.ql-head-left { min-width: 0; }
.ql-back { display: none; margin-bottom: 8px; }
.ql-kind { font-size: 11px; font-weight: 800; letter-spacing: .16em; color: var(--c); }
.ql-title { font-size: 26px; line-height: 1.25; margin: 4px 0 2px; word-break: break-word; }
.ql-sub { color: var(--muted); }
.ql-count { flex: none; text-align: center; border: 2px solid var(--text); border-radius: 6px; padding: 6px 12px; min-width: 86px; }
.ql-count-n { font-size: 30px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.ql-count-u { font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.ql-count-d { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ql-count.hot { background: var(--danger); border-color: var(--danger); color: #fff; }
.ql-count.hot .ql-count-d { color: #fff; }
.ql-count.past { color: var(--muted); border-color: var(--line); }
.ql-section { margin-top: 22px; }
.ql-label { font-size: 11px; font-weight: 800; letter-spacing: .16em; color: var(--muted); margin-bottom: 8px; white-space: pre; }
.ql-track { display: flex; flex-wrap: wrap; gap: 0; align-items: center; }
.ql-node { position: relative; border: 2px solid var(--text); border-radius: 0; background: var(--panel); font-size: 13px; font-weight: 700; padding: 5px 14px; margin-right: -2px; color: var(--muted); }
.ql-node:first-child { border-radius: 4px 0 0 4px; }
.ql-node.past { color: var(--text); background: var(--soft); }
.ql-node.on { background: var(--c); border-color: var(--text); color: #fff; z-index: 1; }
.ql-node-more { width: auto; margin-left: 10px; padding: 4px 8px; font-size: 12px; }
.ql-now { margin-top: 20px; border: 2px solid var(--c); border-radius: 6px; padding: 12px 14px; background: color-mix(in srgb, var(--c) 7%, var(--panel)); }
.ql-now.late { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 7%, var(--panel)); }
.ql-now .ql-label { color: var(--c); margin-bottom: 4px; }
.ql-now.late .ql-label { color: var(--danger); }
.ql-now-row { display: flex; gap: 14px; align-items: center; }
.ql-now-main { flex: 1; min-width: 0; }
.ql-now-title { font-size: 18px; font-weight: 800; word-break: break-word; }
.ql-now-title.muted { color: var(--muted); font-weight: 600; font-size: 15px; }
.ql-now-when { font-size: 13px; font-weight: 600; margin-top: 2px; }
.ql-now.late .ql-now-when { color: var(--danger); }
.ql-now-notes { font-size: 13px; color: var(--muted); margin-top: 4px; white-space: pre-wrap; }
.ql-done-btn { flex: none; font-weight: 800; padding: 8px 16px; }
.ql-seg { display: flex; gap: 3px; margin-bottom: 10px; }
.ql-seg span { flex: 1; height: 8px; border: 1.5px solid var(--text); border-radius: 2px; }
.ql-seg span.on { background: var(--c); }
.ql-objs { list-style: none; margin: 0; padding: 0; }
.ql-obj { display: flex; gap: 10px; align-items: flex-start; padding: 8px 4px; border-bottom: 1px dashed var(--line); }
.ql-check { flex: none; width: 24px; height: 24px; padding: 0; border: 2px solid var(--text); border-radius: 4px; background: var(--panel); font-weight: 900; line-height: 1; color: var(--c); }
.ql-obj.done .ql-check { background: var(--c); border-color: var(--c); color: #fff; }
.ql-obj.cur .ql-check { border-color: var(--c); }
.ql-obj-main { flex: 1; min-width: 0; }
.ql-obj-title { font-weight: 600; word-break: break-word; }
.ql-obj.cur .ql-obj-title { font-weight: 800; }
.ql-obj.done .ql-obj-title { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.ql-obj-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.ql-obj-date { border: none; background: none; padding: 0; font-size: 12px; font-weight: 600; color: var(--text); }
.ql-obj-date.none, .ql-obj-notes.none { color: var(--muted); opacity: 0; font-weight: 400; }
.ql-obj:hover .ql-obj-date.none, .ql-obj:hover .ql-obj-notes.none { opacity: 1; }
.ql-obj.late .ql-obj-date { color: var(--danger); }
.ql-obj.done .ql-obj-date { color: var(--muted); font-weight: 400; }
.ql-obj-notes { font-size: 12px; color: var(--muted); white-space: pre-wrap; }
.ql-date-edit { display: inline-flex; gap: 6px; align-items: center; }
.ql-date-edit input { width: 140px; padding: 2px 6px; font-size: 12px; }
.ql-x { border: none; background: none; color: var(--muted); visibility: hidden; padding: 0 4px; }
.ql-obj:hover .ql-x { visibility: visible; }
.ql-add-obj { display: grid; grid-template-columns: 1fr 150px; gap: 6px; margin-top: 8px; }
.ql-add-obj input:first-child { border-style: dashed; }
.ql-field { display: block; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.ql-field input, .ql-field textarea { margin-top: 3px; color: var(--text); }
.ql-foot { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; margin-top: 22px; padding-top: 14px; border-top: 2px solid var(--text); }
.ql-settings { margin-left: auto; font-size: 13px; }
.ql-settings summary { cursor: pointer; color: var(--muted); padding: 6px 0; }
.ql-set-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.ql-set-row select { width: auto; }
.inline-edit { font: inherit; width: 100%; }

@media (max-width: 820px) {
  .ql { grid-template-columns: 1fr; padding: 12px 12px 30px; }
  .ql-list { position: static; max-height: none; }
  .ql-detail { display: none; padding: 16px; }
  body.ql-show-detail .ql-list { display: none; }
  body.ql-show-detail .ql-detail { display: block; }
  .ql-back { display: inline-block; }
  .ql-title { font-size: 22px; }
  .ql-add-obj { grid-template-columns: 1fr; }
}
.ql-new-opts[hidden] { display: none; }
.toast-undo { margin-left: 10px; padding: 2px 10px; border: 1.5px solid currentColor; border-radius: 4px; background: transparent; color: inherit; font-weight: 700; pointer-events: auto; }
.toast.show { pointer-events: auto; }
