﻿/* ============================================================
 * Hydro 晨雾青主题 — 次级页面与组件样式
 * ------------------------------------------------------------
 * 加载顺序：ui-default theme.css → calm-mist-base.css → 本文件
 *
 * 作用域约定：
 *   统一使用 `.theme--calm-mist:root` 作为前缀（= html.theme--calm-mist）。
 *   `:root` 让本文件在同等规则下比 base 的 `html.theme--calm-mist`
 *   高一级特异性，因此同属性覆盖时不需要 !important；
 *   也保证所有普通规则都以 `.theme--calm-mist` 开头，不污染全局。
 *
 * 颜色约定：
 *   只用 --cm-* token、rgba(18,33,30,...) 透明叠加与 color-mix()；
 *   不引入第二套品牌色，不使用外部字体 / 图片 / 外部样式导入。
 *
 * 布局约定：
 *   只做视觉覆盖，保持 ui-default 的宽高 / 浮动 / 栅格 / 列宽不变
 *   （个别登录卡宽度和页面内边距的微调已在注释中说明）。
 *
 * 章节：
 *   01 通用页面框架 / 空状态
 *   02 题目列表 /p
 *   03 题目详情 /p/:pid（题面、题解/统计 tab、侧栏、提交）
 *   04 比赛列表 /contest 与比赛详情
 *   05 记分牌 /contest/:tid/scoreboard
 *   06 排名 /ranking
 *   07 提交记录 /record、/record/:rid、题目统计
 *   08 用户主页 /user/:uid
 *   09 讨论 /discuss 列表、详情、回复与编辑器
 *   10 作业 /homework 列表 / 详情
 *   11 登录 / 注册 / 找回密码（immersive 布局）
 *   12 设置页与表单特化
 *   13 全局组件（表单控件 / tab / pager / menu / tooltip / dialog / 徽章）
 *   14 错误页
 *   15 响应式微调
 * ============================================================ */

/* ============================================================
 * 01 通用页面框架 / 空状态
 * ============================================================ */

/* 主内容区里的卡片堆叠节奏与首页保持一致 */
.theme--calm-mist:root .main > .row > .columns > .section:last-child { margin-bottom: 0; }

/* 窄侧栏卡片：标题与正文收紧一点 */
.theme--calm-mist:root .section.side .section__header { padding: 17px 18px 6px; }
.theme--calm-mist:root .section.side .section__title { font-size: 15px; font-weight: 700; }
.theme--calm-mist:root .section.side .section__body { padding: 10px 18px; }
.theme--calm-mist:root .section.side > .section__body:last-child { padding-bottom: 16px; }

/* 侧栏里的 typo 信息列表：细分割线 */
.theme--calm-mist:root .section.side .typo dl.horizontal { font-size: 13px; }
.theme--calm-mist:root .section.side .typo dt { color: var(--cm-faint); font-weight: 500; }
.theme--calm-mist:root .section.side .typo dd { color: var(--cm-text); }

/* 卡片内的分页：去掉 ui-default 的双层粗边框，换成留白 */
.theme--calm-mist:root .section .pager { margin: 6px 0 0; padding: 10px 16px; border: 0; }
.theme--calm-mist:root .section .pager__item { border: 1px solid var(--cm-line); }
.theme--calm-mist:root .section .pager__item.current { border-color: color-mix(in srgb, var(--cm-primary) 28%, var(--cm-line)); }

/* 空状态：柔和插画 + 更轻的说明文字 */
.theme--calm-mist:root .nothing-placeholder { padding: 54px 24px; font-size: 14px; color: var(--cm-muted); line-height: 1.8; text-align: center; }
.theme--calm-mist:root .nothing-placeholder.compact { padding: 20px 12px; font-size: 13px; }
.theme--calm-mist:root .nothing-placeholder .nothing-icon { height: 118px; margin-bottom: 14px; background-size: contain; opacity: .72; }

/* 表格内空行 */
.theme--calm-mist:root .data-table .empty-row { color: var(--cm-faint); font-size: 12.5px; }

/* 补充信息（时间、作者、浏览数等）统一降噪 */
.theme--calm-mist:root .supplementary, .theme--calm-mist:root .supplementary a, .theme--calm-mist:root .supplementary.list li { color: var(--cm-faint); font-size: 12.5px; }
.theme--calm-mist:root .supplementary a:hover { color: var(--cm-primary-deep); }
.theme--calm-mist:root .supplementary .icon { color: var(--cm-primary); opacity: .8; }

/* 页面里的时间戳 */
.theme--calm-mist:root .time { color: var(--cm-faint); font-variant-numeric: tabular-nums; }

/* 手机端顶部条（ui-default 默认是蓝灰底） */
.theme--calm-mist:root .header--mobile { background: var(--cm-surface); color: var(--cm-text); border-bottom: 1px solid var(--cm-line); }
.theme--calm-mist:root .header--mobile a, .theme--calm-mist:root .header--mobile a:visited { color: var(--cm-text); }
.theme--calm-mist:root .header--mobile .header__hamburger { padding: 10px; border-radius: 10px; background: var(--cm-surface-2); }

/* 手机端抽屉导航保持浅色 */
.theme--calm-mist:root .nav.slideout-menu { background: var(--cm-surface); }

/* ============================================================
 * 02 题目列表 /p
 * ============================================================ */

/* 搜索区：ui-default 是 input + 计数 + 排序 select + 按钮的拼接结构，
   这里改成一条完整的胶囊搜索框（保持原有 DOM 顺序与尺寸） */
.theme--calm-mist:root.page--problem_main .section > .section__body.no-padding:first-of-type, .theme--calm-mist:root.page--problem_category .section > .section__body.no-padding:first-of-type {
  padding: 14px 20px 4px;
}
.theme--calm-mist:root.page--problem_main .search, .theme--calm-mist:root.page--problem_category .search {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 0 4px 0 16px; border: 1px solid var(--cm-line-strong); border-radius: var(--cm-radius-pill);
  background: color-mix(in srgb, var(--cm-surface-2) 55%, var(--cm-surface)); overflow: visible; transition: border-color .15s, box-shadow .15s, background .15s;
}
.theme--calm-mist:root.page--problem_main .search:focus-within, .theme--calm-mist:root.page--problem_category .search:focus-within {
  border-color: var(--cm-primary); background: var(--cm-surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cm-primary) 13%, transparent);
}
.theme--calm-mist:root.page--problem_main .search > input, .theme--calm-mist:root.page--problem_category .search > input {
  flex: 1; width: auto; min-width: 0; height: 44px; padding: 0 8px 0 0; border: 0; border-radius: 0; background: transparent; color: var(--cm-text); font-family: var(--cm-font); font-size: 14px;
  outline: 0; box-shadow: none;
}
.theme--calm-mist:root.page--problem_main .search > input::placeholder, .theme--calm-mist:root.page--problem_category .search > input::placeholder { color: var(--cm-faint); }

/* 搜索结果计数（“1 道题”） */
.theme--calm-mist:root.page--problem_main .search > div, .theme--calm-mist:root.page--problem_category .search > div {
  position: static; flex: none; margin: 0 2px; color: var(--cm-muted); font-size: 12.5px; white-space: nowrap;
}

/* 排序下拉 */
.theme--calm-mist:root.page--problem_main .search-sort, .theme--calm-mist:root.page--problem_category .search-sort {
  position: static; flex: none; width: auto; height: 42px; margin: 0; padding: 0 30px 0 14px; border: 0; border-left: 1px solid var(--cm-line); border-radius: 0; background-color: transparent;
  color: var(--cm-muted); font-size: 13px; cursor: pointer; outline: 0;
}
.theme--calm-mist:root.page--problem_main .search-sort:focus, .theme--calm-mist:root.page--problem_category .search-sort:focus { border-color: var(--cm-line); box-shadow: none; }

/* 搜索按钮（DOM 里是 button > span.icon-search） */
.theme--calm-mist:root.page--problem_main .search > button, .theme--calm-mist:root.page--problem_category .search > button {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; margin: 2px 2px 2px 0; border: 0; border-radius: var(--cm-radius-pill);
  background: var(--cm-primary-soft); color: var(--cm-primary-deep); font-size: 16px; transition: background .15s, color .15s;
}
.theme--calm-mist:root.page--problem_main .search > button:hover, .theme--calm-mist:root.page--problem_category .search > button:hover {
  background: var(--cm-primary); color: var(--cm-primary-ink);
}

/* 表格上下的小分页 */
.theme--calm-mist:root.page--problem_main .pager.pager-top, .theme--calm-mist:root.page--problem_category .pager.pager-top {
  margin: 0; padding: 8px 20px 0; border-bottom: 1px solid var(--cm-line);
}
.theme--calm-mist:root.page--problem_main .pager.pager-bottom, .theme--calm-mist:root.page--problem_category .pager.pager-bottom {
  margin: 0; padding: 10px 20px; border-top: 1px solid var(--cm-line);
}
.theme--calm-mist:root.page--problem_main .pager .pager__item, .theme--calm-mist:root.page--problem_category .pager .pager__item { border: 1px solid var(--cm-line); }

/* 题号列：等宽胶囊 */
.theme--calm-mist:root.page--problem_main .col--pid, .theme--calm-mist:root.page--problem_category .col--pid { color: var(--cm-faint); font-family: var(--cm-mono); font-size: 12px; }

/* 题目名里的题号 <b> 降噪，标题保持深色加粗 */
.theme--calm-mist:root.page--problem_main .col--problem-name > a, .theme--calm-mist:root.page--problem_category .col--problem-name > a { color: var(--cm-text); font-weight: 650; }
.theme--calm-mist:root.page--problem_main .col--problem-name > a:hover, .theme--calm-mist:root.page--problem_category .col--problem-name > a:hover { color: var(--cm-primary-deep); }
.theme--calm-mist:root.page--problem_main .col--problem-name > a b, .theme--calm-mist:root.page--problem_category .col--problem-name > a b {
  margin-right: 6px; color: var(--cm-faint); font-family: var(--cm-mono); font-size: 11.5px; font-weight: 600;
}

/* AC / 尝试与难度列 */
.theme--calm-mist:root.page--problem_main .col--ac-tried, .theme--calm-mist:root.page--problem_category .col--ac-tried { color: var(--cm-muted); font-variant-numeric: tabular-nums; }
.theme--calm-mist:root.page--problem_main .col--difficulty, .theme--calm-mist:root.page--problem_category .col--difficulty {
  color: var(--cm-primary-deep); font-weight: 650; font-variant-numeric: tabular-nums;
}

/* 表格里的题目标签（li.problem__tag > a.problem__tag-link） */
.theme--calm-mist:root.page--problem_main .problem__tag, .theme--calm-mist:root.page--problem_category .problem__tag {
  height: auto; margin: 0 4px 2px 0 !important; padding: 0 !important; border: 0; background: transparent;
}
.theme--calm-mist:root.page--problem_main .problem__tags .problem__tag-link, .theme--calm-mist:root.page--problem_category .problem__tags .problem__tag-link {
  display: inline-flex; align-items: center; height: 22px; max-width: 160px; padding: 0 9px; border: 1px solid var(--cm-line); border-radius: var(--cm-radius-pill); background: var(--cm-surface-2);
  color: var(--cm-muted) !important; font-size: 11.5px; line-height: 20px; transition: background .14s, border-color .14s, color .14s;
}
.theme--calm-mist:root.page--problem_main .problem__tags .problem__tag-link:hover, .theme--calm-mist:root.page--problem_category .problem__tags .problem__tag-link:hover {
  border-color: var(--cm-primary); background: var(--cm-primary); color: var(--cm-primary-ink) !important;
}

/* “显示/隐藏标签”切换 */
.theme--calm-mist:root.page--problem_main .toggle-tag {
  margin-left: 8px; padding: 2px 8px; border-radius: var(--cm-radius-pill); background: var(--cm-surface-2); color: var(--cm-muted); font-size: 11.5px; font-weight: 500; cursor: pointer;
}
.theme--calm-mist:root.page--problem_main .toggle-tag:hover { background: var(--cm-primary-soft); color: var(--cm-primary-deep); }

