/* =========================================================================
 * style.css —— 工作台样式
 * 结构：1) 主题变量  2) 基础重置  3) 顶部栏  4) 主体布局
 *       5) 卡片与组件  6) 弹窗/提示  7) 响应式
 * 说明：所有颜色通过 CSS 变量统一管理，切换 data-theme 即可换肤。
 * ========================================================================= */

/* ============ 1. 主题变量 ============ */
:root {
  /* 尺寸与圆角 */
  --radius: 12px;
  --radius-sm: 8px;
  --gap: 16px;
  --max-width: 1440px;
  --topbar-h: 68px;

  /* 字体 */
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
          'Hiragino Sans GB', 'Microsoft YaHei', 'Source Han Sans SC', sans-serif;

  /* 深色主题（默认）：深蓝灰底 + 暖金点缀，贴合机关场景的稳重视觉 */
  --bg: #0d1117;
  --bg-soft: #131a24;
  --surface: #161d27;
  --surface-2: #1c2531;
  --border: #263040;
  --border-soft: #1f2733;
  --text: #e6edf3;
  --text-2: #b6c2cf;
  --muted: #8492a3;
  --accent: #c8a24a;
  --accent-soft: rgba(200, 162, 74, .14);
  --blue: #4c8bf5;
  --blue-soft: rgba(76, 139, 245, .14);
  --green: #3fb950;
  --red: #f0603a;
  --gray: #6e7c8c;
  --shadow: 0 8px 28px rgba(0, 0, 0, .38);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .25);
}

/* 浅色主题：白底 + 深蓝主色 + 暖金强调 */
[data-theme='light'] {
  --bg: #f4f6f9;
  --bg-soft: #eef1f6;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --border: #e2e8f0;
  --border-soft: #edf1f6;
  --text: #1f2937;
  --text-2: #475569;
  --muted: #71809a;
  --accent: #a8802f;
  --accent-soft: rgba(168, 128, 47, .12);
  --blue: #1f3a68;
  --blue-soft: rgba(31, 58, 104, .08);
  --green: #1f9254;
  --red: #d64533;
  --gray: #98a4b3;
  --shadow: 0 8px 24px rgba(31, 58, 104, .10);
  --shadow-sm: 0 2px 8px rgba(31, 58, 104, .08);
}

/* ============ 2. 基础重置 ============ */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }

a { color: inherit; text-decoration: none; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button { cursor: pointer; border: none; background: none; }

/* 统一滚动条（WebKit） */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
::-webkit-scrollbar-track { background: transparent; }

/* 键盘可达性焦点样式 */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============ 3. 顶部栏 ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg); /* 不支持 color-mix 的浏览器回退为纯色 */
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border-soft);
}

.topbar__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: var(--topbar-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

/* —— 站点标识 —— */
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand__logo {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #2b4f8f);
  box-shadow: var(--shadow-sm);
  letter-spacing: 1px;
}

.brand__text { min-width: 0; }

.brand__title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand__subtitle {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* —— 搜索 —— */
.search { flex: 1; min-width: 0; max-width: 620px; margin-left: auto; }

.search__box { position: relative; display: flex; align-items: center; }

.search__icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.search__input {
  width: 100%;
  height: 40px;
  padding: 0 58px 0 36px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}

.search__input::placeholder { color: var(--muted); }

.search__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* 隐藏浏览器自带的搜索清除按钮，避免与快捷键标签重叠 */
.search__input::-webkit-search-cancel-button { display: none; }

.search__kbd {
  position: absolute;
  right: 12px;
  padding: 2px 7px;
  font-size: 11px;
  font-family: var(--font);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-2);
  pointer-events: none;
}

/* 搜索结果下拉 */
.search__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 420px;
  overflow-y: auto;
  padding: 6px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search__group {
  padding: 8px 10px 4px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .5px;
}

.search__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.search__item:hover,
.search__item.is-active { background: var(--surface-2); }

.search__item-icon {
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 11px;
  background: var(--blue-soft);
  color: var(--blue);
}

.search__item-main { min-width: 0; flex: 1; }

.search__item-name {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search__item-desc {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search__empty { padding: 20px 10px; text-align: center; color: var(--muted); font-size: 13px; }

/* —— 右侧操作区 —— */
.topbar__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.clock { text-align: right; line-height: 1.25; margin-right: 4px; }

.clock__date { display: block; font-size: 13px; font-variant-numeric: tabular-nums; }
.clock__week { display: block; font-size: 11px; color: var(--muted); }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: var(--text-2);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all .18s ease;
}

.icon-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* —— 提醒条 —— */
.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 8px 20px 12px;
  font-size: 13px;
  color: var(--text-2);
}

.notice__tag {
  flex: none;
  padding: 1px 8px;
  font-size: 11px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
}

.notice__text { flex: 1; min-width: 0; }

.notice__close { flex: none; color: var(--muted); font-size: 16px; line-height: 1; }
.notice__close:hover { color: var(--text); }

/* ============ 4. 主体布局 ============ */
.main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 20px 8px;
}

