/* ==========================================================================
   QQ 机器人栈 · 集成调试控制台 —— 深色工业风样式表
   仅使用本地资源（无 CDN / 无外部字体），移动端（≤720px）可用。
   ========================================================================== */

:root {
  --bg: #0f1115;
  --bg-2: #12151b;
  --bg-3: #0b0d11;
  --card: #171a21;
  --card-2: #1c2029;
  --card-3: #202531;
  --line: #262b36;
  --line-2: #323a4b;
  --text: #e6e9ef;
  --text-2: #c3c9d6;
  --muted: #8b93a7;
  --dim: #5f6779;
  --primary: #4f8cff;
  --primary-dim: #2b4a81;
  --primary-soft: rgba(79, 140, 255, .14);
  --ok: #2ecc71;
  --ok-soft: rgba(46, 204, 113, .14);
  --warn: #f5a623;
  --warn-soft: rgba(245, 166, 35, .14);
  --danger: #ff5c5c;
  --danger-soft: rgba(255, 92, 92, .14);
  --info: #38bdf8;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", "Cascadia Code", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 8px 28px rgba(0, 0, 0, .38);
  --header-h: 58px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(1100px 460px at 78% -180px, rgba(79, 140, 255, .10), transparent 70%),
    radial-gradient(900px 400px at 10% -200px, rgba(46, 204, 113, .05), transparent 70%),
    linear-gradient(rgba(255, 255, 255, .014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .014) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; }

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

.hidden { display: none !important; }
.mono { font-family: var(--mono); font-variant-ligatures: none; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }
.text-danger { color: var(--danger); }
.text-primary { color: var(--primary); }
.text-muted { color: var(--muted); }

/* 滚动条 */
* { scrollbar-width: thin; scrollbar-color: #333b4b transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2b3242; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #3a4357; border: 2px solid transparent; background-clip: padding-box; }

/* ---------- 启动画面 ---------- */
.boot-splash {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: var(--bg);
}
.boot-logo { opacity: .95; }
.boot-title { font-size: 15px; font-weight: 600; letter-spacing: .4px; }
.boot-bar { width: 190px; height: 3px; border-radius: 3px; background: #1d222c; overflow: hidden; }
.boot-bar > i {
  display: block; width: 40%; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), #7fb0ff);
  animation: boot-slide 1.15s ease-in-out infinite;
}
@keyframes boot-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(370%); }
}
.boot-text { color: var(--muted); font-size: 12.5px; }

/* ---------- 主外壳 ---------- */
.shell { min-height: 100%; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 16px;
  height: var(--header-h);
  padding: 0 16px;
  background: rgba(15, 17, 21, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; flex: none; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { display: flex; }
.brand-text { display: flex; flex-direction: column; line-height: 1.18; }
.brand-text b { font-size: 14.5px; letter-spacing: .3px; }
.brand-text small { color: var(--muted); font-size: 11px; letter-spacing: .3px; }

.nav {
  display: flex; align-items: center; gap: 2px;
  flex: 1 1 auto; min-width: 0;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
  padding: 3px 0;
}
.nav::-webkit-scrollbar { display: none; }
.nav-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 10px; border-radius: 8px;
  color: var(--muted); font-size: 12.5px; font-weight: 500;
  white-space: nowrap; cursor: pointer; border: 1px solid transparent;
  transition: background .14s, color .14s, border-color .14s;
}
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, .045); text-decoration: none; }
.nav-item.active {
  color: #dbe7ff; background: var(--primary-soft);
  border-color: rgba(79, 140, 255, .32);
}
.nav-item svg { flex: none; opacity: .9; }