/* 侧栏分类 */
.theme--calm-mist:root.page--problem_main .section.side .group-list__item { margin-bottom: 14px; }
.theme--calm-mist:root.page--problem_main .section.side .group-list__item:last-child { margin-bottom: 4px; }
.theme--calm-mist:root.page--problem_main .section.side .group-list__item > h2.section__title { margin: 0 0 8px; font-size: 12.5px; font-weight: 650; letter-spacing: .02em; }
.theme--calm-mist:root.page--problem_main .section.side .group-list__item > h2.section__title a { color: var(--cm-text); }
.theme--calm-mist:root.page--problem_main .section.side .group-list__item > h2.section__title a:hover { color: var(--cm-primary-deep); }
.theme--calm-mist:root.page--problem_main .chip-list { gap: 6px; }
.theme--calm-mist:root.page--problem_main .chip-list__item a.typo-a {
  border: 1px solid var(--cm-line); border-radius: var(--cm-radius-pill); background: color-mix(in srgb, var(--cm-surface-2) 70%, var(--cm-surface)); color: var(--cm-muted); font-size: 11.5px;
  line-height: 1; padding: 5px 10px; transition: background .14s, border-color .14s, color .14s;
}
.theme--calm-mist:root.page--problem_main .chip-list__item a.typo-a:hover { border-color: var(--cm-primary); background: var(--cm-primary-soft); color: var(--cm-primary-deep); }

/* 分类筛选卡片（部分皮肤下会出现） */
.theme--calm-mist:root .widget--category-filter__drop { border: 1px solid var(--cm-line); border-radius: 14px; background: var(--cm-surface); box-shadow: var(--cm-shadow); }
.theme--calm-mist:root .widget--category-filter__tag.selected, .theme--calm-mist:root .search-tag__item.selected { background: var(--cm-primary) !important; color: var(--cm-primary-ink); }

/* ============================================================
 * 03 题目详情 /p/:pid
 * ============================================================ */

/* 标题与题号 */
.theme--calm-mist:root.page--problem_detail .section__header .section__title, .theme--calm-mist:root.page--contest_detail_problem .section__header .section__title, .theme--calm-mist:root.page--homework_detail_problem .section__header .section__title {
  color: var(--cm-text); font-size: 1.3rem; font-weight: 700; letter-spacing: -.3px;
}
.theme--calm-mist:root.page--problem_detail .section__header .star, .theme--calm-mist:root.page--contest_detail_problem .section__header .star { color: var(--cm-faint); vertical-align: middle; }
.theme--calm-mist:root.page--problem_detail .section__header .star:hover, .theme--calm-mist:root.page--problem_detail .section__header .star.activated { color: var(--cm-accent); }

/* 题目标签条 */
.theme--calm-mist:root.page--problem_detail .problem__tags, .theme--calm-mist:root.page--contest_detail .problem__tags, .theme--calm-mist:root.page--homework_detail .problem__tags {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 0 !important;
}
.theme--calm-mist:root.page--problem_detail .problem__tag-item, .theme--calm-mist:root.page--contest_detail .problem__tag-item, .theme--calm-mist:root.page--homework_detail .problem__tag-item {
  display: inline-flex; align-items: center; gap: 5px; min-height: 26px; min-width: 0; margin: 0 !important; padding: 0 11px !important;
  border: 1px solid color-mix(in srgb, var(--cm-primary) 14%, var(--cm-line)); border-radius: var(--cm-radius-pill); background: color-mix(in srgb, var(--cm-primary) 7%, var(--cm-surface));
  color: var(--cm-muted); font-size: 12.5px; line-height: 24px !important; box-shadow: none;
}
.theme--calm-mist:root.page--problem_detail .problem__tag-item .icon, .theme--calm-mist:root.page--contest_detail .problem__tag-item .icon, .theme--calm-mist:root.page--homework_detail .problem__tag-item .icon {
  margin-right: 0; color: var(--cm-primary); font-size: 14px;
}
.theme--calm-mist:root.page--problem_detail .problem__tag-item > *, .theme--calm-mist:root.page--contest_detail .problem__tag-item > * { margin-right: 4px; }
.theme--calm-mist:root.page--problem_detail .problem__tag-item > :last-child, .theme--calm-mist:root.page--contest_detail .problem__tag-item > :last-child { margin-right: 0; }
.theme--calm-mist:root.hasjs .problem__tags .problem__tag-item.hasjs--hide { display: none; }
.theme--calm-mist:root.nojs .problem__tags .problem__tag-item.nojs--hide { display: none; }
.theme--calm-mist:root.page--problem_detail .problem__tag-item.interactive:hover, .theme--calm-mist:root.page--contest_detail .problem__tag-item.interactive:hover {
  border-color: var(--cm-primary); background: var(--cm-primary-soft); color: var(--cm-primary-deep); cursor: pointer;
}

/* 题面语言 tab（English / 简体中文） */
.theme--calm-mist:root.page--problem_detail .section__tab-container, .theme--calm-mist:root.page--contest_detail_problem .section__tab-container, .theme--calm-mist:root.page--homework_detail_problem .section__tab-container {
  padding: 2px 18px 0;
}
.theme--calm-mist:root.page--problem_detail .section__tab-header, .theme--calm-mist:root.page--contest_detail_problem .section__tab-header, .theme--calm-mist:root.page--homework_detail_problem .section__tab-header {
  display: flex; gap: 6px; padding: 0 0 10px; margin-bottom: 0; overflow-x: auto; border-bottom: 1px solid var(--cm-line);
}

/* ui-default 页面样式把 tab 颜色写成了 !important，因此这里的 color 必须跟上 */
.theme--calm-mist:root.page--problem_detail .section__tab-header-item, .theme--calm-mist:root.page--contest_detail_problem .section__tab-header-item, .theme--calm-mist:root.page--homework_detail_problem .section__tab-header-item {
  border: 1px solid transparent; border-radius: var(--cm-radius-pill); color: var(--cm-muted) !important; font-size: 13px; font-weight: 600; line-height: 28px; height: 30px; padding: 0 14px;
  transition: background .15s, color .15s, border-color .15s;
}
.theme--calm-mist:root.page--problem_detail .section__tab-header-item:hover, .theme--calm-mist:root.page--contest_detail_problem .section__tab-header-item:hover, .theme--calm-mist:root.page--homework_detail_problem .section__tab-header-item:hover {
  border-color: var(--cm-line); background: var(--cm-surface-2); color: var(--cm-text) !important;
}
.theme--calm-mist:root.page--problem_detail .section__tab-header-item.tab--active, .theme--calm-mist:root.page--contest_detail_problem .section__tab-header-item.tab--active, .theme--calm-mist:root.page--homework_detail_problem .section__tab-header-item.tab--active {
  border-color: color-mix(in srgb, var(--cm-primary) 22%, var(--cm-line)); background: var(--cm-primary-soft); color: var(--cm-primary-deep) !important; font-weight: 650;
}

/* 题面正文 */
.theme--calm-mist:root .problem-content .section__header { padding-bottom: 4px; }
.theme--calm-mist:root .problem-content .typo, .theme--calm-mist:root.page--problem_detail .section__body.typo {
  color: color-mix(in srgb, var(--cm-text) 88%, var(--cm-muted)); font-size: 15px; line-height: 1.85;
}
.theme--calm-mist:root .problem-content .typo p { margin: .78em 0; }
.theme--calm-mist:root .problem-content .typo h2 { margin: 1.5em 0 .6em; padding-left: 12px; border-left: 3px solid var(--cm-primary); color: var(--cm-text); font-size: 1.22rem; font-weight: 700; }
.theme--calm-mist:root .problem-content .typo h3 { margin: 1.3em 0 .5em; color: var(--cm-text); font-size: 1.08rem; font-weight: 700; }
.theme--calm-mist:root .problem-content .typo h4 { color: var(--cm-text); font-weight: 650; }
.theme--calm-mist:root .problem-content .typo ul { list-style: disc; margin-left: 1.4em; }
.theme--calm-mist:root .problem-content .typo ol { list-style: decimal; margin-left: 1.6em; }
.theme--calm-mist:root .problem-content .typo li::marker { color: var(--cm-primary); }
.theme--calm-mist:root .problem-content .typo strong { color: var(--cm-text); font-weight: 700; }
.theme--calm-mist:root .problem-content .typo hr { border: 0; border-top: 1px dashed var(--cm-line-strong); margin: 1.6em 0; }

/* 题面里的提示块 */
.theme--calm-mist:root .problem-content .typo blockquote, .theme--calm-mist:root .section__body.typo blockquote {
  margin: 1.1em 0; padding: 12px 16px; border-left: 3px solid var(--cm-primary); border-radius: 0 12px 12px 0; background: var(--cm-surface-2);
  color: color-mix(in srgb, var(--cm-text) 78%, var(--cm-muted)); font-size: 13.5px;
}
.theme--calm-mist:root .problem-content .typo blockquote.warn, .theme--calm-mist:root .section__body.typo blockquote.warn {
  border-left-color: var(--cm-warn); background: color-mix(in srgb, var(--cm-warn) 8%, var(--cm-surface));
}

/* 题面表格 */
.theme--calm-mist:root .problem-content .typo table { width: 100%; margin: 1.1em 0; border-collapse: collapse; border-radius: 12px; overflow: hidden; font-size: 14px; }
.theme--calm-mist:root .problem-content .typo table th { padding: 9px 13px; border: 1px solid var(--cm-line); background: var(--cm-surface-2); color: var(--cm-text); font-weight: 650; }
.theme--calm-mist:root .problem-content .typo table td { padding: 9px 13px; border: 1px solid var(--cm-line); color: color-mix(in srgb, var(--cm-text) 86%, var(--cm-muted)); }
.theme--calm-mist:root .problem-content .typo img { border: 1px solid var(--cm-line); border-radius: 12px; }

/* 代码块：延续 base 的深色面板，但把 Prism(VS) 的深色语法色换成
   晨雾青可读的浅色 token，避免浅色主题里出现蓝/黑不可读文本 */
.theme--calm-mist:root .problem-content .typo pre, .theme--calm-mist:root .section__body.typo pre {
  padding: 16px 18px; border: 1px solid color-mix(in srgb, var(--cm-text) 82%, var(--cm-primary)); border-radius: 14px; background: var(--cm-text);
  color: color-mix(in srgb, var(--cm-surface) 78%, var(--cm-primary)); font-size: 12.5px; line-height: 1.7; box-shadow: inset 0 1px 0 color-mix(in srgb, var(--cm-surface) 4%, transparent);
}
.theme--calm-mist:root .problem-content .typo pre code, .theme--calm-mist:root .section__body.typo pre code, .theme--calm-mist:root .problem-content .typo pre code[class*="language-"], .theme--calm-mist:root .section__body.typo pre code[class*="language-"] {
  color: inherit; font-family: var(--cm-mono); font-size: 1em; background: transparent; border: 0;
}
.theme--calm-mist:root pre .token.comment, .theme--calm-mist:root pre .token.prolog, .theme--calm-mist:root pre .token.doctype, .theme--calm-mist:root pre .token.cdata {
  color: color-mix(in srgb, var(--cm-muted) 62%, var(--cm-surface)); font-style: italic;
}
.theme--calm-mist:root pre .token.punctuation, .theme--calm-mist:root pre .token.operator { color: color-mix(in srgb, var(--cm-surface) 62%, var(--cm-primary)); }
.theme--calm-mist:root pre .token.keyword, .theme--calm-mist:root pre .token.atrule, .theme--calm-mist:root pre .token.boolean, .theme--calm-mist:root pre .token.important {
  color: color-mix(in srgb, var(--cm-primary) 42%, var(--cm-surface)); font-weight: 600;
}
.theme--calm-mist:root pre .token.string, .theme--calm-mist:root pre .token.attr-value, .theme--calm-mist:root pre .token.char, .theme--calm-mist:root pre .token.regex {
  color: color-mix(in srgb, var(--cm-accent) 55%, var(--cm-surface));
}
.theme--calm-mist:root pre .token.number, .theme--calm-mist:root pre .token.symbol, .theme--calm-mist:root pre .token.constant, .theme--calm-mist:root pre .token.variable, .theme--calm-mist:root pre .token.inserted {
  color: color-mix(in srgb, var(--cm-primary) 68%, var(--cm-surface));
}
.theme--calm-mist:root pre .token.function, .theme--calm-mist:root pre .token.class-name, .theme--calm-mist:root pre .token.builtin {
  color: color-mix(in srgb, var(--cm-surface) 74%, var(--cm-primary));
}
.theme--calm-mist:root pre .token.tag, .theme--calm-mist:root pre .token.selector, .theme--calm-mist:root pre .token.attr-name, .theme--calm-mist:root pre .token.property, .theme--calm-mist:root pre .token.deleted {
  color: color-mix(in srgb, var(--cm-accent) 68%, var(--cm-surface));
}

