/* WorkBuddy 下载中心 · 暗色主题 */

:root {
  --bg: #0a0d13;
  --bg-soft: #0f141d;
  --panel: #121826;
  --panel-hover: #161e2e;
  --line: #1f2839;
  --line-strong: #2b3648;
  --text: #e8eef7;
  --text-dim: #9aa8bd;
  --text-faint: #6b798f;
  --accent: #4d8dff;
  --accent-2: #8b6cff;
  --ok: #35d39a;
  --warn: #f0b429;
  --danger: #ff6b6b;

  --win: #4d8dff;
  --mac: #a78bfa;
  --linux: #f0b429;
  --harmony: #35d3c8;
  --ios: #60a5fa;
  --android: #4ade80;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 40px -24px rgba(0, 0, 0, .9);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(900px 480px at 12% -8%, rgba(77, 141, 255, .14), transparent 62%),
    radial-gradient(760px 420px at 88% 0%, rgba(139, 108, 255, .12), transparent 60%);
  background-repeat: no-repeat;
  min-height: 100vh;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px 72px;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  background: linear-gradient(180deg, rgba(10, 13, 19, .94) 60%, rgba(10, 13, 19, 0));
  backdrop-filter: blur(10px);
}

.brand { display: flex; align-items: center; gap: 11px; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .5px;
  box-shadow: 0 6px 16px -8px rgba(77, 141, 255, .9);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; letter-spacing: .2px; }
.brand-text em { font-style: normal; font-size: 12px; color: var(--text-faint); }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-dim);
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 24, 38, .7);
}

.status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  box-shadow: 0 0 0 3px rgba(107, 121, 143, .15);
}

.status[data-state="live"] .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(53, 211, 154, .16); }
.status[data-state="cache"] .dot { background: var(--warn); box-shadow: 0 0 0 3px rgba(240, 180, 41, .16); }
.status[data-state="error"] .dot { background: var(--danger); box-shadow: 0 0 0 3px rgba(255, 107, 107, .16); }
.status[data-state="loading"] .dot { animation: pulse 1.2s ease-in-out infinite; }

@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background .16s ease, border-color .16s ease, transform .16s ease, color .16s ease;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #3f6fe0);
  color: #fff;
  box-shadow: 0 10px 24px -14px rgba(77, 141, 255, .95);
}
.btn-primary:hover { background: linear-gradient(135deg, #5f9aff, #4a7bea); }

.btn-ghost {
  background: rgba(18, 24, 38, .8);
  border-color: var(--line);
  color: var(--text-dim);
}
.btn-ghost:hover { border-color: var(--line-strong); color: var(--text); }

.btn-sm {
  font-size: 12.5px;
  padding: 6px 11px;
  border-radius: 8px;
}

.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------------- Hero ---------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 236px;
  gap: 40px;
  align-items: end;
  padding: 34px 0 44px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 11.5px;
  letter-spacing: 1.6px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: 38px;
  line-height: 1.24;
  letter-spacing: -.6px;
  font-weight: 700;
  background: linear-gradient(120deg, #ffffff 20%, #b9cdf0 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin: 0;
  max-width: 560px;
  color: var(--text-dim);
  font-size: 14.5px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero-actions .btn { padding: 11px 20px; font-size: 14px; }

.hero-actions .hint {
  align-self: center;
  font-size: 12.5px;
  color: var(--text-faint);
}

.hero-side {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 16px;
  background: var(--panel);
}

.stat-label { font-size: 11.5px; color: var(--text-faint); letter-spacing: .3px; }
.stat-value { font-size: 16px; font-weight: 650; letter-spacing: .2px; }
.stat-value.small { font-size: 13px; font-weight: 500; color: var(--text-dim); }

/* ---------------- 区块 ---------------- */

.block { padding: 46px 0 4px; }

.block-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.block-head-text { min-width: 0; }

.block-head h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -.2px;
  font-weight: 650;
}

.block-head h2::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 15px;
  margin-right: 9px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  vertical-align: -2px;
}

.block-head p { margin: 0; font-size: 12.5px; color: var(--text-faint); }

/* ---------------- 版本切换 ---------------- */

.edition-bar {
  position: sticky;
  top: 66px;
  z-index: 18;
  display: flex;
  margin: 0 -10px 4px;
  padding: 10px 10px 8px;
  background: linear-gradient(180deg, rgba(10, 13, 19, .97) 60%, rgba(10, 13, 19, .84));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(31, 40, 57, .8);
}

/* 两个版本等分整行，做大点击区 */
.edition-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  padding: 5px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(15, 20, 29, .85);
}

.edition-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  cursor: pointer;
  text-align: center;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.edition-tab:hover { color: var(--text); background: rgba(255, 255, 255, .04); }

.edition-tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(77, 141, 255, .95), rgba(63, 111, 224, .95));
  border-color: rgba(120, 168, 255, .5);
  box-shadow: 0 8px 20px -12px rgba(77, 141, 255, .9);
}

.et-label { font-size: 16px; font-weight: 700; letter-spacing: .4px; line-height: 1.3; }

.et-meta {
  font-size: 11.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.edition-tab.is-active .et-meta { color: rgba(255, 255, 255, .8); }

.edition-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .4px;
  color: #cfe0ff;
  background: rgba(77, 141, 255, .16);
  border: 1px solid rgba(77, 141, 255, .32);
  vertical-align: 2px;
}

.btn-sub { opacity: .72; font-weight: 500; }

.sha-empty code { color: var(--text-faint); font-style: normal; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px;
}

