/* ============================================================
   迹 · 服务器资产 — 与 a.dcy.me / chat.dcy.me 同一设计语言
   亮色 = 暖纸白 / 墨色；暗色 = 玄黑 / 宣纸白；强调色 = 朱砂
   ============================================================ */

:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --fg: #211d18;
  --muted: #837b70;
  --line: #e8e2d8;
  --line-2: #d8d0c2;
  --accent: #b0524a;
  --accent-soft: rgba(176, 82, 74, .12);
  --ok: #2f9e63;
  --warn: #b07d2b;
  --danger: #c04a44;
  --shadow: 0 10px 30px rgba(33, 29, 24, .10);
  --shadow-lift: 0 18px 44px rgba(33, 29, 24, .16);
  --radius: 14px;
  --radius-s: 9px;
  --serif: "ZCOOL XiaoWei", "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --maxw: 900px;
}

[data-theme="dark"] {
  --bg: #111013;
  --surface: #1a191d;
  --fg: #eae5dc;
  --muted: #97918a;
  --line: #2a2823;
  --line-2: #3a362f;
  --accent: #cf7f6f;
  --accent-soft: rgba(207, 127, 111, .14);
  --ok: #58b98a;
  --warn: #d4a24e;
  --danger: #d4685f;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --shadow-lift: 0 18px 44px rgba(0, 0, 0, .55);
}

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

[hidden] { display: none !important; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--fg);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background .35s ease, color .35s ease;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: #fff; }

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px clamp(18px, 5vw, 48px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--serif);
  font-size: 30px; font-weight: 700; line-height: 1;
  letter-spacing: .05em;
}
.brand-dot {
  display: inline-block; width: 7px; height: 7px; margin-left: 3px;
  background: var(--accent); border-radius: 50%;
}

.topnav { display: flex; align-items: center; gap: 14px; }

.lang-switch {
  cursor: pointer; padding: 7px 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; font-size: 12.5px; color: var(--muted);
  transition: border-color .2s, color .2s;
  user-select: none;
}
.lang-switch:hover { border-color: var(--accent); color: var(--accent); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 1px solid var(--line);
  border-radius: 50%; background: var(--surface); color: var(--fg);
  transition: transform .2s, border-color .2s;
}
.icon-btn:hover { transform: scale(1.08); border-color: var(--accent); }
.icon-btn svg { width: 17px; height: 17px; margin: auto; }

[data-theme="light"] .i-sun { display: none; }
[data-theme="dark"] .i-moon { display: none; }

/* ---------- 主体 ---------- */

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(28px, 5vh, 52px) clamp(18px, 4vw, 40px) 60px;
}

.page-head { text-align: center; margin-bottom: 34px; }
.page-title {
  font-family: var(--serif);
  font-size: clamp(34px, 6vw, 52px);
  font-weight: 700; letter-spacing: .1em; line-height: 1.2;
}

/* ---------- 统计条 ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex; flex-direction: column; gap: 2px;
  transition: border-color .2s, box-shadow .3s;
}
.stat:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.stat b { font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.stat b.stat-warn { color: var(--warn); }
.stat span { font-size: 11.5px; color: var(--muted); letter-spacing: .06em; }

/* ---------- 服务器卡片 ---------- */

.grid {
  display: grid; gap: 20px;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  height: 100%;
  transition: transform .3s cubic-bezier(.2, .7, .3, 1), box-shadow .3s, border-color .3s;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lift);
  border-color: var(--line-2);
}

.watermark {
  position: absolute; bottom: -25px; right: -25px;
  width: 180px; height: 180px;
  opacity: .04; pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='0.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='16' height='16' rx='2' ry='2'%3E%3C/rect%3E%3Crect x='9' y='9' width='6' height='6'%3E%3C/rect%3E%3Cpath d='M9 1v3'%3E%3C/path%3E%3Cpath d='M15 1v3'%3E%3C/path%3E%3Cpath d='M9 20v3'%3E%3C/path%3E%3Cpath d='M15 20v3'%3E%3C/path%3E%3Cpath d='M20 9h3'%3E%3C/path%3E%3Cpath d='M20 14h3'%3E%3C/path%3E%3Cpath d='M1 9h3'%3E%3C/path%3E%3Cpath d='M1 14h3'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  transform: rotate(-10deg);
}
[data-theme="dark"] .watermark { filter: invert(1); opacity: .05; }