/* 题目详情侧栏（递交 / 讨论 / 题解 / 统计） */
.theme--calm-mist:root .section--problem-sidebar .menu { padding: 8px 8px 10px; }
.theme--calm-mist:root .section--problem-sidebar .menu__link {
  margin: 1px 0; padding: 10px 12px; border-left: 0; border-radius: 10px; color: var(--cm-muted); font-size: 13.5px; font-weight: 500; transition: background .14s, color .14s;
}
.theme--calm-mist:root .section--problem-sidebar .menu__link .icon { margin-right: 8px; color: var(--cm-primary); font-size: 15px; opacity: .85; }
.theme--calm-mist:root .section--problem-sidebar .menu__link:hover { background: var(--cm-surface-2); color: var(--cm-primary-deep); }
.theme--calm-mist:root .section--problem-sidebar .menu__link.active, .theme--calm-mist:root .section--problem-sidebar .menu__link.highlight {
  background: var(--cm-primary-soft); color: var(--cm-primary-deep); font-weight: 650;
}
.theme--calm-mist:root .section--problem-sidebar .menu__seperator { margin: 6px 8px; border-top: 1px dashed var(--cm-line); }

/* 比赛题号导航（详情页顶部的小方格） */
.theme--calm-mist:root .contest-problems > a { border-radius: 8px; color: var(--cm-faint); font-family: var(--cm-mono); font-size: 12px; }
.theme--calm-mist:root .contest-problems > a:after { border: 2px solid color-mix(in srgb, var(--cm-line-strong) 80%, transparent); border-radius: 8px; opacity: .9; }
.theme--calm-mist:root .contest-problems > a:hover { background: var(--cm-surface-2); }
.theme--calm-mist:root .contest-problems > a.pass, .theme--calm-mist:root .contest-problems > a.pass:before { color: var(--cm-success); background-color: var(--cm-success); }
.theme--calm-mist:root .contest-problems > a.fail, .theme--calm-mist:root .contest-problems > a.fail:before { color: var(--cm-danger); background-color: var(--cm-danger); }
.theme--calm-mist:root .contest-problems > a.active:after { border-color: var(--cm-primary); border-width: 2px; }

/* 题目统计页的图表占位 */
.theme--calm-mist:root.page--problem_statistics #submission-status-placeholder, .theme--calm-mist:root.page--problem_statistics #submission-score-placeholder {
  border-radius: 14px; background: color-mix(in srgb, var(--cm-surface-2) 60%, var(--cm-surface)); border: 1px dashed var(--cm-line-strong);
}

/* ============================================================
 * 04 比赛列表 /contest 与比赛详情
 * ============================================================ */

/* 列表容器 */
.theme--calm-mist:root.page--contest_main .contest__list { display: block; margin: 0; padding: 0 24px 16px; list-style: none; }
.theme--calm-mist:root.page--contest_main .contest__item {
  position: relative; margin: 0; padding: 18px 2px 18px 16px; border: 0; border-bottom: 1px dashed var(--cm-line); border-left: 4px solid transparent; border-radius: 0; background: transparent;
  transition: background .14s, border-color .14s;
}
.theme--calm-mist:root.page--contest_main .contest__item:last-child { border-bottom: 0; }
.theme--calm-mist:root.page--contest_main .contest__item:hover { background: color-mix(in srgb, var(--cm-surface-2) 55%, var(--cm-surface)); }
.theme--calm-mist:root.page--contest_main .contest__item.live { border-left-color: var(--cm-primary); }
.theme--calm-mist:root.page--contest_main .contest__item.ready { border-left-color: var(--cm-accent); }

/* 日期块 */
.theme--calm-mist:root.page--contest_main .contest__date.numbox {
  width: 64px; margin-right: 16px; padding: 9px 8px; border: 1px solid color-mix(in srgb, var(--cm-primary) 13%, var(--cm-line)); border-radius: 15px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--cm-primary) 9%, var(--cm-surface)), color-mix(in srgb, var(--cm-primary) 4%, var(--cm-surface))); text-align: center;
}
.theme--calm-mist:root.page--contest_main .contest__date .numbox__num.large { color: var(--cm-primary-deep); font-size: 1.45rem; font-weight: 750; letter-spacing: -.5px; line-height: 1.1; }
.theme--calm-mist:root.page--contest_main .contest__date .numbox__text { margin-top: 4px; color: var(--cm-faint); font-size: 11px; letter-spacing: .04em; }

/* 比赛标题与元信息 */
.theme--calm-mist:root.page--contest_main .contest__title { margin-bottom: 8px; font-size: 1.05rem; font-weight: 700; line-height: 1.35; }
.theme--calm-mist:root.page--contest_main .contest__title a { color: var(--cm-text); }
.theme--calm-mist:root.page--contest_main .contest__title a:hover { color: var(--cm-primary-deep); }
.theme--calm-mist:root.page--contest_main .contest__item .supplementary.list { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.theme--calm-mist:root.page--contest_main .contest__item .supplementary.list li { display: inline-flex; align-items: center; color: var(--cm-muted); font-size: 12.5px; }
.theme--calm-mist:root.page--contest_main .contest__item .supplementary.list li .icon { margin-right: 4px; color: var(--cm-primary); opacity: .85; }
.theme--calm-mist:root.page--contest_main .contest__info-attended { color: var(--cm-success) !important; }
.theme--calm-mist:root.page--contest_main .contest__info-attended .icon { color: var(--cm-success); }

/* 赛制标签：用 token 混出柔和底色，保留各赛制之间的辨识度 */
.theme--calm-mist:root.page--contest_main .contest-type-tag, .theme--calm-mist:root.page--contest_detail .contest-type-tag, .theme--calm-mist:root.page--homework_main .contest-type-tag {
  border: 1px solid transparent; border-radius: var(--cm-radius-pill); font-size: 11.5px; font-weight: 600; line-height: 20px; padding: 1px 10px;
}
.theme--calm-mist:root .contest-type--acm .contest-type-tag {
  background: color-mix(in srgb, var(--cm-success) 12%, var(--cm-surface)); color: color-mix(in srgb, var(--cm-success) 80%, var(--cm-text));
}
.theme--calm-mist:root .contest-type--acm .contest-type-tag:hover {
  background: color-mix(in srgb, var(--cm-success) 20%, var(--cm-surface)); color: color-mix(in srgb, var(--cm-success) 84%, var(--cm-text)) !important;
}
.theme--calm-mist:root .contest-type--oi .contest-type-tag { background: color-mix(in srgb, var(--cm-warn) 12%, var(--cm-surface)); color: color-mix(in srgb, var(--cm-warn) 84%, var(--cm-text)); }
.theme--calm-mist:root .contest-type--oi .contest-type-tag:hover {
  background: color-mix(in srgb, var(--cm-warn) 20%, var(--cm-surface)); color: color-mix(in srgb, var(--cm-warn) 88%, var(--cm-text)) !important;
}
.theme--calm-mist:root .contest-type--ioi .contest-type-tag, .theme--calm-mist:root .contest-type--strictioi .contest-type-tag {
  background: color-mix(in srgb, var(--cm-primary) 11%, var(--cm-surface)); color: var(--cm-primary-deep);
}
.theme--calm-mist:root .contest-type--ioi .contest-type-tag:hover, .theme--calm-mist:root .contest-type--strictioi .contest-type-tag:hover {
  background: color-mix(in srgb, var(--cm-primary) 18%, var(--cm-surface)); color: var(--cm-primary-deep) !important;
}
.theme--calm-mist:root .contest-type--ledo .contest-type-tag { background: color-mix(in srgb, var(--cm-muted) 11%, var(--cm-surface)); color: color-mix(in srgb, var(--cm-muted) 88%, var(--cm-text)); }
.theme--calm-mist:root .contest-type--ledo .contest-type-tag:hover {
  background: color-mix(in srgb, var(--cm-muted) 18%, var(--cm-surface)); color: color-mix(in srgb, var(--cm-muted) 92%, var(--cm-text)) !important;
}
.theme--calm-mist:root .contest-type--homework .contest-type-tag {
  background: color-mix(in srgb, var(--cm-accent) 12%, var(--cm-surface)); color: color-mix(in srgb, var(--cm-accent) 78%, var(--cm-text));
}
.theme--calm-mist:root .contest-type--homework .contest-type-tag:hover {
  background: color-mix(in srgb, var(--cm-accent) 20%, var(--cm-surface)); color: color-mix(in srgb, var(--cm-accent) 82%, var(--cm-text)) !important;
}

/* Rated 标记 */
.theme--calm-mist:root.page--contest_main .contest-tag-rated {
  border-radius: var(--cm-radius-pill); background: color-mix(in srgb, var(--cm-warn) 12%, var(--cm-surface)); color: color-mix(in srgb, var(--cm-warn) 84%, var(--cm-text)); font-size: 11.5px;
  font-weight: 600;
}

/* 比赛详情正文 */
.theme--calm-mist:root.page--contest_detail .section__body.typo { color: color-mix(in srgb, var(--cm-text) 88%, var(--cm-muted)); line-height: 1.85; }
.theme--calm-mist:root.page--contest_detail .section__body.typo h2, .theme--calm-mist:root.page--contest_detail .section__body.typo h3 { color: var(--cm-text); font-weight: 700; }

/* 比赛侧栏横幅 */
.theme--calm-mist:root .contest-sidebar__bg {
  display: block; margin: 0; padding: 2px 0; border-radius: var(--cm-radius-lg);
  background: linear-gradient(135deg, color-mix(in srgb, var(--cm-primary) 24%, var(--cm-surface)), color-mix(in srgb, var(--cm-primary) 6%, var(--cm-surface))); color: var(--cm-text);
  text-decoration: none;
}
.theme--calm-mist:root .contest-sidebar__bg h1 { color: var(--cm-text); font-size: 1.05rem; font-weight: 700; line-height: 1.4; }
.theme--calm-mist:root .contest-sidebar__status { margin-top: 8px; color: var(--cm-primary-deep); font-size: 12.5px; font-weight: 600; }
.theme--calm-mist:root .contest-sidebar__status .icon { color: var(--cm-primary); }

/* 比赛详情侧栏菜单与 ui-default 的 section.side 对齐 */
.theme--calm-mist:root.page--contest_detail .section.side .menu { padding: 8px 8px 10px; }
.theme--calm-mist:root.page--contest_detail .section.side .menu__link { margin: 1px 0; padding: 9px 12px; border-left: 0; border-radius: 10px; color: var(--cm-muted); font-size: 13.5px; }
.theme--calm-mist:root.page--contest_detail .section.side .menu__link .icon { margin-right: 8px; color: var(--cm-primary); }
.theme--calm-mist:root.page--contest_detail .section.side .menu__link:hover { background: var(--cm-surface-2); color: var(--cm-primary-deep); }
.theme--calm-mist:root.page--contest_detail .section.side .menu__link.active, .theme--calm-mist:root.page--contest_detail .section.side .menu__link.highlight {
  background: var(--cm-primary-soft); color: var(--cm-primary-deep);
}
.theme--calm-mist:root.page--contest_detail .section.side .menu__seperator { margin: 6px 8px; border-top: 1px dashed var(--cm-line); }

/* 比赛题单 */
.theme--calm-mist:root.page--contest_problemlist .data-table td.col--problem, .theme--calm-mist:root.page--contest_problemlist .data-table th.col--problem { font-weight: 600; }

/* 比赛倒计时浮标：ui-default 默认贴在左上角压住导航，这里改成薄荷胶囊 */
.theme--calm-mist:root .contest-timer {
  left: 16px; top: 58px; z-index: 400; padding: 5px 13px; border: 1px solid var(--cm-line); border-radius: var(--cm-radius-pill);
  background: color-mix(in srgb, var(--cm-surface) 92%, var(--cm-primary)); color: var(--cm-primary-deep); font-family: var(--cm-mono); font-size: 12px; font-weight: 650;
  letter-spacing: .04em; box-shadow: var(--cm-shadow);
}
/* ============================================================
 * 05 记分牌 /contest/:tid/scoreboard
 * ============================================================ */
.theme--calm-mist:root.page--contest_scoreboard .section__header .section__title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 1.15rem; }
.theme--calm-mist:root.page--contest_scoreboard .section__header .button { height: 28px; padding: 0 12px; border-radius: var(--cm-radius-pill); font-size: 11.5px; font-weight: 600; }
.theme--calm-mist:root.page--contest_scoreboard .data-table { font-size: 12.5px; }
.theme--calm-mist:root.page--contest_scoreboard .data-table thead th {
  padding: 10px 8px; background: color-mix(in srgb, var(--cm-surface-2) 70%, var(--cm-surface)); color: var(--cm-muted); font-size: 11.5px; font-weight: 650;
}
.theme--calm-mist:root.page--contest_scoreboard .data-table td { padding: 7px 8px; }
.theme--calm-mist:root.page--contest_scoreboard .col--rank, .theme--calm-mist:root.page--contest_scoreboard .col--solved, .theme--calm-mist:root.page--contest_scoreboard .col--time, .theme--calm-mist:root.page--contest_scoreboard .col--total_score, .theme--calm-mist:root.page--contest_scoreboard .col--problem {
  font-variant-numeric: tabular-nums;
}
.theme--calm-mist:root.page--contest_scoreboard .col--rank { color: var(--cm-faint); font-weight: 700; }
.theme--calm-mist:root.page--contest_scoreboard .col--user { font-weight: 600; }
.theme--calm-mist:root.page--contest_scoreboard .rank--normal { color: var(--cm-faint); }
.theme--calm-mist:root.page--contest_scoreboard .rank--unrank { color: var(--cm-faint); opacity: .7; }
.theme--calm-mist:root.page--contest_scoreboard .data-table tbody tr:hover { background: color-mix(in srgb, var(--cm-primary) 5%, var(--cm-surface)); }
.theme--calm-mist:root.page--contest_scoreboard .star { color: var(--cm-line-strong); }
.theme--calm-mist:root.page--contest_scoreboard .star:hover, .theme--calm-mist:root.page--contest_scoreboard .star.activated { color: var(--cm-accent); }
.theme--calm-mist:root.page--contest_scoreboard .star-highlight { background: color-mix(in srgb, var(--cm-primary) 10%, var(--cm-surface)); }