/* 模块 1：数据速览 */
/* 自适应列宽：指标数量变化时（如从 4 个减为 2 个）不会留下大片空白 */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.stat {
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: .85;
}

.stat__label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat__value {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .5px;
  cursor: text;
  border-bottom: 1px dashed transparent;
  display: inline-block;
}

.stat__value:hover { border-bottom-color: var(--border); }
.stat__unit { margin-left: 3px; font-size: 12px; font-weight: 400; color: var(--muted); }
/* 添加指标占位卡 */
.stat--add {
  display: grid;
  place-items: center;
  min-height: 74px;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  border-style: dashed;
}

.stat--add::before { display: none; }
.stat--add:hover { color: var(--accent); border-color: var(--accent); }

.stat__del { position: absolute; right: 6px; top: 4px; color: var(--muted); font-size: 14px; opacity: 0; transition: opacity .15s; }
.stat:hover .stat__del { opacity: 1; }
.stat__del:hover { color: var(--red); }

/* —— 接口数据卡片（数值默认由服务器从安管平台抓取，也可点击改为手动录入） —— */
.stat--live .stat__value { cursor: pointer; }
/* 给右上角的来源标记留出空间，避免长标题被压住 */
.stat--live .stat__label { padding-right: 48px; }

/* 右上角数据来源标记 */
.stat__badge {
  position: absolute;
  right: 8px;
  top: 8px;
  padding: 1px 7px;
  font-size: 11px;
  line-height: 16px;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  opacity: .9;
}

/* 异常状态（离线 / 无数据 / 已过期）：改用警示色 */
.stat__badge.is-stale { background: #d8930a; }
/* 未启用实时数据：中性灰 */
.stat__badge.is-off { background: var(--muted); }
/* 手动录入值：蓝色，区别于绿色的接口实时值 */
.stat__badge.is-manual { background: var(--blue); }

/* 删除按钮与标记同处右上角，接口卡片把删除键下移避免重叠 */
.stat--live .stat__del { top: 28px; }

/* 数据更新时间 */
.stat__meta {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* 主体网格：桌面三列 */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  align-items: start;
}

.card--span2 { grid-column: span 2; }

/* ============ 5. 卡片与组件 ============ */
.card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-soft);
}

.card__title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .5px;
  position: relative;
  padding-left: 10px;
}

/* 标题左侧暖金竖条 */
.card__title::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 13px;
  border-radius: 2px;
  background: var(--accent);
}