.card-header {
  display: flex; justify-content: space-between; align-items: start;
  gap: 12px; margin-bottom: 22px; z-index: 1;
}

.loc-title {
  font-family: var(--serif);
  font-size: 19px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.provider {
  font-size: 12.5px; color: var(--muted); margin-top: 4px;
  font-weight: 500; text-transform: uppercase; letter-spacing: .08em;
}

.price-badge {
  background: var(--accent-soft);
  padding: 6px 12px; border-radius: 999px;
  font-family: var(--mono); font-weight: 600; font-size: 14px;
  color: var(--accent); white-space: nowrap;
}

.specs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-bottom: 22px; z-index: 1;
}
.spec-item { display: flex; flex-direction: column; }
.spec-label {
  font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 3px;
}
.spec-value { font-size: 15px; font-weight: 600; }

/* ---------- 卡片底部 ---------- */

.card-foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 14px; z-index: 1;
}

.eval-text {
  font-size: 13px; color: var(--muted);
  margin-bottom: 12px; line-height: 1.5;
  font-style: italic; min-height: 1.4em;
}

.status-row {
  display: flex; justify-content: space-between; align-items: center;
}
.status-row > div:last-child { font-size: 12px; color: var(--muted); }

.status-pill {
  display: flex; align-items: center;
  font-size: 12px; font-weight: 700; gap: 6px;
  text-transform: uppercase; letter-spacing: .05em;
}
.dot { width: 8px; height: 8px; border-radius: 50%; }

.status-good { color: var(--ok); }
.status-good .dot { background: var(--ok); box-shadow: 0 0 8px color-mix(in srgb, var(--ok) 40%, transparent); }
.status-warning { color: var(--warn); }
.status-warning .dot { background: var(--warn); }
.status-expired { color: var(--danger); }
.status-expired .dot { background: var(--danger); }

/* ---------- 语言切换显隐 ---------- */

.lang-en { display: none; }
body.en-mode .lang-zh { display: none; }
body.en-mode .lang-en { display: inline-block; }
body.en-mode .eval-text .lang-en { display: block; }

/* ---------- 页脚 ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  text-align: center; padding: 44px 20px 54px; color: var(--muted);
}
.footer-quote { font-family: var(--serif); letter-spacing: .2em; margin: 0; font-size: 15px; }
.footer-quote small { display: block; margin-top: 6px; font-size: 12px; letter-spacing: .1em; }
.footer-copy { margin: 16px 0 0; font-size: 12px; letter-spacing: .08em; }

/* ---------- 小屏 ---------- */

@media (max-width: 640px) {
  .topbar { padding: 12px 16px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card { padding: 20px; }
  .specs { gap: 10px 14px; }
}

/* ---------- 动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- 购机信息（购于 / 已用 / 续费） ---------- */

.tenure {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 0 0 10px;
  font-size: 11.5px;
  letter-spacing: .02em;
  color: var(--muted);
  z-index: 1;
}
.tenure i { font-style: normal; opacity: .45; }
.tenure .renew {
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
}

/* ============================================================
   页面切换 · 滚动条 · 导航手感
   ============================================================ */

/* ---------- 跨文档视图过渡：资产 ⇄ 免费资源 ---------- */

@view-transition { navigation: auto; }

.topbar { view-transition-name: topbar; }

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: .38s;
  animation-timing-function: cubic-bezier(.22, .7, .3, 1);
  animation-fill-mode: both;
}
::view-transition-old(root) { animation-name: vt-out; }
::view-transition-new(root) { animation-name: vt-in; }

/* 顶栏单独成组：只做柔和明暗，不跟页面位移，切换时更稳 */
::view-transition-old(topbar),
::view-transition-new(topbar) {
  animation-duration: .3s;
  animation-timing-function: ease;
  animation-fill-mode: both;
}
::view-transition-old(topbar) { animation-name: vt-fade-out; }
::view-transition-new(topbar) { animation-name: vt-fade-in; }