/* 冻结/提示条 */
.theme--calm-mist:root.page--contest_scoreboard blockquote.note { margin: 0; padding: 12px 18px; }

/* ============================================================
 * 06 排名 /ranking
 * ============================================================ */
.theme--calm-mist:root.page--ranking .data-table { font-size: 13px; }
.theme--calm-mist:root.page--ranking .data-table thead th {
  padding: 12px 10px; border-bottom: 1px solid var(--cm-line); background: color-mix(in srgb, var(--cm-surface-2) 60%, var(--cm-surface)); color: var(--cm-faint); font-size: 11.5px; font-weight: 650;
  letter-spacing: .03em;
}
.theme--calm-mist:root.page--ranking .data-table tbody tr { transition: background .12s; }
.theme--calm-mist:root.page--ranking .data-table tbody tr:hover { background: color-mix(in srgb, var(--cm-primary) 4.5%, var(--cm-surface)); }

/* 名次：ui-default 排名表没有 .rank--1/2/3 类，只有 .rank--normal，
   因此这里做统一的名次徽章样式；前三名高亮留待模板加类后启用 */
.theme--calm-mist:root.page--ranking .col--rank { color: var(--cm-faint); font-weight: 700; font-variant-numeric: tabular-nums; }
.theme--calm-mist:root.page--ranking .col--user { font-weight: 600; }
.theme--calm-mist:root.page--ranking .col--user .user-profile-avatar { margin-right: 6px; box-shadow: 0 0 0 2px var(--cm-surface), 0 0 0 3px var(--cm-line); }
.theme--calm-mist:root.page--ranking .col--rp { color: var(--cm-primary-deep); font-weight: 700; font-variant-numeric: tabular-nums; }
.theme--calm-mist:root.page--ranking .col--detail, .theme--calm-mist:root.page--ranking .col--ac { color: var(--cm-muted); font-variant-numeric: tabular-nums; }
.theme--calm-mist:root.page--ranking .col--bio { color: var(--cm-faint); font-size: 12px; }
.theme--calm-mist:root.page--ranking blockquote.note { margin: 0 0 12px; border-radius: 10px; font-size: 12.5px; }
.theme--calm-mist:root.page--ranking .pager { padding-bottom: 8px; }

/* 排名/用户页的 “no users” 空状态 */
.theme--calm-mist:root.page--ranking .nothing-placeholder { padding: 64px 20px; }

/* ============================================================
 * 07 提交记录 /record、/record/:rid、题目统计
 * ============================================================ */

/* ---- 筛选条 ---- */
.theme--calm-mist:root.page--record_main .section:first-child .section__body, .theme--calm-mist:root.page--homework_scoreboard .section:first-child .section__body { padding-top: 4px; }
.theme--calm-mist:root.page--record_main .section__body label, .theme--calm-mist:root.page--record_main .filter-user {
  display: block; margin-bottom: 12px; color: var(--cm-faint); font-size: 12px; font-weight: 600; letter-spacing: .02em;
}
.theme--calm-mist:root.page--record_main .section__body label .textbox, .theme--calm-mist:root.page--record_main .section__body label .select { margin-top: 6px; }
.theme--calm-mist:root.page--record_main .section__tools .button, .theme--calm-mist:root.page--record_main .section__tools .button.primary { margin-bottom: 0; }

/* ---- 记录表 ---- */
.theme--calm-mist:root .record_main__table thead th {
  padding: 12px 10px; background: color-mix(in srgb, var(--cm-surface-2) 62%, var(--cm-surface)); color: var(--cm-faint); font-size: 11.5px; font-weight: 650; letter-spacing: .03em;
}
.theme--calm-mist:root .record_main__table tbody td { border-color: color-mix(in srgb, var(--cm-line) 82%, transparent); }
.theme--calm-mist:root .record_main__table tbody tr { transition: background .12s; }
.theme--calm-mist:root .record_main__table tbody tr:hover { background: color-mix(in srgb, var(--cm-primary) 4%, var(--cm-surface)); }
.theme--calm-mist:root .record_main__table .col--time, .theme--calm-mist:root .record_main__table .col--memory { color: var(--cm-muted); font-variant-numeric: tabular-nums; }
.theme--calm-mist:root .record_main__table .col--submit-at { color: var(--cm-faint); font-variant-numeric: tabular-nums; }

/* 语言列：淡淡的等宽标签 */
.theme--calm-mist:root .record_main__table .col--lang, .theme--calm-mist:root .record_detail__table .col--lang { color: var(--cm-muted); font-family: var(--cm-mono); font-size: 11.5px; }
.theme--calm-mist:root .record_main__table .col--problem-name a { color: var(--cm-text); font-weight: 600; }
.theme--calm-mist:root .record_main__table .col--problem-name a:hover { color: var(--cm-primary-deep); }
.theme--calm-mist:root .record_main__table .col--problem-name form { opacity: .7; transition: opacity .14s; }
.theme--calm-mist:root .record_main__table .col--problem-name form:hover { opacity: 1; }
.theme--calm-mist:root .record_main__table .col--problem-name form .link { color: var(--cm-faint) !important; font-size: 11.5px; font-weight: 500; }
.theme--calm-mist:root .record_main__table .col--problem-name form .link:hover { color: var(--cm-danger) !important; }
.theme--calm-mist:root .record_main__table .col--problem-name form .link .icon { color: inherit; font-size: 12px; }

/* 状态色：ui-default 用 !important 固化了亮绿/亮红，这里做柔和化 */
.theme--calm-mist:root .record-status--text.pass { color: var(--cm-success) !important; }
.theme--calm-mist:root .record-status--text.fail { color: var(--cm-danger) !important; }
.theme--calm-mist:root .record-status--text.progress { color: var(--cm-warn) !important; }
.theme--calm-mist:root .record-status--text.ignored, .theme--calm-mist:root .record-status--text.pending { color: var(--cm-muted) !important; }
.theme--calm-mist:root .record-status--icon.pass::before { color: var(--cm-success); }
.theme--calm-mist:root .record-status--icon.fail::before { color: var(--cm-danger); }
.theme--calm-mist:root .record-status--icon.progress::before { color: var(--cm-warn); }
.theme--calm-mist:root .record-status--icon.ignored::before, .theme--calm-mist:root .record-status--icon.pending::before { color: var(--cm-muted); }
.theme--calm-mist:root .record-status--border.pass { border-left-color: color-mix(in srgb, var(--cm-success) 72%, var(--cm-surface)); }
.theme--calm-mist:root .record-status--border.fail { border-left-color: color-mix(in srgb, var(--cm-danger) 66%, var(--cm-surface)); }
.theme--calm-mist:root .record-status--border.progress { border-left-color: color-mix(in srgb, var(--cm-warn) 72%, var(--cm-surface)); }
.theme--calm-mist:root .record-status--border.ignored, .theme--calm-mist:root .record-status--border.pending { border-left-color: var(--cm-line-strong); }

/* 评测进度条 */
.theme--calm-mist:root.page--record_main .col--status__progress { background: color-mix(in srgb, var(--cm-primary) 16%, var(--cm-surface)); }

/* ---- 提交详情 ---- */
.theme--calm-mist:root.page--record_detail .record-status--text { font-size: 1rem; font-weight: 700; vertical-align: middle; }
.theme--calm-mist:root.page--record_detail #status .section__title { display: flex; align-items: center; gap: 8px; font-size: 1.35rem; }
.theme--calm-mist:root.page--record_detail .record-status--icon { font-size: 1.2rem; }

/* 编译信息 / 评测信息 */
.theme--calm-mist:root.page--record_detail .compiler-text, .theme--calm-mist:root.page--record_detail .judge-text {
  max-height: none; margin: 0; padding: 12px 16px; border: 1px solid color-mix(in srgb, var(--cm-text) 82%, var(--cm-primary)); border-radius: 12px; background: var(--cm-text);
  color: color-mix(in srgb, var(--cm-surface) 78%, var(--cm-primary)); font-family: var(--cm-mono); font-size: 12.5px; line-height: 1.65; white-space: pre-wrap;
}
.theme--calm-mist:root.page--record_detail .compiler-text-mask { background-image: linear-gradient(to bottom, transparent, var(--cm-surface) 25px); }
.theme--calm-mist:root.page--record_detail .compiler-text-mask p { color: var(--cm-primary-deep); cursor: pointer; }

