* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0e1116;
  --panel: #171c26;
  --panel-2: #1f2634;
  --text: #e9edf4;
  --muted: #8a94a8;
  --accent: #7c6cff;
  --urgent: #ff5d5d;
  --soon: #f0a832;
  --safe: #37c47f;
  --past: #4a5266;
  --border: #2c3548;
  --line: #232b3b;
  --radius: 14px;
  /* 投稿状态色（参考 Tailwind 开源色板；文字对芯片底色对比度均 >6:1，CVD ΔE 43.5 已验证） */
  --st-planned-bg: #22314d; --st-planned-fg: #a5c8ff;
  --st-writing-bg: #2b2350; --st-writing-fg: #c4b5fd;
  --st-submitted-bg: #3a2f14; --st-submitted-fg: #fcd34d;
  --st-rebuttal-bg: #3b1f2e; --st-rebuttal-fg: #f9a8d4;
  --st-accepted-bg: #1d3527; --st-accepted-fg: #86efac;
  --st-rejected-bg: #2a2d34; --st-rejected-fg: #b3b9c6;
}

/* 亮色主题（手动选择） */
:root[data-theme="light"] {
  --bg: #f3f5f9;
  --panel: #ffffff;
  --panel-2: #eaedf4;
  --text: #1b2231;
  --muted: #5d6880;
  --accent: #5b4be0;
  --urgent: #d92f2f;
  --soon: #8f5f04;
  --safe: #0c7a4a;
  --past: #9aa3b5;
  --border: #ccd4e2;
  --line: #dde2eb;
  --st-planned-bg: #dbeafe; --st-planned-fg: #1e40af;
  --st-writing-bg: #ede9fe; --st-writing-fg: #5b21b6;
  --st-submitted-bg: #fef3c7; --st-submitted-fg: #92400e;
  --st-rebuttal-bg: #fce7f3; --st-rebuttal-fg: #9d174d;
  --st-accepted-bg: #d1fae5; --st-accepted-fg: #065f46;
  --st-rejected-bg: #f3f4f6; --st-rejected-fg: #374151;
}

/* 跟随系统：未手动选择时按系统偏好套用亮色 */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-theme="light"]) {
    --bg: #f3f5f9;
    --panel: #ffffff;
    --panel-2: #eaedf4;
    --text: #1b2231;
    --muted: #5d6880;
    --accent: #5b4be0;
    --urgent: #d92f2f;
    --soon: #8f5f04;
    --safe: #0c7a4a;
    --past: #9aa3b5;
    --border: #ccd4e2;
    --line: #dde2eb;
    --st-planned-bg: #dbeafe; --st-planned-fg: #1e40af;
    --st-writing-bg: #ede9fe; --st-writing-fg: #5b21b6;
    --st-submitted-bg: #fef3c7; --st-submitted-fg: #92400e;
    --st-rebuttal-bg: #fce7f3; --st-rebuttal-fg: #9d174d;
    --st-accepted-bg: #d1fae5; --st-accepted-fg: #065f46;
    --st-rejected-bg: #f3f4f6; --st-rejected-fg: #374151;
  }
}