@keyframes vt-out { to { opacity: 0; transform: translateY(-10px) scale(.996); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px) scale(.996); } }
@keyframes vt-fade-out { to { opacity: .4; } }
@keyframes vt-fade-in { from { opacity: .4; } }

/* 不支持视图过渡的浏览器：入场时轻轻淡入 */
html.page-enter body { animation: page-in .32s cubic-bezier(.22, .7, .3, 1) both; }
@keyframes page-in { from { opacity: 0; } }

/* ---------- 导航按钮手感 ---------- */

.lang-switch:hover { background: var(--accent-soft); }
.lang-switch:active { transform: translateY(1px) scale(.985); }

/* ---------- 滚动条：细圆、静止低调、悬停见朱砂 ---------- */

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--line-2) 85%, transparent);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); background-clip: content-box; }
::-webkit-scrollbar-thumb:active { background: var(--accent); background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }

@supports (-moz-appearance: none) {
  html { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
  html.page-enter body { animation: none !important; }
}

.lang-switch { transition: border-color .2s, color .2s, background .2s, transform .18s; }

/* 兜底入场：默认生效；视图过渡接管时（html.vt）关闭，避免动画叠加 */
body { animation: page-in .32s cubic-bezier(.22, .7, .3, 1) both; }
html.vt body { animation: none; }

/* 兜底入场：默认生效；视图过渡接管时（html.vt）关闭，避免动画叠加 */
body { animation: page-in .32s cubic-bezier(.22, .7, .3, 1) both; }
html.vt body { animation: none; }

/* ============================================================
   免费资源 · 上滑面板
   ============================================================ */

body.sheet-open { overflow: hidden; }

.sheet {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -24px 60px rgba(33, 29, 24, .18);
  overflow: hidden;
  visibility: hidden;
  transform: translateY(100%);
  transition: transform .48s cubic-bezier(.32, .72, 0, 1),
              visibility 0s linear .48s;
  will-change: transform;
}
.sheet.open {
  visibility: visible;
  transform: translateY(0);
  transition: transform .48s cubic-bezier(.32, .72, 0, 1),
              visibility 0s linear 0s;
}
.sheet.is-drag { transition: none; }

.sheet-bar {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.sheet-bar:active { cursor: grabbing; }

.sheet-grip {
  position: absolute;
  top: 6px;
  left: 50%;
  width: 42px;
  height: 4px;
  margin-left: -21px;
  border-radius: 99px;
  background: var(--line-2);
  transition: background .2s;
}
.sheet-bar:hover .sheet-grip { background: var(--accent); }

.sheet-title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .1em;
}
.sheet-close {
  margin-left: auto;
  padding: 6px 14px;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}
.sheet-close:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.sheet-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: var(--bg);
}
.sheet-body iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--bg);
}

@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet.open { transition: none; }
}

/* 面板里的免费页：隐藏它自己的顶栏与页脚 */
html.embed .topbar,
html.embed .site-footer { display: none; }
html.embed body { min-height: 100vh; }

/* ------------------------------------------------------------
   顶栏胶囊：双语叠放，切换语言时气泡宽度不跳
   ------------------------------------------------------------ */

.lang-switch {
  display: inline-grid;
  place-items: center;
  height: 34px;
  padding: 0 15px;
  line-height: 1;
  white-space: nowrap;
  font-size: 12.5px;
}
.lang-switch > span { grid-area: 1 / 1; }

.lang-switch .lang-zh,
.lang-switch .lang-en { display: block; }
.lang-switch .lang-en { visibility: hidden; }

body.en-mode .lang-switch .lang-zh { display: block; visibility: hidden; }
body.en-mode .lang-switch .lang-en { display: block; visibility: visible; }

/* 小屏收一收顶栏胶囊，给品牌让位 */
@media (max-width: 480px) {
  .lang-switch { height: 32px; padding: 0 11px; font-size: 11.8px; }
  .topnav { gap: 8px; }
}