/* 测试点表格 */
.theme--calm-mist:root .record_detail__table thead th {
  padding: 10px 10px; background: color-mix(in srgb, var(--cm-surface-2) 60%, var(--cm-surface)); color: var(--cm-faint); font-size: 11.5px; font-weight: 650;
}
.theme--calm-mist:root .record_detail__table tbody td { padding: 8px 10px; border-color: color-mix(in srgb, var(--cm-line) 80%, transparent); }
.theme--calm-mist:root .record_detail__table .col--case { color: var(--cm-faint); font-family: var(--cm-mono); font-size: 11.5px; }
.theme--calm-mist:root.page--record_detail .subtask { background: color-mix(in srgb, var(--cm-surface-2) 70%, var(--cm-surface)) !important; }
.theme--calm-mist:root.page--record_detail .subtask td { color: var(--cm-muted); font-weight: 650; }
.theme--calm-mist:root .record_detail__table .message { margin-left: 8px; color: var(--cm-faint); font-size: 11.5px; }

/* 代码块（提交详情） */
.theme--calm-mist:root.page--record_detail .section__body pre, .theme--calm-mist:root.page--record_detail .section__body pre.line-numbers {
  margin: 0; padding: 16px 18px; border: 1px solid color-mix(in srgb, var(--cm-text) 82%, var(--cm-primary)); border-radius: 14px; background: var(--cm-text);
  color: color-mix(in srgb, var(--cm-surface) 78%, var(--cm-primary)); font-family: var(--cm-mono); font-size: 12.5px; line-height: 1.7; box-shadow: inset 0 1px 0 color-mix(in srgb, var(--cm-surface) 4%, transparent);
}
.theme--calm-mist:root.page--record_detail .section__body pre code, .theme--calm-mist:root.page--record_detail .section__body pre code[class*="language-"] {
  color: inherit; font-family: var(--cm-mono); font-size: 1em; background: transparent; border: 0;
}

/* 行号插件 */
.theme--calm-mist:root .line-numbers .line-numbers-rows { border-right-color: color-mix(in srgb, var(--cm-surface) 22%, transparent); }
.theme--calm-mist:root .line-numbers .line-numbers-rows > span::before { color: color-mix(in srgb, var(--cm-muted) 70%, var(--cm-surface)); }

/* 详情侧栏信息表 */
.theme--calm-mist:root.page--record_detail .section.side .section__body.typo dl.horizontal { margin: 0; }
.theme--calm-mist:root.page--record_detail .section.side .section__body.typo dt { color: var(--cm-faint); font-weight: 500; }
.theme--calm-mist:root.page--record_detail .section.side .section__body.typo dd { color: var(--cm-text); font-weight: 550; }
.theme--calm-mist:root.page--record_detail #summary { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--cm-line); }

/* 提交记录页的统计 dl */
.theme--calm-mist:root.page--record_main .section__body dl.horizontal dt { color: var(--cm-faint); font-weight: 500; }

/* 题目统计页复用的记录表 */
.theme--calm-mist:root.page--problem_statistics .record_main__table thead th {
  background: color-mix(in srgb, var(--cm-surface-2) 62%, var(--cm-surface)); color: var(--cm-faint); font-size: 11.5px; font-weight: 650;
}

/* ============================================================
 * 08 用户主页 /user/:uid
 * ============================================================ */

/* 头部背景：模板用内联 style 注入背景图，必须 !important 才能换成晨雾青渐变 */
.theme--calm-mist:root.page--user_detail .profile-header {
  min-height: 232px; padding-bottom: 24px;
  background-image: radial-gradient(circle at 88% 8%, color-mix(in srgb, var(--cm-primary) 42%, transparent) 0, transparent 46%), radial-gradient(circle at 6% 112%, color-mix(in srgb, var(--cm-accent) 30%, transparent) 0, transparent 50%), linear-gradient(118deg, color-mix(in srgb, var(--cm-primary) 34%, var(--cm-text)), color-mix(in srgb, var(--cm-primary) 14%, var(--cm-text)) 58%, var(--cm-text)) !important;
  background-size: cover !important; background-position: center !important; border-radius: var(--cm-radius-lg);
}
.theme--calm-mist:root.page--user_detail .profile-header__content { padding: 22px 26px 0; }
.theme--calm-mist:root.page--user_detail .profile-header__avatar, .theme--calm-mist:root.page--user_detail .user-profile-avatar.large {
  border: 3px solid color-mix(in srgb, var(--cm-surface) 60%, transparent); box-shadow: 0 10px 30px rgba(18, 33, 30, .22);
}
.theme--calm-mist:root.page--user_detail .profile-header__main h1 { margin-bottom: 6px; color: var(--cm-surface); font-size: 1.7rem; font-weight: 750; letter-spacing: -.4px; line-height: 1.35; }
.theme--calm-mist:root.page--user_detail .profile-header__main h1 small { color: color-mix(in srgb, var(--cm-surface) 58%, transparent); font-size: .85rem; font-weight: 500; }
.theme--calm-mist:root.page--user_detail .profile-header__main p { color: color-mix(in srgb, var(--cm-surface) 76%, transparent); font-size: 12.5px; line-height: 1.85; }
.theme--calm-mist:root.page--user_detail .profile-header__contact-bar { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.theme--calm-mist:root.page--user_detail .profile-header__contact-item {
  display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 8px; margin: 0; border-radius: 10px; background: color-mix(in srgb, var(--cm-surface) 14%, transparent);
  color: color-mix(in srgb, var(--cm-surface) 82%, transparent); font-size: 12px; transition: background .15s, color .15s;
}
.theme--calm-mist:root.page--user_detail .profile-header__contact-item:hover { background: color-mix(in srgb, var(--cm-surface) 24%, transparent); color: var(--cm-surface); text-decoration: none; }
.theme--calm-mist:root.page--user_detail .profile-header__contact-item.user-profile-badge {
  border-radius: var(--cm-radius-pill); font-size: 10.5px !important; font-weight: 700; letter-spacing: .04em;
}

/* 徽章：柔和化 ui-default 的高饱和底色（它写死了 !important） */
.theme--calm-mist:root .profile-header .user-profile-badge.badge--su {
  background-color: color-mix(in srgb, var(--cm-danger) 74%, var(--cm-surface)) !important; color: var(--cm-primary-ink) !important;
}
.theme--calm-mist:root .profile-header .user-profile-badge.badge--mod {
  background-color: color-mix(in srgb, var(--cm-accent) 72%, var(--cm-surface)) !important; color: var(--cm-primary-ink) !important;
}

/* 资料 tab 区域：紧接在头部下方，白色卡片内展开 */
.theme--calm-mist:root.page--user_detail .profile-content { margin-top: 0; }
.theme--calm-mist:root.page--user_detail .profile-content .section__tab-container { padding: 0; }
.theme--calm-mist:root.page--user_detail .section__tab-header-wrapper { overflow: visible; }
.theme--calm-mist:root.page--user_detail .section__tab-header { gap: 4px; margin-bottom: 0; padding: 12px 22px; border-bottom: 1px solid var(--cm-line); }
.theme--calm-mist:root.page--user_detail .section__tab-header-item { border: 0; border-radius: 10px 10px 0 0; color: var(--cm-muted) !important; font-weight: 600; padding: 0 16px; }
.theme--calm-mist:root.page--user_detail .section__tab-header-item:hover { background: var(--cm-surface-2); color: var(--cm-text) !important; }
.theme--calm-mist:root.page--user_detail .section__tab-header-item.selected, .theme--calm-mist:root.page--user_detail .section__tab-header-item.tab--active {
  background: var(--cm-primary-soft); color: var(--cm-primary-deep) !important;
}
.theme--calm-mist:root.page--user_detail .section__tab-item { margin: 0; padding: 8px 0 20px; border-bottom: 0; }
.theme--calm-mist:root.page--user_detail .section__tab-title { padding: 10px 24px 2px; color: var(--cm-faint); font-size: 12px; font-weight: 650; letter-spacing: .04em; }
.theme--calm-mist:root.page--user_detail .section__tab-main .typo h1, .theme--calm-mist:root.page--user_detail .section__tab-main .typo h2, .theme--calm-mist:root.page--user_detail .section__tab-main .typo h3 {
  color: var(--cm-text); font-weight: 700;
}
.theme--calm-mist:root.page--user_detail .section__tab-main .typo ul { list-style: none; margin-left: 0; }
.theme--calm-mist:root.page--user_detail .section__tab-main .typo a { color: var(--cm-primary-deep); }

/* 侧栏统计 */
.theme--calm-mist:root .sidebar-user-stat { padding: 4px 0; }
.theme--calm-mist:root .sidebar-user-stat .numbox__num { color: var(--cm-text); font-weight: 750; font-size: 1.35rem; letter-spacing: -.3px; }
.theme--calm-mist:root .sidebar-user-stat .numbox__text { margin-top: 4px; color: var(--cm-faint); font-size: 11.5px; }

/* 用户主页的右侧菜单（自己的主页） */
.theme--calm-mist:root.page--user_detail .section.side .menu { padding: 8px 8px 10px; }
.theme--calm-mist:root.page--user_detail .section.side .menu__link { margin: 1px 0; padding: 9px 12px; border-left: 0; border-radius: 10px; color: var(--cm-muted); font-size: 13.5px; }
.theme--calm-mist:root.page--user_detail .section.side .menu__link .icon { margin-right: 8px; color: var(--cm-primary); }
.theme--calm-mist:root.page--user_detail .section.side .menu__link:hover { background: var(--cm-surface-2); color: var(--cm-primary-deep); }
.theme--calm-mist:root.page--user_detail .section.side .menu__link.active { background: var(--cm-primary-soft); color: var(--cm-primary-deep); }

/* ============================================================
 * 09 讨论列表 / 详情 / 回复
 * ============================================================ */

/* ---- 列表 ---- */
.theme--calm-mist:root .discussion__list { margin: 0; padding: 0 24px 8px; list-style: none; }
.theme--calm-mist:root .discussion__item { padding: 18px 2px 18px 14px; border-bottom: 1px solid var(--cm-line); border-left: 3px solid transparent; transition: background .14s, border-color .14s; }
.theme--calm-mist:root .discussion__item:last-child { border-bottom: 0; }
.theme--calm-mist:root .discussion__item:hover { background: color-mix(in srgb, var(--cm-surface-2) 45%, var(--cm-surface)); }
.theme--calm-mist:root .discussion__item.highlight { border-left-color: var(--cm-primary); background: color-mix(in srgb, var(--cm-primary) 4%, var(--cm-surface)); }
.theme--calm-mist:root .discussion__replies.numbox {
  width: 62px; padding: 6px 0; border: 1px solid var(--cm-line); border-radius: 12px; background: color-mix(in srgb, var(--cm-surface-2) 65%, var(--cm-surface));
}
.theme--calm-mist:root .discussion__replies .numbox__num { color: var(--cm-primary-deep); font-size: 1.15rem; font-weight: 750; line-height: 1.2; }
.theme--calm-mist:root .discussion__replies .numbox__text { margin-top: 2px; color: var(--cm-faint); font-size: 10.5px; }
.theme--calm-mist:root .discussion__title { margin-bottom: 6px; font-size: 1.02rem; font-weight: 650; line-height: 1.45; }
.theme--calm-mist:root .discussion__title a { color: var(--cm-text); }
.theme--calm-mist:root .discussion__title a:visited { color: color-mix(in srgb, var(--cm-text) 74%, var(--cm-faint)); }
.theme--calm-mist:root .discussion__title a:hover { color: var(--cm-primary-deep); }
.theme--calm-mist:root .discussion__item .supplementary.list { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.theme--calm-mist:root .discussion__item .supplementary.list li { display: inline-flex; align-items: center; color: var(--cm-faint); }
.theme--calm-mist:root .discussion-node-tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: var(--cm-radius-pill); background: var(--cm-surface-2); border: 1px solid var(--cm-line);
  color: var(--cm-muted); font-size: 11.5px;
}
.theme--calm-mist:root .discussion-node-tag:hover { border-color: var(--cm-primary); color: var(--cm-primary-deep); text-decoration: none; }
.theme--calm-mist:root .discussion-node-tag .icon { color: var(--cm-primary); }

/* 讨论节点卡片里的配图 */
.theme--calm-mist:root .discussion-node__bg { border-radius: var(--cm-radius-lg) var(--cm-radius-lg) 0 0; opacity: .9; }

/* ---- 详情 ---- */
.theme--calm-mist:root.page--discussion_detail .topic__content, .theme--calm-mist:root.page--blog_detail .topic__content {
  margin: 18px 0 6px; color: color-mix(in srgb, var(--cm-text) 88%, var(--cm-muted)); line-height: 1.85;
}
.theme--calm-mist:root.page--discussion_detail .section__footer.supplementary.dot.list {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 14px 24px; border-top: 1px solid var(--cm-line); background: color-mix(in srgb, var(--cm-surface-2) 40%, var(--cm-surface));
}
.theme--calm-mist:root.page--discussion_detail .section__footer .supplementary a { color: var(--cm-muted); }
.theme--calm-mist:root.page--discussion_detail .section__footer .supplementary a:hover { color: var(--cm-primary-deep); }
.theme--calm-mist:root.page--discussion_detail .star { color: var(--cm-faint); cursor: pointer; }
.theme--calm-mist:root.page--discussion_detail .star.activated, .theme--calm-mist:root.page--discussion_detail .star:hover { color: var(--cm-accent); }

/* 表情回应 */
.theme--calm-mist:root .reactions.list { display: flex; flex-wrap: wrap; gap: 6px; }
.theme--calm-mist:root .reaction {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border: 1px solid var(--cm-line); border-radius: var(--cm-radius-pill); background: var(--cm-surface); color: var(--cm-muted);
  font-size: 11.5px; cursor: pointer;
}
.theme--calm-mist:root .reaction.active, .theme--calm-mist:root .reaction:hover {
  border-color: color-mix(in srgb, var(--cm-primary) 30%, var(--cm-line)); background: var(--cm-primary-soft); color: var(--cm-primary-deep);
}

/* 讨论详情侧栏的作者卡 */
.theme--calm-mist:root.page--discussion_detail .sidebar-user-profile .user-profile-name { color: var(--cm-text); font-size: 1.05rem; font-weight: 700; }
.theme--calm-mist:root.page--discussion_detail .section.side .profile__bg {
  height: 62px; margin-bottom: -28px; border-radius: var(--cm-radius-lg) var(--cm-radius-lg) 0 0;
  background: linear-gradient(120deg, color-mix(in srgb, var(--cm-primary) 26%, var(--cm-surface)), color-mix(in srgb, var(--cm-primary) 8%, var(--cm-surface)));
}

/* ---- 评论 / 回复 ---- */
.theme--calm-mist:root .dczcomments__list { margin: 0; padding: 0; list-style: none; }
.theme--calm-mist:root .dczcomments__item { padding: 16px 0; border-top: 1px dashed var(--cm-line); }
.theme--calm-mist:root .dczcomments__item:first-child { padding-top: 4px; border-top: 0; }
.theme--calm-mist:root .dczcomments__item .media__left { padding-right: 14px; }
.theme--calm-mist:root .dczcomments__item .user-profile-avatar { box-shadow: 0 0 0 2px var(--cm-surface), 0 0 0 3px var(--cm-line); }
.theme--calm-mist:root .dczcomments__supplementary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--cm-faint); font-size: 12px; }
.theme--calm-mist:root .dczcomments__supplementary .user-profile-name { color: var(--cm-text); font-weight: 650; }
.theme--calm-mist:root .dczcomments__operations { display: flex; gap: 6px; opacity: .55; transition: opacity .15s; }
.theme--calm-mist:root .dczcomments__item:hover .dczcomments__operations { opacity: 1; }
.theme--calm-mist:root .dczcomments__operations a {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 8px; color: var(--cm-faint); font-size: 13px;
}
.theme--calm-mist:root .dczcomments__operations a:hover { background: var(--cm-surface-2); color: var(--cm-primary-deep); }
.theme--calm-mist:root .dczcomments__replies { margin: 12px 0 0 6px; padding: 2px 0 2px 16px; border-left: 2px solid var(--cm-primary-soft); list-style: none; }
.theme--calm-mist:root .dczcomments__reply { padding: 10px 0; }
.theme--calm-mist:root .dczcomments__reply + .dczcomments__reply { border-top: 1px dashed var(--cm-line); }
.theme--calm-mist:root .dczcomments__item .typo { margin-top: 6px; color: color-mix(in srgb, var(--cm-text) 88%, var(--cm-muted)); font-size: 14px; line-height: 1.8; }
.theme--calm-mist:root .dczcomments__box { margin-bottom: 8px; }
.theme--calm-mist:root .dczcomments__box textarea.textbox, .theme--calm-mist:root .commentbox-placeholder textarea.textbox {
  min-height: 96px; border-radius: 14px; background: color-mix(in srgb, var(--cm-surface-2) 45%, var(--cm-surface));
}
.theme--calm-mist:root .dczcomments__box__submit { margin-top: 8px; }