.topbar-right { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
.target-box {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 4px 4px 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 9px;
  max-width: 330px;
}
.target-picker {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); min-width: 0;
}
.target-picker svg { flex: none; }
.target-picker select {
  appearance: none; -webkit-appearance: none;
  background: transparent; border: 0; outline: none;
  color: var(--text); font-size: 12.5px; font-weight: 500;
  max-width: 168px; padding: 3px 20px 3px 2px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 8l3-3.5' fill='none' stroke='%238b93a7' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 4px center;
  text-overflow: ellipsis;
}
.target-picker select option { background: #1a1e27; color: var(--text); }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.status-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.status-pill.online { color: var(--ok); background: var(--ok-soft); border-color: rgba(46, 204, 113, .3); }
.status-pill.offline { color: var(--danger); background: var(--danger-soft); border-color: rgba(255, 92, 92, .32); }
.status-pill.unknown { color: var(--warn); background: var(--warn-soft); border-color: rgba(245, 166, 35, .3); }
.status-pill.online i { animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.view {
  flex: 1 0 auto;
  width: 100%; max-width: 1320px;
  margin: 0 auto;
  padding: 20px 22px 34px;
}

.statusbar {
  flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 20px;
  border-top: 1px solid var(--line);
  background: rgba(11, 13, 17, .72);
  color: var(--dim); font-size: 11.5px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 0 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--card-2);
  color: var(--text-2);
  font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: background .14s, border-color .14s, color .14s, opacity .14s;
  user-select: none;
}
.btn:hover { background: var(--card-3); border-color: #3b4557; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn svg { flex: none; }
.btn-primary { background: #2f6ae0; border-color: #3d7bf2; color: #fff; }
.btn-primary:hover { background: #3b78ee; border-color: #5b8ff5; color: #fff; }
.btn-danger { background: rgba(255, 92, 92, .13); border-color: rgba(255, 92, 92, .42); color: #ff8a8a; }
.btn-danger:hover { background: rgba(255, 92, 92, .22); border-color: rgba(255, 92, 92, .62); color: #ffb3b3; }
.btn-ok { background: rgba(46, 204, 113, .12); border-color: rgba(46, 204, 113, .4); color: #6ee7a5; }
.btn-ok:hover { background: rgba(46, 204, 113, .2); border-color: rgba(46, 204, 113, .6); color: #9df0c3; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(255, 255, 255, .06); border-color: transparent; color: var(--text); }
.btn-sm { min-height: 28px; padding: 0 9px; font-size: 12px; border-radius: 6px; gap: 4px; }
.btn-icon { width: 32px; min-height: 32px; padding: 0; border-radius: 8px; }
.btn-lg { min-height: 42px; padding: 0 20px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn-busy::after {
  content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 徽章 / 标签 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 7px; border-radius: 20px;
  font-size: 11px; font-weight: 600; line-height: 18px;
  border: 1px solid transparent; white-space: nowrap;
}
.badge-ok { color: #71e6a8; background: var(--ok-soft); border-color: rgba(46, 204, 113, .3); }
.badge-warn { color: #ffc866; background: var(--warn-soft); border-color: rgba(245, 166, 35, .32); }
.badge-danger { color: #ff9a9a; background: var(--danger-soft); border-color: rgba(255, 92, 92, .34); }
.badge-primary { color: #a7c6ff; background: var(--primary-soft); border-color: rgba(79, 140, 255, .32); }
.badge-muted { color: var(--muted); background: rgba(139, 147, 167, .0); border-color: var(--line-2); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(46, 204, 113, .12); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(245, 166, 35, .12); }
.dot.danger { background: var(--danger); box-shadow: 0 0 0 3px rgba(255, 92, 92, .12); }
.dot.unknown { background: var(--dim); }

/* ---------- 页面头 ---------- */
.page { animation: page-in .16s ease-out; }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 16px;
}
.page-title { font-size: 20px; letter-spacing: .3px; display: flex; align-items: center; gap: 9px; }
.page-title .badge { transform: translateY(1px); }
.page-sub { margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- 卡片 ---------- */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .014), transparent 40%), var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .02) inset;
  padding: 14px 16px;
  min-width: 0;
}
.card.tight { padding: 12px 14px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 10px;
}
.card-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; letter-spacing: .8px;
  color: var(--muted); text-transform: uppercase;
}
.card-title svg { opacity: .85; }
.card-actions { display: flex; align-items: center; gap: 6px; }
.card-body { min-width: 0; }

.grid { display: grid; gap: 14px; min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.col-span-full { grid-column: 1 / -1; }

/* ---------- 统计 ---------- */
.stat { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.stat-value { font-size: 26px; font-weight: 650; letter-spacing: -.4px; font-family: var(--mono); line-height: 1.15; }
.stat-unit { font-size: 12px; color: var(--muted); }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-hint { font-size: 11.5px; color: var(--dim); margin-top: 2px; }

.spark { display: block; width: 100%; height: 38px; margin-top: 6px; }

/* ---------- 进度条 ---------- */
.bar { height: 6px; border-radius: 6px; background: #232936; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: var(--primary); transition: width .4s ease; }
.bar-fill.ok { background: linear-gradient(90deg, #23a75a, var(--ok)); }
.bar-fill.warn { background: linear-gradient(90deg, #d98a12, var(--warn)); }
.bar-fill.danger { background: linear-gradient(90deg, #d64040, var(--danger)); }
.bar-row { margin-top: 9px; }
.bar-row:first-child { margin-top: 0; }
.bar-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; font-size: 12px; }
.bar-head b { font-weight: 500; color: var(--text-2); }
.bar-value { color: var(--muted); font-family: var(--mono); font-size: 11.5px; }

/* ---------- 键值 ---------- */
.kv { display: flex; flex-direction: column; gap: 7px; }
.kv-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12.5px; }
.kv-k { color: var(--muted); flex: none; }
.kv-v { color: var(--text-2); text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  text-align: left; font-weight: 600; color: var(--muted);
  font-size: 11px; letter-spacing: .6px; text-transform: uppercase;
  padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 9px 10px; border-bottom: 1px solid rgba(38, 43, 54, .65); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(255, 255, 255, .022); }
.table .cell-name { font-weight: 550; color: var(--text); }
.table .cell-mono { font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.table .cell-actions { text-align: right; white-space: nowrap; }
.table .cell-actions .btn + .btn { margin-left: 6px; }
.table-scroll { overflow-x: auto; }

/* ---------- 空状态 / 加载 ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 34px 16px; text-align: center; color: var(--muted);
}
.empty-icon { color: var(--dim); margin-bottom: 2px; }
.empty-title { font-size: 13.5px; color: var(--text-2); font-weight: 550; }
.empty-sub { font-size: 12px; color: var(--dim); max-width: 460px; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(139, 147, 167, .25); border-top-color: var(--primary);
  animation: spin .75s linear infinite; display: inline-block;
}
.loading { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12.5px; padding: 18px 0; }
.skeleton {
  background: linear-gradient(90deg, #1b2029 25%, #222834 50%, #1b2029 75%);
  background-size: 200% 100%;
  animation: sk 1.3s ease-in-out infinite;
  border-radius: 6px;
}
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- 提示条 ---------- */
.banner {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--card-2);
  font-size: 12.5px; color: var(--text-2);
}
.banner svg { flex: none; margin-top: 2px; }
.banner-title { font-weight: 600; color: var(--text); margin-bottom: 1px; }
.banner-info { border-color: rgba(56, 189, 248, .32); background: rgba(56, 189, 248, .08); }
.banner-warn { border-color: rgba(245, 166, 35, .36); background: rgba(245, 166, 35, .08); }
.banner-danger { border-color: rgba(255, 92, 92, .4); background: rgba(255, 92, 92, .09); }
.banner-danger .banner-title { color: #ffb0b0; }
.banner-actions { margin-left: auto; display: flex; gap: 6px; flex: none; }

/* ---------- 快捷入口 ---------- */
.entry-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.entry-card {
  background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 13px; display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
.entry-head { display: flex; align-items: center; gap: 8px; }
.entry-name { font-weight: 600; font-size: 13.5px; }
.entry-desc { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.entry-url {
  font-family: var(--mono); font-size: 11.5px; color: #a8c6ff;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 6px;
  padding: 5px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.entry-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ---------- 日志页 ---------- */
.log-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  background: var(--card-2);
}
.log-toolbar .grow { flex: 1 1 auto; }
.log-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); padding: 6px 12px; border-bottom: 1px solid var(--line); background: rgba(11, 13, 17, .45); }
.log-status .sep { color: var(--dim); }
.log-body {
  height: calc(100vh - 292px); min-height: 260px;
  overflow: auto; padding: 8px 0;
  background: var(--bg-3);
  font-family: var(--mono); font-size: 12px; line-height: 1.55;
}
.log-line {
  padding: 0 12px; white-space: pre-wrap; word-break: break-word;
  color: #b9c2d4; border-left: 2px solid transparent;
}
.log-line:hover { background: rgba(255, 255, 255, .03); }
.log-line.err { color: #ff9d9d; border-left-color: var(--danger); background: rgba(255, 92, 92, .045); }
.log-line.warn { color: #ffd18a; border-left-color: var(--warn); background: rgba(245, 166, 35, .04); }
.log-line.info { color: #9fd0ff; }
.log-line mark { background: #6a4d00; color: #ffe3a3; border-radius: 2px; padding: 0 1px; }
.log-empty { padding: 28px 16px; text-align: center; color: var(--dim); font-family: var(--sans); font-size: 12.5px; }
.log-tabs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.log-tab {
  padding: 5px 11px; border-radius: 7px; font-size: 12px; font-weight: 500;
  color: var(--muted); background: transparent; border: 1px solid transparent; cursor: pointer;
}
.log-tab:hover { color: var(--text); background: rgba(255, 255, 255, .045); }
.log-tab.active { color: #cfe0ff; background: var(--primary-soft); border-color: rgba(79, 140, 255, .32); }
.log-tab:disabled { opacity: .4; cursor: not-allowed; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; white-space: nowrap; }
.check input { accent-color: var(--primary); width: 14px; height: 14px; }

/* ---------- 终端页 ---------- */
.term-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-3); overflow: hidden;
  height: calc(100vh - 226px); min-height: 340px;
}
.term-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--card-2);
}
.term-host { flex: 1 1 auto; min-height: 0; overflow: hidden; padding: 8px 6px 6px 10px; }
.term-host .xterm { height: 100%; }
.term-host .xterm-viewport { background: transparent !important; }
.term-hint { padding: 6px 10px; border-top: 1px solid var(--line); background: var(--card-2); font-size: 11.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .field-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.field-hint { font-size: 11.5px; color: var(--dim); }
.input, .select, .textarea,
input[type="text"], input[type="password"], input[type="number"], input[type="search"],
input[type="email"], input[type="url"], input[type="tel"], select, textarea {
  background: #11141a; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  color: var(--text); padding: 8px 10px; min-height: 34px; width: 100%;
  outline: none; transition: border-color .14s, box-shadow .14s;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(79, 140, 255, .75);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, .16);
}
input::placeholder, textarea::placeholder { color: #4e5666; }
select { cursor: pointer; }
select option { background: #1a1e27; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.form-row .field { flex: 1 1 160px; }
.input-sm { min-height: 28px; padding: 4px 8px; font-size: 12px; }

/* ---------- 设置页 ---------- */
.settings-section { margin-bottom: 16px; }
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 11px 0; border-bottom: 1px solid rgba(38, 43, 54, .7); flex-wrap: wrap;
}
.setting-row:last-child { border-bottom: 0; }
.setting-label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.setting-desc { font-size: 11.5px; color: var(--dim); margin-top: 2px; max-width: 560px; }
.setting-value { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); }

/* ---------- 认证 ---------- */
.auth-root {
  position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(760px 420px at 50% -60px, rgba(79, 140, 255, .16), transparent 70%),
    radial-gradient(560px 360px at 88% 110%, rgba(46, 204, 113, .07), transparent 70%),
    linear-gradient(rgba(255, 255, 255, .016) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .016) 1px, transparent 1px),
    var(--bg);
  background-size: auto, auto, 44px 44px, 44px 44px, auto;
  overflow: auto;
}
.auth-card {
  width: 100%; max-width: 396px;
  background: linear-gradient(180deg, #1a1e26, #14171d);
  border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 26px 26px 22px;
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.auth-brand .brand-mark { display: flex; }
.auth-brand b { font-size: 14px; letter-spacing: .3px; }
.auth-brand small { display: block; color: var(--muted); font-size: 11px; }
.auth-title { font-size: 19px; letter-spacing: .3px; margin-bottom: 4px; }
.auth-sub { color: var(--muted); font-size: 12.5px; margin-bottom: 18px; line-height: 1.5; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-input-wrap { position: relative; }
.auth-input-wrap input { padding-right: 40px; min-height: 40px; }
.auth-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: 0; color: var(--muted); cursor: pointer; border-radius: 6px;
}
.auth-eye:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.auth-error {
  display: none; align-items: flex-start; gap: 7px;
  font-size: 12.5px; color: #ffb3b3;
  background: rgba(255, 92, 92, .1); border: 1px solid rgba(255, 92, 92, .35);
  padding: 8px 10px; border-radius: 7px;
}
.auth-error.show { display: flex; }
.auth-hint { margin-top: 14px; color: var(--dim); font-size: 11.5px; text-align: center; line-height: 1.6; }
.auth-foot {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  color: var(--dim); font-size: 11px; gap: 8px; flex-wrap: wrap;
}

/* ---------- Toast ---------- */
.toast-root {
  position: fixed; right: 16px; bottom: 18px; z-index: 400;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  pointer-events: none; max-width: min(420px, calc(100vw - 32px));
}
.toast {
  pointer-events: auto;
  display: flex; align-items: flex-start; gap: 9px;
  min-width: 220px; max-width: 100%;
  padding: 10px 12px; border-radius: 9px;
  background: #1d222c; border: 1px solid var(--line-2);
  border-left: 3px solid var(--primary);
  box-shadow: var(--shadow);
  font-size: 12.5px; color: var(--text-2);
  animation: toast-in .18s ease-out;
}
.toast.leaving { animation: toast-out .18s ease-in forwards; }
.toast svg { flex: none; margin-top: 1px; }
.toast-success { border-left-color: var(--ok); }
.toast-warn { border-left-color: var(--warn); }
.toast-danger { border-left-color: var(--danger); }
.toast-msg { min-width: 0; word-break: break-word; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ---------- Modal ---------- */
.modal-root { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 18px; }
.modal-overlay { position: absolute; inset: 0; background: rgba(5, 7, 10, .68); backdrop-filter: blur(3px); animation: fade-in .16s ease-out; }
.modal-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 460px; max-height: min(82vh, 760px);
  display: flex; flex-direction: column;
  background: #1a1e26; border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: var(--shadow); animation: modal-in .18s cubic-bezier(.2, .8, .3, 1);
}
.modal-card.modal-wide { max-width: 720px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 15px 16px 0; }
.modal-title { font-size: 15px; font-weight: 600; }
.modal-close { background: transparent; border: 0; color: var(--muted); cursor: pointer; width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex: none; }
.modal-close:hover { background: rgba(255, 255, 255, .07); color: var(--text); }
.modal-body { padding: 10px 16px 4px; overflow: auto; color: var(--text-2); font-size: 13px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 16px 15px; flex-wrap: wrap; }
.modal-pre {
  margin: 0; padding: 10px 12px; border-radius: 8px;
  background: var(--bg-3); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 11.5px; line-height: 1.55;
  max-height: 42vh; overflow: auto; white-space: pre-wrap; word-break: break-word;
  color: #b9c2d4;
}

/* ---------- 占位页 ---------- */
.placeholder { padding: 30px 18px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.placeholder-icon {
  width: 54px; height: 54px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); border: 1px solid rgba(79, 140, 255, .3); color: #7ea9ff;
}
.placeholder-title { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.placeholder-sub { color: var(--muted); font-size: 12.5px; max-width: 560px; line-height: 1.6; }
.feature-list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px; width: 100%; max-width: 760px; margin-top: 12px; text-align: left;
}
.feature-item {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 11px; font-size: 12px; color: var(--text-2);
}
.feature-item .dot { margin-top: 6px; }
.feature-item code { font-family: var(--mono); font-size: 11px; color: #a8c6ff; }
.placeholder-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

/* ---------- 杂项 ---------- */
.sep { color: var(--line-2); }
.grow { flex: 1 1 auto; min-width: 0; }
.toast-ico { display: flex; color: var(--primary); }
.toast-success .toast-ico { color: var(--ok); }
.toast-warn .toast-ico { color: var(--warn); }
.toast-danger .toast-ico { color: var(--danger); }
.auth-error-text { min-width: 0; }

/* 总览：探针 / 服务行 / 诊断 */
.probe-row { display: flex; flex-wrap: wrap; gap: 5px; }
.probe {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 7px; border-radius: 5px;
  font-size: 10.5px; color: var(--muted);
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, .02);
}
.probe i { width: 5px; height: 5px; border-radius: 50%; background: var(--dim); }
.probe.on { color: #9fe7bd; border-color: rgba(46, 204, 113, .3); }
.probe.on i { background: var(--ok); }
.probe.off { color: #ffb0b0; border-color: rgba(255, 92, 92, .28); }
.probe.off i { background: var(--danger); }

.svc-list { display: flex; flex-direction: column; }
.svc-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid rgba(38, 43, 54, .7);
}
.svc-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.svc-main { flex: 1 1 auto; min-width: 0; }
.svc-name { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 550; flex-wrap: wrap; }
.svc-detail { font-size: 11.5px; color: var(--dim); margin-top: 1px; }
.svc-actions { display: flex; align-items: center; gap: 5px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.svc-row > .dot { flex: none; }

.diag-list { display: flex; flex-direction: column; }
.diag-row {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 9px 2px; border-bottom: 1px solid rgba(38, 43, 54, .7);
}
.diag-row:last-child { border-bottom: 0; }
.diag-row > .dot { margin-top: 6px; }
.diag-main { flex: 1 1 auto; min-width: 0; }
.diag-name { font-size: 13px; color: var(--text); }
.diag-detail { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* 入口页 */
.entry-ico {
  width: 28px; height: 28px; border-radius: 7px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: #8fb5ff; border: 1px solid rgba(79, 140, 255, .28);
}
.entry-head .badge { margin-left: auto; }
.entry-head .entry-name { flex: none; }
.entry-card .entry-url { width: 100%; }
.entry-card .entry-actions { width: 100%; }
.entry-card .entry-actions .btn { flex: 1 1 auto; }
.entry-card .entry-actions select { flex: 1 1 auto; }
.entry-card .btn-primary { color: #fff; }

/* 设置页 */
.settings-body .card { min-width: 0; }
.settings-body .kv-row { align-items: flex-start; }
.settings-body .kv-v { white-space: normal; text-align: right; max-width: 62%; }
.sec-list { display: flex; flex-direction: column; }
.sec-item { padding: 9px 0; border-bottom: 1px solid rgba(38, 43, 54, .7); }
.sec-item:last-child { border-bottom: 0; padding-bottom: 0; }
.sec-label { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.sec-value { font-size: 12.5px; color: var(--text-2); line-height: 1.55; }
.sec-value code { font-family: var(--mono); font-size: 11.5px; color: #a8c6ff; }
.log-toolbar input[type="search"] { flex: 0 1 340px; }

/* 登录页 */
.auth-error.show { display: flex; }

.kbd {
  display: inline-block; padding: 1px 5px; border-radius: 4px;
  border: 1px solid var(--line-2); border-bottom-width: 2px;
  background: var(--card-2); color: var(--text-2); font-family: var(--mono); font-size: 11px;
}
.noscript { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--bg); color: var(--text); z-index: 999; }
.copyable { cursor: pointer; }
.copyable:hover { color: var(--primary); }
.text-tiny { font-size: 11px; }

/* 顶部导航在 1440 等常见宽度下压缩到一行放下全部 12 个页面 */
@media (max-width: 1560px) {
  .topbar { gap: 12px; padding: 0 14px; }
  .nav { gap: 1px; }
  .nav-item { padding: 7px 8px; font-size: 12px; }
  .nav-item svg { width: 14px; height: 14px; }
  .brand-text b { font-size: 14px; }
  .target-box { max-width: 300px; }
  .target-picker select { max-width: 150px; }
}

/* ==========================================================================
   响应式：≤720px 手机
   ========================================================================== */
@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .col-span-3 { grid-column: span 2; }
  .brand-text small { display: none; }
  .target-picker select { max-width: 132px; }
}

@media (max-width: 720px) {
  :root { --header-h: auto; }
  .topbar {
    flex-wrap: wrap; height: auto; gap: 8px;
    padding: 8px 12px 6px;
  }
  .brand { flex: 1 1 auto; }
  .brand-text b { font-size: 13.5px; }
  .brand-text small { display: none; }
  .nav { order: 3; flex: 1 1 100%; gap: 2px; padding: 2px 0 3px; }
  .nav-item { padding: 7px 9px; font-size: 12px; }
  .topbar-right { order: 2; gap: 6px; }
  .target-box { max-width: 100%; padding: 2px 2px 2px 8px; }
  .target-picker select { max-width: 118px; font-size: 12px; }
  .status-pill { padding: 2px 7px; font-size: 11px; }
  .target-box .status-pill {
    display: inline-flex; padding: 0; width: 16px; height: 16px;
    justify-content: center; background: transparent; border-color: transparent;
  }
  .target-box .status-pill span { display: none; }
  .target-box .status-pill i { width: 7px; height: 7px; }
  #mock-badge { display: none; }
  .btn-icon { width: 34px; min-height: 34px; }

  .view { padding: 14px 12px 26px; }
  .page-head { align-items: flex-start; margin-bottom: 12px; }
  .page-title { font-size: 17px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
  .grid { gap: 10px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .col-span-2, .col-span-3 { grid-column: auto; }
  .card { padding: 12px 13px; border-radius: 9px; }
  .stat-value { font-size: 22px; }
  .statusbar { padding: 6px 12px; font-size: 10.5px; gap: 8px; }
  #footer-right { display: none; }

  .log-body { height: calc(100vh - 330px); font-size: 11px; }
  .log-toolbar { padding: 8px 9px; }
  .log-toolbar .grow { flex-basis: 100%; }
  .log-tab { padding: 5px 9px; }
  .term-card { height: calc(100vh - 268px); min-height: 280px; }
  .term-host { padding: 6px 2px 2px 6px; }

  .toast-root { left: 12px; right: 12px; bottom: 12px; align-items: stretch; max-width: none; }
  .toast { min-width: 0; }
  .modal-root { padding: 10px; align-items: flex-end; }
  .modal-card { max-height: 86vh; }
  .modal-card.modal-wide { max-width: 100%; }
  .modal-foot .btn { flex: 1 1 auto; }
  .auth-root { align-items: flex-start; padding: 34px 14px; }
  .auth-card { padding: 22px 18px 18px; }
  .table { font-size: 12px; }
  .table th, .table td { padding: 8px; }
  .entry-grid { grid-template-columns: 1fr; }
  .form-row .field { flex-basis: 100%; }
  .setting-row { align-items: flex-start; flex-direction: column; gap: 6px; }
}

@media (max-width: 380px) {
  .brand-text b { font-size: 12.5px; }
  .nav-item { padding: 6px 7px; font-size: 11.5px; }
  .nav-item svg { display: none; }
  .target-picker select { max-width: 96px; }
}

@media (hover: none) {
  .btn:hover { background: var(--card-2); border-color: var(--line-2); color: var(--text-2); }
  .btn-primary:hover { background: #2f6ae0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ==========================================================================
   统一站点 · 左侧导航布局（v2，覆盖上方旧 topbar 布局）
   ========================================================================== */
.shell { flex-direction: row; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 80;
  width: 238px; display: flex; flex-direction: column;
  padding: 12px 10px 10px;
  background:
    radial-gradient(520px 220px at 0% 0%, rgba(79, 140, 255, .08), transparent 70%),
    linear-gradient(180deg, #12151c 0%, #0e1116 100%);
  border-right: 1px solid var(--line);
}
.sidebar .brand { padding: 6px 8px 14px; border-radius: 9px; }
.sidebar .brand:hover { background: rgba(255, 255, 255, .03); }
.sidebar-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 2px 0 10px; }

.nav { flex-direction: column; align-items: stretch; gap: 2px; overflow: visible; padding: 0; }
.nav-group-label {
  padding: 14px 11px 5px;
  font-size: 10.5px; letter-spacing: .14em; color: var(--dim);
  font-weight: 600;
}
.nav-group-label:first-child { padding-top: 2px; }
.nav-item {
  padding: 8px 11px; border-radius: 8px; gap: 9px;
  font-size: 13px; color: var(--text-2); border-color: transparent;
}
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.nav-item.active {
  color: #dbe7ff; background: linear-gradient(90deg, rgba(79, 140, 255, .20), rgba(79, 140, 255, .06));
  border-color: rgba(79, 140, 255, .28);
  box-shadow: inset 2px 0 0 var(--primary);
}
.nav-item svg { opacity: .85; }

.sidebar-foot { flex: none; border-top: 1px solid var(--line); padding: 10px 4px 0; display: flex; flex-direction: column; gap: 8px; }
.sidebar-foot .target-box { max-width: none; width: 100%; justify-content: space-between; }
.sidebar-foot .target-picker { flex: 1 1 auto; min-width: 0; }
.sidebar-foot .target-picker select { max-width: 100%; width: 100%; }
.sidebar-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 7px; font-size: 11px; color: var(--dim); }
.sidebar-meta > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1 1 auto; min-width: 0; margin-left: 238px; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 60;
  height: 54px; padding: 0 20px; gap: 12px;
}
.menu-btn { display: none; }
.topbar-title { display: flex; flex-direction: column; justify-content: center; min-width: 0; line-height: 1.2; }
.crumb { font-size: 14.5px; font-weight: 650; letter-spacing: .2px; }
.crumb-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.topbar-right { margin-left: auto; }
.view { max-width: 1480px; }
.sidebar-mask { display: none; }

/* ---------- 统一状态卡（概览 / 各服务页） ---------- */
.uni-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.uni-grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.uni-card {
  position: relative; display: flex; flex-direction: column; gap: 7px;
  min-width: 0; padding: 12px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .15s;
}
.uni-card:hover { border-color: var(--line-2); }
.uni-card.wide { grid-column: span 2; }
.uni-card-head { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 500; }
.uni-card-head svg { opacity: .85; flex: none; }
.uni-card-head .uni-link { margin-left: auto; font-size: 11.5px; color: var(--primary); white-space: nowrap; }
.uni-card-head .uni-link:hover { text-decoration: underline; }
.uni-state { display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 650; letter-spacing: -.2px; line-height: 1.25; }
.uni-state.lg { font-size: 23px; }
.uni-state .dot { width: 8px; height: 8px; }
.uni-state .unit { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.uni-sub { display: flex; flex-wrap: wrap; gap: 3px 10px; font-size: 11.5px; color: var(--muted); min-width: 0; }
.uni-sub > span, .uni-sub > b { min-width: 0; max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
.uni-sub b { color: var(--text-2); font-weight: 600; font-family: var(--mono); }
.uni-sub .sep { color: var(--line-2); }
.uni-meters { display: flex; flex-direction: column; gap: 5px; margin-top: 1px; }
.uni-meter { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); }
.uni-meter > span:first-child { width: 30px; flex: none; font-family: var(--mono); }
.uni-meter .bar { flex: 1 1 auto; height: 5px; }
.uni-meter > b { width: 40px; text-align: right; font-weight: 600; color: var(--text-2); font-family: var(--mono); flex: none; }
.uni-empty { font-size: 11.5px; color: var(--dim); }

/* ---------- 通用页面小节 ---------- */
.sec-head { display: flex; align-items: center; gap: 8px; margin: 20px 0 10px; min-width: 0; flex-wrap: wrap; }
.sec-head:first-child { margin-top: 0; }
.sec-title { font-size: 13.5px; font-weight: 650; color: var(--text); display: flex; align-items: center; gap: 7px; }
.sec-title svg { opacity: .8; }
.sec-sub { font-size: 11.5px; color: var(--dim); }
.sec-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ---------- 她的日记 ---------- */
.diary-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.diary-toolbar .search-box { position: relative; flex: 1 1 220px; min-width: 160px; }
.diary-toolbar .search-box input { width: 100%; padding-left: 32px; min-height: 36px; }
.diary-toolbar .search-box svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.diary-toolbar input[type="date"] { min-height: 36px; }
.diary-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 14px; align-items: start; }
.diary-list { display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 260px); overflow-y: auto; padding-right: 2px; }
.diary-day { padding: 12px 10px 4px; font-size: 11px; color: var(--dim); font-family: var(--mono); }
.diary-item {
  display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; border-radius: 8px;
  border: 1px solid transparent; cursor: pointer; text-align: left;
  background: transparent; color: inherit; width: 100%;
}
.diary-item:hover { background: rgba(255, 255, 255, .04); }
.diary-item.active { background: var(--primary-soft); border-color: rgba(79, 140, 255, .3); }
.diary-item-title { font-size: 12.5px; font-weight: 550; color: var(--text); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.diary-item-excerpt { font-size: 11.5px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.diary-item-meta { font-size: 10.5px; color: var(--dim); display: flex; gap: 8px; flex-wrap: wrap; }
.diary-reader { min-width: 0; }
.diary-reader-head { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.diary-reader-title { font-size: 18px; font-weight: 650; letter-spacing: -.2px; line-height: 1.35; }
.diary-reader-meta { font-size: 11.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; }
.diary-content { font-size: 14px; line-height: 1.85; color: var(--text-2); word-break: break-word; }
.diary-content .md-p { margin: 0 0 12px; }
.diary-content h2, .diary-content h3, .diary-content h4 { margin: 20px 0 8px; color: var(--text); }
.diary-content h2 { font-size: 17px; } .diary-content h3 { font-size: 15px; } .diary-content h4 { font-size: 13.5px; }
.diary-content ul, .diary-content ol { margin: 0 0 12px; padding-left: 22px; }
.diary-content li { margin: 3px 0; }
.diary-content blockquote { margin: 0 0 12px; padding: 8px 12px; border-left: 3px solid var(--primary-dim); background: rgba(79, 140, 255, .06); border-radius: 0 8px 8px 0; color: var(--muted); }
.diary-content code { font-family: var(--mono); font-size: 12.5px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.diary-content pre { margin: 0 0 12px; padding: 10px 12px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
.diary-content pre code { border: 0; padding: 0; background: transparent; }
.diary-content a { color: var(--primary); }
.diary-content hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.diary-empty { padding: 34px 16px; text-align: center; color: var(--dim); font-size: 12.5px; }
.diary-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }

/* ---------- 最近消息 / 动态列表 ---------- */
.feed { display: flex; flex-direction: column; }
.feed-row { display: flex; gap: 9px; padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.feed-row:last-child { border-bottom: 0; }
.feed-ico { flex: none; width: 24px; height: 24px; border-radius: 7px; display: flex; align-items: center; justify-content: center; background: var(--card-2); color: var(--muted); }
.feed-main { flex: 1 1 auto; min-width: 0; }
.feed-top { display: flex; gap: 8px; align-items: baseline; }
.feed-who { font-weight: 600; color: var(--text-2); font-size: 12px; }
.feed-time { margin-left: auto; font-size: 10.5px; color: var(--dim); font-family: var(--mono); flex: none; }
.feed-text { color: var(--muted); font-size: 12px; line-height: 1.55; word-break: break-word; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }

/* ---------- 状态大卡 ---------- */
.status-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.status-hero .uni-state { font-size: 24px; }
.status-hero .hero-sub { font-size: 12px; color: var(--muted); }

/* ---------- 手机端 ---------- */
@media (max-width: 980px) {
  .sidebar {
    width: min(84vw, 300px);
    transform: translateX(-102%);
    transition: transform .22s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, .55);
  }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .sidebar-mask { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .52); }
  body.nav-open { overflow: hidden; }
  .topbar { padding: 0 14px; height: 52px; }
  .view { padding: 16px 14px 32px; }
  .diary-layout { grid-template-columns: minmax(0, 1fr); }
  .diary-list { max-height: none; }
}

@media (max-width: 720px) {
  .topbar { flex-wrap: nowrap; height: 52px; gap: 8px; padding: 0 12px; }
  .topbar-title { flex: 1 1 auto; min-width: 0; }
  .crumb { font-size: 14px; }
  .crumb-sub { display: none; }
  .view { padding: 14px 12px 30px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .page-actions { width: 100%; flex-wrap: wrap; }
  .page-actions .btn { flex: 1 1 auto; min-width: 0; }
  .uni-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .uni-grid.cols-2 { grid-template-columns: minmax(0, 1fr); }
  .uni-card { padding: 11px 12px; border-radius: 9px; }
  .uni-card.wide { grid-column: span 2; }
  .uni-state { font-size: 16px; }
  .uni-state.lg { font-size: 18px; }
  .uni-card-head { font-size: 11.5px; }
  .uni-sub { font-size: 11px; }
  .diary-toolbar .search-box { flex-basis: 100%; }
  .diary-toolbar input[type="date"] { flex: 1 1 45%; }
  .diary-reader-title { font-size: 16px; }
  .diary-content { font-size: 13.5px; line-height: 1.8; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .statusbar { padding: 6px 12px; }
  .sec-head { margin-top: 16px; }
}

@media (max-width: 380px) {
  .uni-grid { grid-template-columns: minmax(0, 1fr); }
  .uni-card.wide { grid-column: auto; }
}