.grid-mobile { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ---------------- 卡片 ---------------- */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.card:hover {
  border-color: var(--line-strong);
  background: var(--panel-hover);
  transform: translateY(-2px);
}

.card.is-current {
  border-color: rgba(77, 141, 255, .5);
  box-shadow: 0 0 0 1px rgba(77, 141, 255, .22), var(--shadow);
}

.card.is-current::after {
  content: "当前设备";
  position: absolute;
  top: -9px;
  right: 14px;
  font-size: 10.5px;
  letter-spacing: .4px;
  font-weight: 600;
  color: #cfe0ff;
  background: linear-gradient(135deg, var(--accent), #3f6fe0);
  padding: 2px 9px;
  border-radius: 999px;
}

.card.is-error { border-color: rgba(255, 107, 107, .28); }

.card-head { display: flex; align-items: center; gap: 12px; }

.tile {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .4px;
  color: #fff;
  background: rgba(77, 141, 255, .16);
  border: 1px solid rgba(77, 141, 255, .3);
}

.tile[data-accent="win"] { color: var(--win); background: rgba(77, 141, 255, .12); border-color: rgba(77, 141, 255, .34); }
.tile[data-accent="mac"] { color: var(--mac); background: rgba(167, 139, 250, .12); border-color: rgba(167, 139, 250, .34); }
.tile[data-accent="linux"] { color: var(--linux); background: rgba(240, 180, 41, .12); border-color: rgba(240, 180, 41, .34); }
.tile[data-accent="harmony"] { color: var(--harmony); background: rgba(53, 211, 200, .12); border-color: rgba(53, 211, 200, .34); }
.tile[data-accent="ios"] { color: var(--ios); background: rgba(96, 165, 250, .12); border-color: rgba(96, 165, 250, .34); }
.tile[data-accent="android"] { color: var(--android); background: rgba(74, 222, 128, .12); border-color: rgba(74, 222, 128, .34); }

.card-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card-title strong { font-size: 15px; font-weight: 650; letter-spacing: .1px; }
.card-title span { font-size: 12.5px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.badge {
  margin-left: auto;
  flex: 0 0 auto;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .5px;
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--text-dim);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .03);
}

.meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  font-size: 12.5px;
  margin: 0;
}

.meta dt { color: var(--text-faint); }
.meta dd { margin: 0; color: var(--text-dim); font-variant-numeric: tabular-nums; }

.file-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 11.5px;
  color: var(--text-faint);
}

.file-line code {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-line {
  margin: 0;
  font-size: 12px;
  color: var(--text-faint);
  border-left: 2px solid var(--line-strong);
  padding-left: 10px;
  line-height: 1.5;
}

.sha {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--line);
}

.sha code {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;
  font-size: 10.5px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}

.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, .06); border-color: var(--line-strong); }

.card-actions { display: flex; gap: 8px; margin-top: auto; }
.card-actions .btn-primary { flex: 1; }

.card-error {
  font-size: 12.5px;
  color: var(--danger);
  background: rgba(255, 107, 107, .08);
  border: 1px solid rgba(255, 107, 107, .22);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
}

/* ---------------- 骨架屏 ---------------- */

.skeleton {
  height: 226px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(100deg, #121826 30%, #18202f 50%, #121826 70%);
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer { from { background-position: 160% 0; } to { background-position: -60% 0; } }

/* ---------------- 说明 ---------------- */

.notes {
  margin-top: 56px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 24, 38, .55);
}

.notes h2 { margin: 0 0 12px; font-size: 15px; font-weight: 650; }

.notes ol { margin: 0; padding-left: 20px; display: grid; gap: 9px; }

.notes li { font-size: 13px; color: var(--text-dim); }
.notes li strong { color: var(--text); font-weight: 600; }

.notes code {
  font-family: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;
  font-size: 11.5px;
  padding: 1.5px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .055);
  color: #b9cdf0;
}

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

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-faint);
}

.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--text-dim); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }

/* ---------------- Toast ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 14px);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  color: #eaf2ff;
  background: rgba(26, 34, 50, .96);
  border: 1px solid var(--line-strong);
  box-shadow: 0 16px 34px -18px rgba(0, 0, 0, .9);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 响应式 ---------------- */

@media (max-width: 880px) {
  .page { padding: 0 20px 60px; }
  .topbar { position: static; background: none; backdrop-filter: none; }
  .edition-bar {
    top: 0;
    margin: 0 -20px 4px;
    padding: 8px 20px 6px;
  }
  .hero { grid-template-columns: 1fr; gap: 26px; align-items: start; padding: 26px 0 34px; }
  .hero h1 { font-size: 30px; }
  .hero-side { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* 单列用 minmax(0, 1fr)：避免卡片内长字符串（SHA / 文件名）的最小内容宽度撑破网格 */
  .grid { grid-template-columns: minmax(0, 1fr); }
  .grid-mobile { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .edition-tab { padding: 9px 10px; }
  .et-label { font-size: 15px; }
  .et-meta { font-size: 11px; }
  .hero h1 { font-size: 26px; }
  .hero { gap: 20px; padding: 22px 0 26px; }
  .hero-side { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat { padding: 10px 11px; gap: 2px; }
  .stat-label { font-size: 10.5px; letter-spacing: 0; }
  .stat-value { font-size: 13px; }
  .stat-value.small { font-size: 11px; line-height: 1.35; }
  .block { padding-top: 34px; }
  .notes { padding: 18px; }
}