.card__tools { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card__body { padding: 14px 16px 16px; flex: 1; }

/* —— 通用小按钮 —— */
.mini-btn {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 7px;
  color: var(--text-2);
  border: 1px solid var(--border);
  background: var(--surface-2);
  transition: all .18s ease;
}

.mini-btn:hover { color: var(--accent); border-color: var(--accent); }

.mini-btn--primary {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.mini-btn--primary:hover { color: #fff; filter: brightness(1.08); border-color: var(--blue); }

.mini-select {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 7px;
  color: var(--text-2);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.link-btn { font-size: 12px; color: var(--muted); }
.link-btn:hover { color: var(--red); }

.hint { margin-top: 10px; font-size: 11px; line-height: 1.7; color: var(--muted); }

/* —— 快捷入口 —— */
.quick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
}

/* 外层包裹：承载右上角删除按钮 */
.quick__wrap { position: relative; display: block; }

.quick__item {
  display: block;
  padding: 12px 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  text-align: center;
  transition: transform .18s ease, border-color .18s ease, background-color .18s ease;
}

.quick__wrap:hover .quick__item {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.quick__icon {
  width: 34px;
  height: 34px;
  margin: 0 auto 8px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #2f5ba8);
  letter-spacing: .5px;
}

.quick__name {
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick__desc {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick__del {
  position: absolute;
  right: 4px; top: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
  color: var(--muted);
  background: var(--surface);
  opacity: 0;
  transition: opacity .15s;
}

.quick__wrap:hover .quick__del { opacity: 1; }
.quick__del:hover { color: var(--red); }

/* —— 待办 —— */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }

.chip {
  padding: 3px 9px;
  font-size: 11.5px;
  border-radius: 999px;
  color: var(--text-2);
  border: 1px dashed var(--border);
  background: transparent;
  transition: all .18s ease;
}

.chip:hover { color: var(--accent); border-color: var(--accent); border-style: solid; }

.todo-form { display: flex; gap: 6px; margin-bottom: 12px; }

.todo-form__input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.todo-form__input:focus { outline: none; border-color: var(--accent); }

.todo-form__tag {
  width: 86px;
  height: 34px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.todo { max-height: 320px; overflow-y: auto; }

.todo__item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border-soft);
}

.todo__item:last-child { border-bottom: none; }

.todo__check {
  width: 17px;
  height: 17px;
  margin-top: 3px;
  flex: none;
  border-radius: 5px;
  border: 1.5px solid var(--border);
  display: grid;
  place-items: center;
  color: transparent;
  font-size: 11px;
  transition: all .18s ease;
}

.todo__item.is-done .todo__check {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.todo__text { flex: 1; font-size: 13px; word-break: break-word; }
.todo__item.is-done .todo__text { color: var(--muted); text-decoration: line-through; }

.todo__tag {
  flex: none;
  padding: 0 6px;
  font-size: 10.5px;
  line-height: 17px;
  border-radius: 4px;
  color: var(--accent);
  background: var(--accent-soft);
}

.todo__del { flex: none; color: var(--muted); font-size: 15px; line-height: 1; opacity: 0; }
.todo__item:hover .todo__del { opacity: 1; }
.todo__del:hover { color: var(--red); }

.todo-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-soft);
  font-size: 12px;
  color: var(--muted);
}

.empty { padding: 22px 0; text-align: center; font-size: 13px; color: var(--muted); }

/* —— 常用链接 —— */
.nav-group { margin-bottom: 14px; }
.nav-group:last-child { margin-bottom: 0; }

.nav-group__name {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: .5px;
  margin-bottom: 6px;
}

.nav-group__list { display: flex; flex-wrap: wrap; gap: 6px; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  font-size: 12.5px;
  border-radius: 999px;
  color: var(--text-2);
  border: 1px solid var(--border);
  background: var(--surface-2);
  transition: all .18s ease;
}

.nav-link.is-empty { opacity: .55; padding: 4px 10px; }

.nav-link__a { border-radius: 999px; }
.nav-link:hover { border-color: var(--blue); }
/* 不支持 :has() 的浏览器回退：链接文字变色提示可点击 */
.nav-link__a:hover { color: var(--accent); }

/* 悬停时整枚胶囊高亮为深蓝 */
.nav-link:has(.nav-link__a:hover) { background: var(--blue); border-color: var(--blue); }
.nav-link:has(.nav-link__a:hover) .nav-link__a { color: #fff; }
.nav-link:has(.nav-link__a:hover) .nav-link__del { color: rgba(255, 255, 255, .8); }

.nav-link__del {
  font-size: 13px;
  line-height: 1;
  color: var(--muted);
  opacity: 0;
  transition: opacity .15s;
}

.nav-link:hover .nav-link__del { opacity: 1; }
.nav-link__del:hover { color: var(--red); }

/* 触屏设备无 hover，删除按钮常显 */
@media (hover: none) {
  .quick__del, .nav-link__del, .stat__del { opacity: 1; }
  .server__ops, .file__ops, .todo__del { opacity: 1; }
}

/* —— 服务器状态 —— */
.server {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--border-soft);
}

.server:last-child { border-bottom: none; }

.dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--gray);
}

.dot--online { background: var(--green); box-shadow: 0 0 0 3px rgba(63, 185, 80, .16); }
.dot--offline { background: var(--red); box-shadow: 0 0 0 3px rgba(240, 96, 58, .16); }
.dot--checking { background: var(--accent); animation: pulse 1s infinite alternate; }

@keyframes pulse { from { opacity: .35; } to { opacity: 1; } }

.server__main { flex: 1; min-width: 0; }
.server__name { font-size: 13px; }
.server__meta { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.server__status { flex: none; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.server__ops { flex: none; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.server:hover .server__ops { opacity: 1; }
.server__op { color: var(--muted); font-size: 12px; padding: 0 3px; }
.server__op:hover { color: var(--accent); }
.server__op--del:hover { color: var(--red); }

/* —— 最近文件 —— */
.file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--border-soft);
}

.file:last-child { border-bottom: none; }

.file__ext {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--blue-soft);
}

.file__main { flex: 1; min-width: 0; }
.file__name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file__name.is-link { cursor: pointer; }
.file__name.is-link:hover { color: var(--accent); }
.file__meta { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file__ops { flex: none; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.file:hover .file__ops { opacity: 1; }
.file__op { color: var(--muted); font-size: 12px; padding: 0 3px; }
.file__op:hover { color: var(--accent); }
.file__op--del:hover { color: var(--red); }

/* ============ 6. 弹窗与提示 ============ */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }

.modal__mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); backdrop-filter: blur(2px); }