/* ---- 讨论编辑器 ---- */
.theme--calm-mist:root.page--discussion_create .section__body > form > .row:first-child, .theme--calm-mist:root.page--discussion_edit .section__body > form > .row:first-child { margin-bottom: 4px; }
.theme--calm-mist:root.page--discussion_create textarea.textbox, .theme--calm-mist:root.page--discussion_edit textarea.textbox {
  border-radius: 14px; background: color-mix(in srgb, var(--cm-surface-2) 40%, var(--cm-surface));
}
.theme--calm-mist:root.page--discussion_create .checkbox, .theme--calm-mist:root.page--discussion_edit .checkbox { margin-top: 2px !important; }

/* Markdown 语法提示卡 */
.theme--calm-mist:root.page--discussion_create .section.side .section__body, .theme--calm-mist:root .components-md_hint { color: var(--cm-muted); font-size: 12.5px; }

/* ============================================================
 * 10 作业 /homework
 * ============================================================ */
.theme--calm-mist:root.page--homework_main .homework__list { margin: 0; padding: 0 24px 14px; list-style: none; }
.theme--calm-mist:root.page--homework_main .homework__item { padding: 18px 2px 18px 14px; border-bottom: 1px solid var(--cm-line); border-left: 3px solid transparent; transition: background .14s; }
.theme--calm-mist:root.page--homework_main .homework__item:last-child { border-bottom: 0; }
.theme--calm-mist:root.page--homework_main .homework__item:hover { background: color-mix(in srgb, var(--cm-surface-2) 45%, var(--cm-surface)); }
.theme--calm-mist:root.page--homework_main .homework__date.numbox {
  width: 62px; margin-right: 16px; padding: 9px 8px; border: 1px solid color-mix(in srgb, var(--cm-accent) 16%, var(--cm-line)); border-radius: 15px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--cm-accent) 9%, var(--cm-surface)), color-mix(in srgb, var(--cm-accent) 4%, var(--cm-surface)));
}
.theme--calm-mist:root.page--homework_main .homework__date .numbox__num.large {
  color: color-mix(in srgb, var(--cm-accent) 62%, var(--cm-text)); font-size: 1.4rem; font-weight: 750; letter-spacing: -.5px; line-height: 1.1;
}
.theme--calm-mist:root.page--homework_main .homework__date .numbox__text { margin-top: 4px; color: var(--cm-faint); font-size: 11px; }
.theme--calm-mist:root.page--homework_main .homework__title { margin-bottom: 8px; font-size: 1.05rem; font-weight: 700; line-height: 1.35; }
.theme--calm-mist:root.page--homework_main .homework__title a { color: var(--cm-text); }
.theme--calm-mist:root.page--homework_main .homework__title a:hover { color: var(--cm-primary-deep); }
.theme--calm-mist:root.page--homework_main .homework__item .supplementary.list { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.theme--calm-mist:root.page--homework_main .homework__item .supplementary.list li { color: var(--cm-muted); font-size: 12.5px; }
.theme--calm-mist:root.page--homework_main .section__tools .filter-form { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; }
.theme--calm-mist:root.page--homework_main .section__tools .compact.button { height: 32px; padding: 0 14px; border-radius: 10px; font-size: 12.5px; }

/* 作业详情 */
.theme--calm-mist:root.page--homework_detail .section__header .section__title { color: var(--cm-text); font-weight: 700; }
.theme--calm-mist:root.page--homework_detail .data-table thead th {
  background: color-mix(in srgb, var(--cm-surface-2) 62%, var(--cm-surface)); color: var(--cm-faint); font-size: 11.5px; font-weight: 650;
}
.theme--calm-mist:root.page--homework_detail .col--problem { font-weight: 600; }
.theme--calm-mist:root.page--homework_detail .section.side .menu { padding: 8px 8px 10px; }
.theme--calm-mist:root.page--homework_detail .section.side .menu__link { margin: 1px 0; padding: 9px 12px; border-left: 0; border-radius: 10px; color: var(--cm-muted); font-size: 13.5px; }
.theme--calm-mist:root.page--homework_detail .section.side .menu__link .icon { margin-right: 8px; color: var(--cm-primary); }
.theme--calm-mist:root.page--homework_detail .section.side .menu__link:hover { background: var(--cm-surface-2); color: var(--cm-primary-deep); }
.theme--calm-mist:root.page--homework_detail .section.side .menu__seperator { margin: 6px 8px; border-top: 1px dashed var(--cm-line); }

/* ============================================================
 * 11 登录 / 注册 / 找回密码（immersive 布局）
 * ============================================================ */

/* immersive 背景：替换 ui-default 的蓝色照片，换成晨雾青渐变 */
.theme--calm-mist:root.layout--immersive #panel {
  background: radial-gradient(circle at 16% 8%, color-mix(in srgb, var(--cm-primary) 18%, transparent) 0, transparent 46%), radial-gradient(circle at 86% 84%, color-mix(in srgb, var(--cm-accent) 12%, transparent) 0, transparent 42%), linear-gradient(160deg, var(--cm-surface-2) 0%, var(--cm-bg) 52%, color-mix(in srgb, var(--cm-primary) 8%, var(--cm-bg)) 100%);
  background-size: auto;
}
.theme--calm-mist:root.layout--immersive .immersive--content { color: var(--cm-text); }

/* ui-default 给 .material.inverse 的焦点下划线用了淡黄色，
   且其特异性高于 base，这里拉回薄荷青 */
.theme--calm-mist:root.layout--immersive label.material.textbox input:focus {
  border-bottom-color: var(--cm-primary) !important;
  box-shadow: none;
}

/* 说明：登录卡片框架（宽度 / 圆角 / 阴影 / 输入框 / 主按钮）由 base 统一负责，
   这里只补 base 未覆盖的次级按钮、补充链接与页脚对比度。 */

/* OAuth / 次级按钮 */
.theme--calm-mist:root.layout--immersive .immersive--center .button:not(.primary) {
  width: 100%; height: 42px; border: 1px solid var(--cm-line-strong); border-radius: var(--cm-radius-pill); background: var(--cm-surface); color: var(--cm-text); font-size: 13.5px; font-weight: 600;
  box-shadow: none;
}
.theme--calm-mist:root.layout--immersive .immersive--center .button:not(.primary):hover {
  border-color: color-mix(in srgb, var(--cm-primary) 30%, var(--cm-line-strong)); background: var(--cm-surface-2); color: var(--cm-primary-deep);
}

/* 底部补充链接 */
.theme--calm-mist:root.layout--immersive .immersive--center .supplementary.inverse, .theme--calm-mist:root.layout--immersive .immersive--center .supplementary.inverse a {
  color: var(--cm-muted) !important; font-size: 12.5px;
}
.theme--calm-mist:root.layout--immersive .immersive--center .supplementary.inverse a:hover { color: var(--cm-primary-deep) !important; text-decoration: none; }

/* 找回密码页的说明文字 */
.theme--calm-mist:root.page--user_lostpass .immersive--center p, .theme--calm-mist:root.page--user_register .immersive--center p {
  color: var(--cm-muted); font-size: 12.5px; line-height: 1.75; text-align: center;
}