body {
  /* 显式固定 CJK 字体顺序：避免 lang 属性切换系统默认字体导致文字宽度微变、控件跳动 */
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans",
    "Segoe UI", "Microsoft YaHei", "Yu Gothic UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

header {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  padding: 20px 28px; border-bottom: 1px solid var(--line);
}
header h1 { font-size: 22px; }
header .brand p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.header-actions button {
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  padding: 9px 16px; cursor: pointer; font-size: 13px;
  text-align: center; white-space: nowrap;
}
.header-actions button:hover { filter: brightness(1.12); }
/* 主题按钮：纯图标，无文字宽度差 */
.header-actions .theme-btn {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 50%; width: 38px; height: 38px; padding: 0; font-size: 16px; line-height: 1;
}
.header-actions .theme-btn:hover { border-color: var(--accent); filter: none; }

/* 语言分段控件：两种语言的选项同时可见，宽度天然恒定 */
.seg {
  display: flex; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 20px; overflow: hidden;
}
.seg button {
  background: none; border: none; color: var(--muted);
  padding: 9px 14px; font-size: 13px; cursor: pointer;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--accent); color: #fff; }

/* 影子标签：中英文案叠放同一格，隐藏的那份把宽度撑到两者较大值，
   切换语言时控件尺寸/位置完全不变 */
.bi-wrap { display: inline-grid; justify-items: center; }
.bi-wrap > span { grid-area: 1 / 1; white-space: nowrap; }
.bi-wrap > .ghost { visibility: hidden; }

main { max-width: min(1680px, 94vw); margin: 0 auto; padding: 20px 24px 40px; }

.filters {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px;
}
.filters input[type="text"] {
  flex: 1; min-width: 340px; padding: 10px 14px; font-size: 14px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; outline: none;
}
.filters input[type="text"]:focus { border-color: var(--accent); }
.filters select {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; font-size: 13px;
  width: 168px; /* 固定宽度，切换语言时不跳动；容纳"升序/降序"完整词汇 */
}
.tag.tag-metric { background: #33261f; color: #e0a97f; border-color: #5a3f2f; }
.tag.tag-submit { background: var(--accent); color: #fff; border-color: var(--accent); text-decoration: none; font-weight: 600; }
.tag.tag-submit:hover { filter: brightness(1.12); }
.chk { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.chk .bi-wrap { justify-items: start; }

/* 多选下拉 */
.msel { position: relative; }
.msel-btn {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 26px 9px 10px;
  font-size: 13px; cursor: pointer; position: relative; white-space: nowrap;
  width: 150px; /* 固定宽度：选中项变化 / 切换语言时不跳动 */
  text-align: left; overflow: hidden; text-overflow: ellipsis;
}
.msel-btn::after {
  content: "▾"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 11px;
}
.msel-btn:hover, .msel.open .msel-btn { border-color: var(--accent); }
.msel-btn.active { color: var(--accent); font-weight: 600; }
.msel-panel {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 50;
  min-width: 160px; max-height: 320px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 6px; box-shadow: 0 10px 28px rgba(0, 0, 0, .3);
}
.msel.open .msel-panel { display: block; }
.msel-panel label {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  font-size: 13px; border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.msel-panel label:hover { background: var(--panel-2); }
.msel-panel input { accent-color: var(--accent); }
.msel-actions {
  display: flex; gap: 6px; padding: 2px 4px 6px;
  border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
.msel-actions button {
  background: none; border: none; color: var(--accent);
  font-size: 12px; padding: 4px 8px; border-radius: 6px; cursor: pointer;
}
.msel-actions button:hover { background: var(--panel-2); }
.msel-panel a {
  display: block; padding: 7px 10px; border-radius: 6px;
  font-size: 13px; color: var(--text); text-decoration: none; white-space: nowrap;
}
.msel-panel a:hover { background: var(--panel-2); }

/* 语言下拉：固定宽度，任何语言下位置不变 */
#langSel .msel-btn { width: 122px; }
.msel-panel a.cur { color: var(--accent); font-weight: 700; }
.subrow { display: flex; align-items: center; }
.subrow input { accent-color: var(--accent); margin-left: 10px; }
.subrow a { flex: 1; }
.sub-footer {
  position: sticky; bottom: -6px; display: flex; gap: 6px;
  padding: 6px 4px; margin-top: 4px;
  background: var(--panel); border-top: 1px solid var(--line);
}
.sub-footer button {
  background: none; border: none; color: var(--accent);
  font-size: 12px; cursor: pointer; padding: 3px 6px; border-radius: 6px;
}
.sub-footer button:hover { background: var(--panel-2); }
.notify-lbl { font-size: 12px; color: var(--muted); padding: 2px 6px; }
#notifySel .msel-panel { min-width: 190px; }

/* 页头的订阅下拉：宽度由影子标签决定，面板右对齐 */
.header-actions .msel-btn {
  width: auto; border-radius: 20px; background: var(--panel-2);
  color: var(--text); border: 1px solid var(--border); text-align: center;
}
.header-actions .msel-btn:hover { border-color: var(--accent); }
.header-actions .msel-panel { left: auto; right: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }

.card {
  background: var(--panel); border-radius: var(--radius); padding: 16px 18px;
  border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px;
  transition: transform .12s ease;
}
.card:hover { transform: translateY(-2px); border-color: #33405c; }
.card.past { opacity: .55; }

.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card-top h2 { font-size: 17px; }
.card-top h2 a { color: var(--text); text-decoration: none; }
.card-top h3 a:hover { color: var(--accent); }
.star { background: none; border: none; font-size: 20px; cursor: pointer; filter: grayscale(1); }
.star.on { filter: none; }

.full-name { color: var(--muted); font-size: 12px; line-height: 1.4; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 11px; border-radius: 20px; padding: 2px 10px;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--border);
}
.tag.rank-CCF-A { background: #2c1f3d; color: #c9a6ff; border-color: #4a3568; }
.tag.rank-CCF-B { background: #1f2c3d; color: #8db8ff; border-color: #35486a; }
.tag.rank-CCF-C { background: #1f3d33; color: #7fe0b8; border-color: #2f5a4b; }
.tag.rank-Non-CCF { background: #3d2f1f; color: #e0c07f; border-color: #5a482f; }
/* CORE 等级（英文界面） */
.tag.rank-Astar { background: #2c1f3d; color: #c9a6ff; border-color: #4a3568; }
.tag.rank-A { background: #1f2c3d; color: #8db8ff; border-color: #35486a; }
.tag.rank-B { background: #1f3d33; color: #7fe0b8; border-color: #2f5a4b; }
.tag.rank-C { background: #3d3a1f; color: #d8d07f; border-color: #5a552f; }
.tag.rank-Unranked { background: #3d2f1f; color: #e0c07f; border-color: #5a482f; }

.cd-label { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.cd-label.abs { color: var(--soon); font-weight: 700; }
.cd-label b { text-decoration: underline; }
.meta .abs-hot { color: var(--soon); font-weight: 600; }
.meta .abs-hot b { color: var(--soon); }
.countdown { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.countdown.urgent { color: var(--urgent); }
.countdown.soon { color: var(--soon); }
.countdown.safe { color: var(--safe); }
.countdown.done { color: var(--past); font-size: 18px; }
.countdown.rolling { color: var(--safe); font-size: 20px; }
.tag.type-journal { background: #1f333d; color: #7fc8e0; border-color: #2f4f5a; }
.tag.type-workshop { background: #2d3d1f; color: #b3d97f; border-color: #465a2f; }
.countdown small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 6px; }

.meta { font-size: 12px; color: var(--muted); line-height: 1.7; }
.meta b { color: var(--text); font-weight: 600; }
.meta .hist { font-variant-numeric: tabular-nums; }

footer { margin-top: 28px; color: var(--muted); font-size: 12px; line-height: 1.8; }
footer code { background: var(--panel-2); padding: 1px 6px; border-radius: 4px; }

.empty { grid-column: 1/-1; text-align: center; color: var(--muted); padding: 40px 0; font-size: 14px; }

/* 时间线视图 */
.timeline-wrap { grid-column: 1/-1; }
.tl-toolbar { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 10px; }
.tl-modeseg button, .tl-zoomseg button { padding: 6px 12px; font-size: 12px; }

/* 横轴模式 */
.tl-axis-scroll {
  overflow-x: auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 0 16px;
}
.tl-axis { position: relative; min-height: 120px; }
.tl-gridline { position: absolute; top: 22px; bottom: 0; border-left: 1px dashed var(--line); }
.tl-gridlbl { position: absolute; top: 2px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.tl-today { position: absolute; top: 22px; bottom: 0; border-left: 2px solid var(--accent); }
.tl-todaylbl {
  position: absolute; top: 1px; z-index: 3; /* 胶囊角标压在月份标签之上，避免文字重叠 */
  background: var(--accent); color: #fff; font-size: 10px; font-weight: 700;
  padding: 1px 8px; border-radius: 10px;
}
/* 时间轴项 = 截点刻度(+投稿窗口连线) + 短名；左边缘的刻度对齐日期，文字宽度无时间含义 */
.tl-pin {
  position: absolute; display: flex; align-items: center;
  font-size: 12px; white-space: nowrap; cursor: pointer;
  padding: 3px 6px 3px 0; font-variant-numeric: tabular-nums;
}
.tl-tick { width: 3px; height: 15px; border-radius: 2px; background: currentColor; flex: none; }
.tl-tick-abs { width: 5px; background: transparent; border: 1.5px solid currentColor; box-sizing: border-box; }
.tl-spanline { height: 2px; background: currentColor; opacity: .45; flex: none; }
.tl-name { margin-left: 5px; font-weight: 600; }
.tl-pin:hover .tl-name { text-decoration: underline; text-underline-offset: 3px; }
.tl-pin.urgent { color: var(--urgent); font-weight: 700; }
.tl-pin.soon { color: var(--soon); }
.tl-pin.safe { color: var(--text); }
.tl-tip {
  display: none; position: absolute; left: 0; top: calc(100% + 5px); z-index: 6;
  background: var(--panel); color: var(--text); border: 1px solid var(--border);
  border-radius: 9px; padding: 5px 10px; font-size: 12px; font-weight: 400;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
}
.tl-pin:hover .tl-tip { display: block; }
.tl-wk { position: absolute; top: 26px; bottom: 0; border-left: 1px dotted var(--line); opacity: .55; }
.tl-wklbl { position: absolute; top: 13px; font-size: 9.5px; color: var(--muted); opacity: .85; }

/* 页脚 Latest! 最近数据更新 */
.latest {
  margin: 12px 0 4px; padding: 10px 14px; font-size: 12.5px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
.latest b { display: block; margin-bottom: 6px; font-size: 13px; }
.lat-row { display: flex; gap: 10px; padding: 2px 0; flex-wrap: wrap; align-items: baseline; }
.lat-date { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.lat-confs { font-weight: 600; }
.lat-sub { color: var(--muted); }

.timeline { display: flex; flex-direction: column; gap: 5px; }
.tl-month { font-weight: 700; font-size: 14px; color: var(--accent); margin: 14px 0 4px; }
.tl-month:first-child { margin-top: 0; }
.tl-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; font-size: 13px;
}
.tl-row.past { opacity: .55; }
.tl-date { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 42px; }
.tl-row a { color: var(--text); text-decoration: none; font-weight: 600; }
.tl-row a:hover { color: var(--accent); }
.tl-left { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-left.urgent { color: var(--urgent); }
.tl-left.soon { color: var(--soon); }
.tl-left.safe { color: var(--safe); }

/* 投稿流程状态 */
.card-actions { display: flex; align-items: center; gap: 4px; }
.status-sel {
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--border);
  border-radius: 12px; padding: 2px 6px; font-size: 11px; max-width: 96px; cursor: pointer;
}
.status-sel.has { font-weight: 600; border-color: transparent; }
.status-sel.st-planned { background: var(--st-planned-bg); color: var(--st-planned-fg); }
.status-sel.st-writing { background: var(--st-writing-bg); color: var(--st-writing-fg); }
.status-sel.st-submitted { background: var(--st-submitted-bg); color: var(--st-submitted-fg); }
.status-sel.st-rebuttal { background: var(--st-rebuttal-bg); color: var(--st-rebuttal-fg); }
.status-sel.st-accepted { background: var(--st-accepted-bg); color: var(--st-accepted-fg); }
.status-sel.st-rejected { background: var(--st-rejected-bg); color: var(--st-rejected-fg); }

/* 看板视图 */
.kanban {
  grid-column: 1/-1; display: grid;
  grid-template-columns: repeat(3, 1fr); gap: 14px; /* 6 个状态 → 3×2 */
}
@media (max-width: 1100px) { .kanban { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .kanban { grid-template-columns: 1fr; } }
.kb-stats {
  grid-column: 1/-1; margin-bottom: 2px; font-size: 14px; font-weight: 700;
  color: var(--st-accepted-fg); background: var(--st-accepted-bg);
  padding: 10px 14px; border-radius: 10px;
}
.kb-col.drag-over { outline: 2px dashed var(--accent); outline-offset: -2px; }
.kb-item { cursor: grab; }
.kb-item:active { cursor: grabbing; }
.kb-col { background: var(--panel-2); border-radius: var(--radius); padding: 12px; min-height: 200px; }
.kb-head {
  font-weight: 700; font-size: 13px; margin-bottom: 10px; padding: 4px 8px; border-radius: 8px;
  display: flex; justify-content: space-between; align-items: center;
}
.kb-head.st-planned { background: var(--st-planned-bg); color: var(--st-planned-fg); }
.kb-head.st-writing { background: var(--st-writing-bg); color: var(--st-writing-fg); }
.kb-head.st-submitted { background: var(--st-submitted-bg); color: var(--st-submitted-fg); }
.kb-head.st-rebuttal { background: var(--st-rebuttal-bg); color: var(--st-rebuttal-fg); }
.kb-head.st-accepted { background: var(--st-accepted-bg); color: var(--st-accepted-fg); }
.kb-head.st-rejected { background: var(--st-rejected-bg); color: var(--st-rejected-fg); }
.kb-count { font-size: 11px; opacity: .8; }
.kb-item {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 6px;
}
.kb-item a { color: var(--text); text-decoration: none; font-weight: 600; font-size: 13px; }
.kb-item a:hover { color: var(--accent); }
.kb-cd { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kb-cd.urgent { color: var(--urgent); }
.kb-cd.soon { color: var(--soon); }
.kb-cd.safe { color: var(--safe); }
.kb-cd.done { color: var(--past); }

/* 会议详情弹窗 */
.card { cursor: pointer; }
.overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.overlay[hidden] { display: none; } /* display:flex 会覆盖 hidden 属性的 UA 样式 */
.detail {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 32px; max-width: 660px; width: 100%; max-height: 88vh; overflow-y: auto;
  position: relative; display: flex; flex-direction: column; gap: 12px;
}
.detail h2 { font-size: 20px; }
.detail h2 a { color: var(--text); text-decoration: none; }
.detail h2 a:hover { color: var(--accent); }
.detail h3.dt-sec { font-size: 13px; color: var(--muted); margin-top: 8px; text-transform: uppercase; letter-spacing: .04em; }
.dt-close {
  position: absolute; top: 12px; right: 12px; background: var(--panel-2);
  color: var(--muted); border: 1px solid var(--border); border-radius: 50%;
  width: 30px; height: 30px; cursor: pointer; font-size: 13px;
}
.dt-close:hover { color: var(--text); border-color: var(--accent); }
.dt-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.dt-row b { color: var(--text); font-variant-numeric: tabular-nums; text-align: right; }
.accept-chart { width: 100%; height: auto; }
.accept-chart .grid { stroke: var(--line); stroke-width: 1; }
.accept-chart .line { fill: none; stroke: var(--accent); stroke-width: 2; }
.accept-chart .dot { fill: var(--accent); }
.accept-chart .lbl { fill: var(--muted); font-size: 10px; }
.accept-chart .val { fill: var(--text); font-size: 10px; font-weight: 600; }
#contrib { margin-bottom: 6px; }
#contrib a, #dataOps a { color: var(--accent); text-decoration: none; font-weight: 600; }
#contrib a:hover, #dataOps a:hover { text-decoration: underline; }
#dataOps { margin-bottom: 10px; }