.modal__dialog {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 86vh;
  overflow: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal__head {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
}

.modal__title { font-size: 15px; font-weight: 600; }
.modal__close { margin-left: auto; font-size: 20px; line-height: 1; color: var(--muted); }
.modal__close:hover { color: var(--text); }

.modal__body { padding: 16px; }

.modal__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-soft);
}

.modal__spacer { flex: 1; }

/* 表单 */
.field { margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.field__label { display: block; margin-bottom: 5px; font-size: 12px; color: var(--muted); }

.field__input,
.field__select,
.field__textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.field__textarea { min-height: 62px; resize: vertical; }
.field__input:focus, .field__select:focus, .field__textarea:focus { outline: none; border-color: var(--accent); }
.field__tip { margin-top: 4px; font-size: 11px; color: var(--muted); }

/* 按钮 */
.btn {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  transition: all .18s ease;
}

.btn:hover { border-color: var(--accent); color: var(--accent); }

.btn--primary { color: #fff; background: var(--blue); border-color: var(--blue); }
.btn--primary:hover { color: #fff; filter: brightness(1.08); border-color: var(--blue); }

.btn--danger:hover { color: var(--red); border-color: var(--red); background: transparent; }

/* 设置行 */
.setting-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}

.setting-row:last-child { border-bottom: none; }
.setting-row__label { font-size: 13.5px; }
.setting-row__desc { font-size: 11.5px; color: var(--muted); }
.setting-row > div:first-child { flex: 1; }
.setting-row__ops { display: flex; gap: 6px; flex: none; }

.seg { display: flex; flex: none; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }

.seg__btn { padding: 5px 14px; font-size: 12.5px; color: var(--text-2); background: var(--surface-2); }
.seg__btn.is-active { color: #fff; background: var(--blue); }

/* 轻提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  z-index: 200;
  padding: 9px 18px;
  font-size: 13px;
  border-radius: 999px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.toast[hidden] { display: none; }

/* —— 页脚 —— */
.footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 18px 20px 26px;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
}

.footer__dot { margin: 0 6px; opacity: .6; }

/* ============ 7. 响应式 ============ */

/* 大屏以下：三列 → 两列 */
@media (max-width: 1180px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card--span2 { grid-column: span 2; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 平板：顶栏换行，搜索占满第二行 */
@media (max-width: 900px) {
  .topbar__inner { flex-wrap: wrap; height: auto; padding: 12px 16px; row-gap: 10px; }
  .brand { width: 100%; }
  .search { max-width: none; margin-left: 0; order: 3; flex-basis: 100%; }
  .topbar__actions { margin-left: auto; }
  .notice { padding: 6px 16px 10px; }
}

/* 手机：单列，控件加大便于点击 */
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .main { padding: 14px 12px 4px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .card--span2 { grid-column: span 1; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px; }
  .stat__value { font-size: 20px; }
  .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .quick__item { padding: 10px 4px 8px; }
  .todo-form__tag { width: 74px; }
  .search__kbd { display: none; }
  .clock { display: none; }         /* 小屏空间有限，隐藏日期 */
  .footer { padding: 14px 12px 22px; }
  .modal { padding: 12px; }
  .setting-row { flex-wrap: wrap; }
}

/* 无障碍：减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