/* immersive 页脚：ui-default 强制白色，浅色背景下要改回深色 */
.theme--calm-mist:root.layout--immersive .footer { background: transparent; color: var(--cm-faint); }
.theme--calm-mist:root.layout--immersive .footer a, .theme--calm-mist:root.layout--immersive .footer a:visited, .theme--calm-mist:root.layout--immersive .footer a:hover, .theme--calm-mist:root.layout--immersive .footer a:active {
  color: var(--cm-faint);
}
.theme--calm-mist:root.layout--immersive .footer a:hover { color: var(--cm-primary-deep); }

/* ============================================================
 * 12 设置页与表单特化
 * ============================================================ */

/* 设置页（/home/settings/{account,preference,domain}、/home/security 等）：
   侧栏菜单与基础表单由 base 统一负责，这里只补表单节奏与头像区 */
.theme--calm-mist:root .page--home_account .section__body .form__item,
.theme--calm-mist:root .page--home_preference .section__body .form__item,
.theme--calm-mist:root .page--home_settings .section__body .form__item { margin-bottom: 18px; }
.theme--calm-mist:root .page--home_account .section__body .form__item label,
.theme--calm-mist:root .page--home_preference .section__body .form__item label,
.theme--calm-mist:root .page--home_settings .section__body .form__item label { color: var(--cm-text); font-weight: 600; font-size: 13.5px; }
.theme--calm-mist:root .page--home_account .section__header .section__title,
.theme--calm-mist:root .page--home_preference .section__header .section__title,
.theme--calm-mist:root .page--home_settings .section__header .section__title { font-size: 1rem; font-weight: 700; }

/* 头像区 */
.theme--calm-mist:root #upload_avatar img { border-radius: 18px; box-shadow: var(--cm-shadow); }
.theme--calm-mist:root #upload_avatar .change-avatar { margin-top: 12px; }

/* 保存按钮 */
.theme--calm-mist:root .page--home_account input[type="submit"].button.primary,
.theme--calm-mist:root .page--home_preference input[type="submit"].button.primary,
.theme--calm-mist:root .page--home_security input[type="submit"].button.primary {
  height: 42px; min-width: 150px; border-radius: var(--cm-radius-pill);
}
.theme--calm-mist:root .page--home_messages .section__body blockquote.warn { margin: 0 0 12px; border-radius: 10px; }

/* 站内消息（React MessagePad，类名来自 components/messagepad/*.styl） */
.theme--calm-mist:root .messagepad { background: var(--cm-surface); }
.theme--calm-mist:root .messagepad__sidebar { border-right: 1px solid var(--cm-line); background: color-mix(in srgb, var(--cm-surface-2) 42%, var(--cm-surface)); }
.theme--calm-mist:root .messagepad__list-item { padding: 16px 18px; border-left: 3px solid transparent; color: var(--cm-text); font-size: 13.5px; }
.theme--calm-mist:root .messagepad__list-item:hover { border-color: var(--cm-line-strong); background: color-mix(in srgb, var(--cm-primary) 4%, var(--cm-surface)); text-decoration: none; }
.theme--calm-mist:root .messagepad__list-item.active { border-color: var(--cm-primary); background: var(--cm-primary-soft); }
.theme--calm-mist:root .messagepad__desc { color: var(--cm-faint); font-size: 12px; }
.theme--calm-mist:root .messagepad__header { border-bottom: 1px solid var(--cm-line); background: var(--cm-surface); color: var(--cm-muted); font-size: 13px; }
.theme--calm-mist:root .messagepad__content { background: var(--cm-surface); }
.theme--calm-mist:root .messagepad__input { border-top: 1px solid var(--cm-line); background: color-mix(in srgb, var(--cm-surface-2) 40%, var(--cm-surface)); }
.theme--calm-mist:root .messagepad__input button:enabled { background: var(--cm-primary); color: var(--cm-primary-ink); border-radius: 0 0 12px 0; }
.theme--calm-mist:root .messagepad__input button:enabled:hover { background: var(--cm-primary-deep); }
.theme--calm-mist:root .messagepad__textarea-container textarea { color: var(--cm-text); font-family: var(--cm-font); }
.theme--calm-mist:root .messagepad__message__avatar img { border-radius: 50%; }
.theme--calm-mist:root .messagepad__message__body { border-radius: 14px; font-size: 13.5px; line-height: 1.7; }
.theme--calm-mist:root .side--other .messagepad__message__body { background: var(--cm-primary); color: var(--cm-primary-ink); }
.theme--calm-mist:root .side--other .messagepad__message__body:after { border-top-color: var(--cm-primary); }
.theme--calm-mist:root .side--self .messagepad__message__body { background: var(--cm-surface-2); color: var(--cm-text); }
.theme--calm-mist:root .side--self .messagepad__message__body:after { border-top-color: var(--cm-surface-2); }

/* 全局设置表单的 radio / image radio */
.theme--calm-mist:root .radiobox-container { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.theme--calm-mist:root .radiobox.with-image { margin: 0; }
.theme--calm-mist:root .radiobox.with-image .radiobox__image-container {
  border: 2px solid var(--cm-line); border-radius: 12px; opacity: .72; transition: border-color .15s, opacity .15s, transform .15s;
}
.theme--calm-mist:root .radiobox.with-image .radiobox__image-container:hover { border-color: color-mix(in srgb, var(--cm-primary) 38%, var(--cm-line)); opacity: 1; transform: translateY(-1px); }
.theme--calm-mist:root .radiobox.with-image input:checked + .radiobox__image-container {
  border-color: var(--cm-primary); opacity: 1; box-shadow: 0 0 0 3px color-mix(in srgb, var(--cm-primary) 14%, transparent);
}

/* ============================================================
 * 13 全局组件
 * ============================================================ */

/* ---- 文本输入 / 下拉：补齐 ui-default 在紧凑场景的细节 ---- */
.theme--calm-mist:root input.textbox.inline, .theme--calm-mist:root select.select.inline { display: inline-block; width: auto; margin-bottom: 0; }
.theme--calm-mist:root input.textbox.compact, .theme--calm-mist:root select.select.compact { height: 32px; padding-top: 0; padding-bottom: 0; border-radius: 9px; font-size: 12.5px; }
.theme--calm-mist:root .textbox-container, .theme--calm-mist:root .select-container { margin-bottom: 0; }
.theme--calm-mist:root .help-text { color: var(--cm-faint); font-size: 12px; line-height: 1.65; }

/* ---- 复选框：薄荷青勾选 ---- */
.theme--calm-mist:root .checkbox input[type="checkbox"] {
  position: relative; width: 16px; height: 16px; border: 1.5px solid var(--cm-line-strong); border-radius: 5px; background: var(--cm-surface);
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.theme--calm-mist:root .checkbox input[type="checkbox"]:hover { border-color: color-mix(in srgb, var(--cm-primary) 40%, var(--cm-line-strong)); }
.theme--calm-mist:root .checkbox input[type="checkbox"]:checked { border-color: var(--cm-primary); background: var(--cm-primary); box-shadow: 0 2px 6px color-mix(in srgb, var(--cm-primary) 22%, transparent); }
.theme--calm-mist:root .checkbox input[type="checkbox"]::after {
  content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: 0; border-right: 2px solid var(--cm-primary-ink); border-bottom: 2px solid var(--cm-primary-ink);
  background: transparent; opacity: 0; transform: rotate(45deg);
}
.theme--calm-mist:root .checkbox input[type="checkbox"]:checked::after { opacity: 1; }

/* ---- 单选框 ---- */
.theme--calm-mist:root .radiobox input[type="radio"] {
  appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin-right: 5px; border: 1.5px solid var(--cm-line-strong); border-radius: 50%; background: var(--cm-surface);
  vertical-align: -2px; transition: border-color .12s, box-shadow .12s;
}
.theme--calm-mist:root .radiobox input[type="radio"]:checked { border-color: var(--cm-primary); background: var(--cm-primary); box-shadow: inset 0 0 0 3px var(--cm-surface); }

/* ---- tab（ui-default 实际类名是 .section__tab-*） ---- */
.theme--calm-mist:root .section__tab-container.immersive .section__tab-header-item { border-radius: 10px 10px 0 0; color: color-mix(in srgb, var(--cm-surface) 78%, transparent); }
.theme--calm-mist:root .section__tab-container.immersive .section__tab-header-item:hover { color: var(--cm-surface); }
.theme--calm-mist:root .section__tab-container.immersive .section__tab-header-item.selected { background: var(--cm-surface); color: var(--cm-text); box-shadow: var(--cm-shadow); }
.theme--calm-mist:root .section__tab-container:not(.immersive) .section__tab-header-item { border-top: 0; border-bottom: 2px solid transparent; color: var(--cm-muted); font-weight: 600; }
.theme--calm-mist:root .section__tab-container:not(.immersive) .section__tab-header-item:hover {
  background: var(--cm-surface-2); border-bottom-color: color-mix(in srgb, var(--cm-primary) 40%, transparent); color: var(--cm-text);
}
.theme--calm-mist:root .section__tab-container:not(.immersive) .section__tab-header-item.tab--active, .theme--calm-mist:root .section__tab-container:not(.immersive) .section__tab-header-item.selected {
  border-bottom-color: var(--cm-primary); color: var(--cm-primary-deep); font-weight: 650;
}

/* ---- 分页 ---- */
.theme--calm-mist:root .pager { font-size: 12.5px; }
.theme--calm-mist:root .pager__item.ellipsis { border-color: transparent; background: transparent; color: var(--cm-faint); box-shadow: none; }
.theme--calm-mist:root .pager__item.first, .theme--calm-mist:root .pager__item.previous, .theme--calm-mist:root .pager__item.next, .theme--calm-mist:root .pager__item.last { font-weight: 600; }

/* ---- 菜单 / 下拉 ---- */
.theme--calm-mist:root .menu { font-size: 13.5px; }
.theme--calm-mist:root .menu__link { color: var(--cm-muted); }
.theme--calm-mist:root .menu__link .icon { color: var(--cm-primary); opacity: .9; }
.theme--calm-mist:root .menu__link.highlight { background: var(--cm-primary-soft); color: var(--cm-primary-deep); }
.theme--calm-mist:root .menu__link.active, .theme--calm-mist:root a.menu__link.active { background: var(--cm-primary-soft); color: var(--cm-primary-deep); border-color: var(--cm-primary); }
.theme--calm-mist:root .menu__link.disabled { color: var(--cm-faint); opacity: .65; }
.theme--calm-mist:root .dropdown .menu, .theme--calm-mist:root .nav__dropdown, .theme--calm-mist:root .dropdown-target.menu {
  border: 1px solid var(--cm-line); border-radius: 14px; background: var(--cm-surface); box-shadow: var(--cm-shadow-lift);
}
.theme--calm-mist:root .dropdown .menu__link { border-radius: 8px; color: var(--cm-muted); }
.theme--calm-mist:root .dropdown .menu__link:hover { background: var(--cm-surface-2); color: var(--cm-primary-deep); }

/* ---- tooltip ---- */
.theme--calm-mist:root .tooltip .drop-content {
  padding: .65em .95em; border-radius: 9px; background: var(--cm-text); color: color-mix(in srgb, var(--cm-surface) 88%, var(--cm-primary)); font-size: 12px; line-height: 1.5;
  box-shadow: 0 8px 24px rgba(18, 33, 30, .24);
}
.theme--calm-mist:root .tooltip.drop-element-attached-bottom .drop-content::before { border-top-color: var(--cm-text); }
.theme--calm-mist:root .tooltip.drop-element-attached-top .drop-content::before { border-bottom-color: var(--cm-text); }

/* ---- 弹窗 ---- */
.theme--calm-mist:root .dialog { background: rgba(18, 33, 30, .32); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.theme--calm-mist:root .dialog.withBg .dialog__content { border: 1px solid var(--cm-line); border-radius: var(--cm-radius-lg); background: var(--cm-surface); box-shadow: var(--cm-shadow-lift); }
.theme--calm-mist:root .dialog__body h1 { color: var(--cm-text); font-weight: 700; }

/* 登录弹窗（任意页面未登录时点“登录”） */
.theme--calm-mist:root .dialog--signin .dialog__content { border-radius: var(--cm-radius-lg); overflow: hidden; box-shadow: var(--cm-shadow-lift); }
.theme--calm-mist:root .dialog--signin .dialog--signin__bg {
  border-radius: var(--cm-radius-lg) 0 0 var(--cm-radius-lg);
  background: linear-gradient(145deg, color-mix(in srgb, var(--cm-primary) 38%, var(--cm-text)), color-mix(in srgb, var(--cm-primary) 16%, var(--cm-text))); box-shadow: none;
}
.theme--calm-mist:root .dialog--signin .dialog--signin__side { color: color-mix(in srgb, var(--cm-surface) 76%, transparent); }
.theme--calm-mist:root .dialog--signin .dialog--signin__side h1 { color: var(--cm-surface); font-size: 1.25rem; font-weight: 700; }
.theme--calm-mist:root .dialog--signin .dialog--signin__side p { font-size: 12.5px; line-height: 1.7; }
.theme--calm-mist:root .dialog--signin .dialog--signin__main { border-radius: 0 var(--cm-radius-lg) var(--cm-radius-lg) 0; background: var(--cm-surface); box-shadow: 0 0 40px rgba(18, 33, 30, .18); }
.theme--calm-mist:root .dialog--signin .dialog--signin__title { color: var(--cm-text); font-size: 1.2rem; font-weight: 750; }
.theme--calm-mist:root .dialog--signin .dialog--signin__note { margin-bottom: 1.4em; color: var(--cm-faint); font-size: 12.5px; }
.theme--calm-mist:root .dialog--signin .dialog--signin__close-container a {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--cm-radius-pill); background: var(--cm-surface-2); color: var(--cm-muted); font-size: 11.5px;
  text-decoration: none;
}
.theme--calm-mist:root .dialog--signin .dialog--signin__close-container a:hover { background: var(--cm-primary-soft); color: var(--cm-primary-deep); }
.theme--calm-mist:root .dialog--signin label.material.textbox input {
  border: 1px solid var(--cm-line-strong); border-radius: 12px; background: color-mix(in srgb, var(--cm-surface-2) 55%, var(--cm-surface)); padding: 8px 12px; color: var(--cm-text);
}
.theme--calm-mist:root .dialog--signin label.material.textbox input:focus { border-color: var(--cm-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cm-primary) 13%, transparent); }
.theme--calm-mist:root .dialog--signin .button.primary {
  border-radius: var(--cm-radius-pill); background: linear-gradient(180deg, color-mix(in srgb, var(--cm-primary) 84%, var(--cm-surface)), var(--cm-primary-deep)); color: var(--cm-primary-ink);
}

/* ---- 徽章 ---- */
.theme--calm-mist:root .badge--su { background-color: color-mix(in srgb, var(--cm-danger) 78%, var(--cm-surface)) !important; }
.theme--calm-mist:root .badge--mod { background-color: color-mix(in srgb, var(--cm-accent) 74%, var(--cm-surface)) !important; }

/* ---- 加载动画 ---- */
.theme--calm-mist:root .loader { border-color: color-mix(in srgb, var(--cm-primary) 18%, transparent); border-left-color: var(--cm-primary); }
.theme--calm-mist:root .outer-loader-container { background: color-mix(in srgb, var(--cm-bg) 78%, transparent); }

/* ---- 顶栏通知 / hint ---- */
.theme--calm-mist:root .global-notification { border-bottom: 1px solid var(--cm-line); background: var(--cm-surface); color: var(--cm-muted); font-size: 13px; }
.theme--calm-mist:root .global-notification.warning {
  border-bottom-color: color-mix(in srgb, var(--cm-warn) 22%, var(--cm-line)); background: color-mix(in srgb, var(--cm-warn) 8%, var(--cm-surface));
  color: color-mix(in srgb, var(--cm-warn) 70%, var(--cm-text));
}
.theme--calm-mist:root .hint { color: color-mix(in srgb, var(--cm-warn) 80%, var(--cm-text)); }

/* ---- 用户链接 / 头像 ---- */
.theme--calm-mist:root .user-profile-name { color: var(--cm-primary-deep); font-weight: 600; }
.theme--calm-mist:root .user-profile-name:hover { color: var(--cm-primary); text-decoration: none; }
.theme--calm-mist:root .user-profile-avatar { background: var(--cm-surface-2); }

/* ---- 评分 / 星标 ---- */
.theme--calm-mist:root .star { color: var(--cm-line-strong); }
.theme--calm-mist:root .star:hover, .theme--calm-mist:root .star.activated { color: var(--cm-accent); }

/* ---- 通用题目标签（题目信息侧栏 / 提交页 / 搜索列表共用） ---- */
.theme--calm-mist:root .problem__tags .problem__tag { height: auto; margin: 0 4px 2px 0 !important; padding: 0 !important; border: 0; background: transparent; }
.theme--calm-mist:root .problem__tags .problem__tag-link {
  display: inline-flex; align-items: center; height: 22px; max-width: 200px; padding: 0 9px; border: 1px solid var(--cm-line); border-radius: var(--cm-radius-pill);
  background: var(--cm-surface-2); color: var(--cm-muted) !important; font-size: 11.5px; line-height: 20px; transition: background .14s, border-color .14s, color .14s;
}
.theme--calm-mist:root .problem__tags .problem__tag-link:hover { border-color: var(--cm-primary); background: var(--cm-primary); color: var(--cm-primary-ink) !important; }

/* ---- 下拉框箭头：base 的纯色 background 会覆盖 ui-default 的箭头图标，这里用 CSS 三角补回 ---- */
.theme--calm-mist:root select:not(.search-sort) {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--cm-muted) 50%), linear-gradient(135deg, var(--cm-muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) calc(50% + 1px), calc(100% - 12px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}

/* ---- 文件上传按钮 ---- */
.theme--calm-mist:root input[type="file"] { color: var(--cm-muted); font-size: 13px; }
.theme--calm-mist:root input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 8px 16px; border: 1px solid var(--cm-line-strong); border-radius: var(--cm-radius-pill); background: var(--cm-surface);
  color: var(--cm-primary-deep); font-family: var(--cm-font); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background .14s, border-color .14s;
}
.theme--calm-mist:root input[type="file"]::file-selector-button:hover { border-color: color-mix(in srgb, var(--cm-primary) 35%, var(--cm-line-strong)); background: var(--cm-surface-2); }

