/* ═══════════════════════════════════════
   XuYiqi Cloud — 统一样式
   ═══════════════════════════════════════ */

/* ── 变量 ── */
:root {
  --ink: #1a1a1a;
  --paper: #faf8f5;
  --card: #fff;
  --accent: #d4483c;
  --accent-soft: #fef0ee;
  --green: #2d8a56;
  --blue: #3b82f6;
  --muted: #8c8c8c;
  --border: #e8e4df;
  --shadow: 0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.06);
}

/* ── 重置 ── */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* ── 滚动条 ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

/* ── 选中 ── */
::selection { background: rgba(212,72,60,.18); color: inherit; }
::-moz-selection { background: rgba(212,72,60,.18); color: inherit; }

/* ── 基础 ── */
html { scrollbar-gutter: stable; }
body {
  font-family: "Noto Serif SC", "PingFang SC", "Microsoft YaHei", serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
}

/* ── 顶栏 ── */
.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.masthead .wordmark {
  font-family: "DM Serif Display", "Noto Serif SC", serif;
  font-size: 2em;
  font-weight: 400;
  letter-spacing: -.3px;
}
.masthead .tagline {
  font-family: "IBM Plex Mono", monospace;
  font-size: .82em;
  color: var(--muted);
  font-weight: 400;
}
.masthead a {
  font-size: .72em;
  color: var(--muted);
  text-decoration: none;
  font-family: "IBM Plex Mono", monospace;
}
.masthead a:hover { color: var(--accent); }

/* ── 区块标题 ── */
.section-head {
  font-family: "IBM Plex Mono", monospace;
  font-size: .75em;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 28px 0 14px;
}

/* ── 网格 & 卡片 ── */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.card .label {
  font-family: "IBM Plex Mono", monospace;
  font-size: .72em;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 8px;
}
.card .title {
  font-size: 1.1em;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.4;
}
.card .sub {
  font-size: .88em;
  color: var(--muted);
  line-height: 1.5;
}
.card.disabled {
  opacity: .45;
  pointer-events: none;
  cursor: not-allowed;
  filter: grayscale(1);
}
.card.disabled:hover {
  transform: none;
  box-shadow: var(--shadow);
}

/* ── 页脚 ── */
.footer {
  padding: 16px 0 12px;
  border-top: 1px solid var(--border);
  font-family: "IBM Plex Mono", monospace;
  font-size: .7em;
  color: var(--muted);
  text-align: center;
}
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--accent); }

/* ── 横幅 ── */
.banner {
  background: var(--accent-soft);
  border: 1px solid rgba(212,72,60,.15);
  border-radius: 8px;
  padding: 12px 18px;
  margin-bottom: 28px;
  font-size: .82em;
  color: var(--accent);
  text-align: center;
  font-family: "IBM Plex Mono", monospace;
}

/* ── 页面标题 ── */
.page-title {
  text-align: left;
  margin-bottom: 36px;
}
.page-title h1 {
  font-family: "DM Serif Display", "Noto Serif SC", serif;
  font-size: 2.8em;
  font-weight: 400;
  letter-spacing: -.5px;
  margin-bottom: 6px;
}
.page-title .sub {
  font-family: "IBM Plex Mono", monospace;
  font-size: .72em;
  color: var(--muted);
}

/* ── 系统状态条 ── */
.stats-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 36px;
}
.stat-card {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  align-self: stretch;
}
.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: .72em;
  font-weight: 500;
  flex-shrink: 0;
}
.stat-icon.cpu { background: #eef5ff; color: var(--blue); }
.stat-icon.mem { background: #fef3f2; color: #ef4444; }
.stat-icon.disk { background: #f0fdf4; color: #22c55e; }
.stat-icon.net { background: #fefce8; color: #eab308; }
.net-card .net-rows { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.net-row { display: flex; align-items: center; gap: 6px; font-size: .78em; overflow: hidden; }
.net-dir { font-size: .85em; width: 16px; flex-shrink: 0; text-align: center; }
.net-val { font-family: "DM Serif Display", serif; font-size: 1.3em; font-weight: 400; }
.net-unit { font-size: .6em; color: var(--muted); margin-left: 1px; }
.stat-body { min-width: 0; flex: 1; overflow: hidden; }
.stat-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: .72em;
  font-weight: 500;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}
.stat-value {
  font-family: "DM Serif Display", serif;
  font-size: 1.4em;
  font-weight: 400;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stat-unit { font-size: .45em; color: var(--muted); margin-left: 2px; }
.stat-bar-wrap {
  height: 3px;
  background: var(--border);
  margin-top: 4px;
  border-radius: 2px;
  overflow: hidden;
}
.stat-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .6s ease;
}
.stat-bar-fill.cpu { background: var(--blue); }
.stat-bar-fill.mem { background: #ef4444; }
.stat-bar-fill.disk { background: #22c55e; }
.stat-bar-fill.net-dl { background: #3b82f6; }
.stat-bar-fill.net-ul { background: #eab308; }
.stat-bar-wrap.split { display: flex; gap: 1px; }
.stat-bar-wrap.split .stat-bar-fill { flex: 1; }

/* ── Toast ── */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 10px 24px;
  border-radius: 20px;
  font-size: .82em;
  z-index: 200;
  font-family: "IBM Plex Mono", monospace;
  animation: toastIn .3s ease;
}
.toast.info { background: #555; }
.toast.success { background: var(--green); box-shadow: 0 2px 8px rgba(45,138,86,.25); }
.toast.error { background: var(--accent); box-shadow: 0 2px 8px rgba(212,72,60,.25); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── 响应式 ── */
@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; }
}
@media (min-width: 800px) {
  .grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 700px) {
  .stats-bar { flex-wrap: wrap; align-items: stretch; }
  .stat-card { flex: 1 1 calc(50% - 5px); padding: 10px 12px; gap: 8px; min-height: 80px; }
  .stat-value { font-size: 1.15em; }
  .stat-icon { width: 32px; height: 32px; font-size: .65em; }
  .net-val { font-size: 1.05em; }
}
@media (max-width: 380px) {
  .stats-bar { flex-direction: column; }
  .stat-card { flex: 1 1 auto; padding: 12px 14px; gap: 10px; }
}