/* ---- 代码块右上角的 Copy 工具条 ---- */
.theme--calm-mist:root.page--record_detail .section__body .toolbar { top: 8px !important; right: 10px !important; padding: 2px 4px; background: transparent; }
.theme--calm-mist:root.page--record_detail .section__body .toolbar-item a { color: color-mix(in srgb, var(--cm-surface) 62%, transparent) !important; font-size: 12px !important; }
.theme--calm-mist:root.page--record_detail .section__body .toolbar-item a:hover { color: var(--cm-surface) !important; }
/* ============================================================
 * 14 错误页
 * ============================================================ */
.theme--calm-mist:root.page--error .main > .row { max-width: 900px; }
.theme--calm-mist:root.page--error .error__container {
  margin: 24px auto; padding: 30px 34px; border: 1px solid var(--cm-line); border-radius: var(--cm-radius-lg);
  background: radial-gradient(circle at 88% 2%, color-mix(in srgb, var(--cm-primary) 10%, transparent) 0, transparent 46%), var(--cm-surface); box-shadow: var(--cm-shadow);
}
.theme--calm-mist:root.page--error .error__text-container { color: var(--cm-muted); line-height: 1.75; }
.theme--calm-mist:root.page--error .error__text-container h1 { margin-bottom: 14px; color: var(--cm-text); font-size: 2.6rem; font-weight: 800; letter-spacing: -1px; }
.theme--calm-mist:root.page--error .error__text-container p { margin: 6px 0; font-size: 13.5px; }
.theme--calm-mist:root.page--error .error__text-container ol { margin: 8px 0 0; padding-left: 4px; font-family: var(--cm-mono); font-size: 12px; color: var(--cm-faint); }
.theme--calm-mist:root.page--error .error__twd2 { opacity: .9; filter: saturate(.85); }

/* ============================================================
 * 15 响应式微调
 * ============================================================ */

@media only screen and (max-width: 1000px) {
  /* 比赛 / 作业 / 统计页顶部工具栏在窄屏改为普通文档流，避免绝对定位溢出 */
  .theme--calm-mist:root .contest-timer { display: none; }
  .theme--calm-mist:root.page--contest_main .section__tools, .theme--calm-mist:root.page--homework_main .section__tools, .theme--calm-mist:root.page--problem_statistics .section__tools {
    position: static; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px;
  }
  .theme--calm-mist:root.page--contest_main .section__tools .filter-form, .theme--calm-mist:root.page--homework_main .section__tools .filter-form { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .theme--calm-mist:root.page--problem_main .search, .theme--calm-mist:root.page--problem_category .search { padding-left: 12px; }
  .theme--calm-mist:root.page--problem_main .search > div, .theme--calm-mist:root.page--problem_category .search > div { display: none; }
  .theme--calm-mist:root.page--user_detail .profile-header { min-height: 220px; }
  .theme--calm-mist:root.page--user_detail .profile-header__main h1 { font-size: 1.45rem; }
}

@media only screen and (max-width: 600px) {
  .theme--calm-mist:root .main > .row > .columns > .section { margin-left: 0; margin-right: 0; }
  .theme--calm-mist:root.page--problem_main .section > .section__body.no-padding:first-of-type, .theme--calm-mist:root.page--problem_category .section > .section__body.no-padding:first-of-type {
    padding: 12px 14px 4px;
  }
  .theme--calm-mist:root.page--problem_main .search-sort, .theme--calm-mist:root.page--problem_category .search-sort { max-width: 96px; padding-right: 22px; }
  .theme--calm-mist:root.page--contest_main .contest__list, .theme--calm-mist:root .discussion__list, .theme--calm-mist:root.page--homework_main .homework__list {
    padding-left: 16px; padding-right: 16px;
  }
  .theme--calm-mist:root.page--contest_main .contest__item, .theme--calm-mist:root .discussion__item, .theme--calm-mist:root.page--homework_main .homework__item { padding-left: 10px; }
  .theme--calm-mist:root.page--contest_main .contest__date.numbox, .theme--calm-mist:root.page--homework_main .homework__date.numbox {
    width: 54px; margin-right: 10px; padding: 7px 6px; border-radius: 12px;
  }
  .theme--calm-mist:root.page--contest_main .contest__date .numbox__num.large, .theme--calm-mist:root.page--homework_main .homework__date .numbox__num.large { font-size: 1.2rem; }
  .theme--calm-mist:root.page--problem_detail .problem__tags, .theme--calm-mist:root.page--contest_detail .problem__tags, .theme--calm-mist:root.page--homework_detail .problem__tags { gap: 5px; }
  .theme--calm-mist:root.page--problem_detail .problem__tag-item, .theme--calm-mist:root.page--contest_detail .problem__tag-item, .theme--calm-mist:root.page--homework_detail .problem__tag-item {
    font-size: 12px;
  }
  .theme--calm-mist:root.page--user_detail .profile-header { min-height: 190px; border-radius: 16px; }
  .theme--calm-mist:root.page--user_detail .profile-header__content { padding: 18px 16px 0; }
  .theme--calm-mist:root.page--user_detail .profile-content { margin-top: 0; }
  .theme--calm-mist:root.page--record_detail .section__body pre, .theme--calm-mist:root.page--record_detail .section__body pre.line-numbers { padding: 12px 14px; font-size: 11.5px; }
  .theme--calm-mist:root.page--error .error__container { margin: 12px; padding: 20px; }
  .theme--calm-mist:root.page--error .error__text-container h1 { font-size: 2rem; }
}
