:root {
  --bg: #07080c;
  --bg2: #0c0f16;
  --card: rgba(18, 22, 32, 0.88);
  --card-solid: #141924;
  --text: #f5f7fb;
  --muted: #9aa3b2;
  --muted2: #6f7888;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #7dd3fc;
  --accent2: #a78bfa;
  --good: #34d399;
  --warn: #fbbf24;
  --danger: #fb7185;
  --radius: 24px;
  --topbar: 64px;
  --subbar: 58px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html.snap-y { scroll-snap-type: y proximity; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(125, 211, 252, 0.10), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(167, 139, 250, 0.10), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
.hidden { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--topbar);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 22px;
  background: rgba(7, 8, 12, 0.78);
  backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
  white-space: nowrap;
}
.brand span {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand small {
  margin-left: 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted2);
  letter-spacing: 0;
}
.section-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255,255,255,.05); }
.section-tabs button {
  border: 0; background: transparent; color: var(--muted);
  padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
}
.section-tabs button.active { background: rgba(255,255,255,.12); color: var(--text); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search-wrap { width: 0; overflow: hidden; transition: width .25s ease; }
.search-wrap.open { width: min(280px, 38vw); }
.search-wrap input {
  width: 100%; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255,255,255,.06); padding: 9px 14px; outline: none;
}
.search-wrap input:focus { border-color: rgba(125,211,252,.45); }
.icon-btn {
  border: 1px solid var(--line); background: rgba(255,255,255,.05);
  color: var(--text); border-radius: 999px; padding: 8px 13px; font-size: 13px;
}
.icon-btn:hover { background: rgba(255,255,255,.1); }

/* ---------- sub bar ---------- */
.subbar {
  position: sticky;
  top: var(--topbar);
  z-index: 40;
  margin-top: var(--topbar);
  min-height: var(--subbar);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 22px;
  background: rgba(7, 8, 12, 0.70);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.subbar::-webkit-scrollbar { display: none; }
.country-tabs, .range-tabs, .layout-tabs { display: flex; gap: 6px; white-space: nowrap; }
.country-tabs button, .range-tabs button, .layout-tabs button {
  border: 1px solid var(--line); background: rgba(255,255,255,.04);
  color: var(--muted); border-radius: 999px; padding: 7px 13px; font-size: 12px;
}
.country-tabs button.active, .range-tabs button.active, .layout-tabs button.active {
  color: #061018; background: linear-gradient(90deg, var(--accent), #bae6fd);
  border-color: transparent; font-weight: 700;
}
.country-tabs button:disabled { opacity: .35; cursor: not-allowed; }
.layout-tabs { margin-left: auto; }

/* ---------- hero ---------- */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 34px 22px 18px;
}
.hero-kicker { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.hero h1 {
  margin: 8px 0 10px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.05;
  letter-spacing: -1.2px;
  max-width: 900px;
}
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 10px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: rgba(255,255,255,.05);
  border-radius: 999px; padding: 6px 11px; font-size: 12px; color: var(--muted);
}
.pill b { color: var(--text); }
.hero-note { color: var(--muted2); font-size: 11px; }

/* ---------- day / genre strips ---------- */
.daystrip, .genrebar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4px 22px 10px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.daystrip::-webkit-scrollbar, .genrebar::-webkit-scrollbar { display: none; }
.daystrip button, .genrebar button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
  color: var(--muted);
  border-radius: 14px;
  padding: 9px 12px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.daystrip button.active, .genrebar button.active {
  color: var(--text);
  border-color: rgba(125,211,252,.5);
  background: rgba(125,211,252,.10);
}
.daystrip .count { color: var(--muted2); font-size: 10px; }
.genrebar button { border-radius: 999px; padding: 7px 12px; }

/* ---------- feed ---------- */
.feed {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6px 22px 40px;
}
.feed.layout-1 { max-width: 880px; display: flex; flex-direction: column; gap: 18px; }
.feed.layout-4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.feed.layout-batch { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }

/* big card */
.card-1 {
  position: relative;
  min-height: calc(100dvh - 150px);
  border-radius: 30px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10);
  scroll-snap-align: start;
  scroll-margin-top: 140px;
  background-color: #10141d;
  background-image:
    linear-gradient(180deg, rgba(5,7,12,.10) 0%, rgba(5,7,12,.52) 42%, rgba(5,7,12,.97) 100%),
    var(--bg, linear-gradient(135deg, #13202c, #1b1530));
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 26px;
  cursor: pointer;
  isolation: isolate;
}
.card-1::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(800px 300px at 50% 100%, rgba(125,211,252,.08), transparent 70%);
}
.card-1 .card-top { position: absolute; top: 20px; left: 20px; right: 20px; display: flex; gap: 8px; flex-wrap: wrap; }
.card-1 .card-body { position: relative; z-index: 1; }
.card-1 .app-icon { width: 88px; height: 88px; border-radius: 22px; border: 1px solid rgba(255,255,255,.18); box-shadow: 0 18px 40px rgba(0,0,0,.45); }
.card-1 h2 { margin: 16px 0 4px; font-size: clamp(26px, 4vw, 38px); line-height: 1.08; letter-spacing: -1px; }
.card-1 .seller { color: #cbd5e1; font-size: 14px; margin-bottom: 12px; }
.card-1 .meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.card-1 .desc { color: #dbe4f0; font-size: 14px; line-height: 1.55; max-width: 760px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.card-1 .shots { display: flex; gap: 8px; overflow-x: auto; margin: 14px 0 6px; padding-bottom: 4px; scrollbar-width: none; }
.card-1 .shots::-webkit-scrollbar { display: none; }
.card-1 .shots img { height: 132px; width: auto; border-radius: 12px; border: 1px solid rgba(255,255,255,.14); background: #0b0e14; }
.card-1 .actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.btn {
  border: 1px solid var(--line); border-radius: 999px; padding: 9px 15px;
  background: rgba(255,255,255,.08); color: var(--text); font-size: 13px; font-weight: 600;
}
.btn:hover { background: rgba(255,255,255,.14); }
.btn.primary { background: linear-gradient(90deg, var(--accent), #bae6fd); color: #061018; border-color: transparent; }
.btn.ghost { background: rgba(7,8,12,.5); }
.btn.small { padding: 6px 11px; font-size: 12px; }

/* compact cards */
.card-4, .card-batch {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)), var(--card);
  border-radius: 22px;
  padding: 14px;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.card-4:hover, .card-batch:hover { transform: translateY(-2px); border-color: rgba(125,211,252,.35); }
.card-4 { min-height: 220px; display: flex; flex-direction: column; gap: 10px; }
.card-4 .head, .card-batch .head { display: flex; gap: 10px; align-items: flex-start; }
.card-4 .app-icon { width: 58px; height: 58px; border-radius: 15px; flex: 0 0 auto; }
.card-4 h3, .card-batch h3 { margin: 0; font-size: 15px; line-height: 1.22; letter-spacing: -.2px; }
.card-4 .seller, .card-batch .seller { color: var(--muted); font-size: 11px; margin-top: 3px; }
.card-4 .desc { color: var(--muted); font-size: 12px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-4 .foot, .card-batch .foot { margin-top: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-4 .shots { display: flex; gap: 6px; overflow: hidden; }
.card-4 .shots img { height: 52px; border-radius: 7px; border: 1px solid var(--line); }
.card-batch { padding: 11px; border-radius: 16px; display: flex; flex-direction: column; gap: 8px; min-height: 150px; }
.card-batch .app-icon { width: 42px; height: 42px; border-radius: 11px; flex: 0 0 auto; }
.card-batch h3 { font-size: 13px; }
.card-batch .seller { font-size: 10px; }
.card-batch .desc { display: none; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 999px; padding: 4px 8px; font-size: 10px; font-weight: 700;
  background: rgba(255,255,255,.10); color: #e2e8f0; border: 1px solid rgba(255,255,255,.08);
}
.badge.accent { background: rgba(125,211,252,.16); color: #bae6fd; border-color: rgba(125,211,252,.28); }
.badge.good { background: rgba(52,211,153,.14); color: #a7f3d0; border-color: rgba(52,211,153,.25); }
.badge.warn { background: rgba(251,191,36,.13); color: #fde68a; border-color: rgba(251,191,36,.24); }
.badge.danger { background: rgba(251,113,133,.13); color: #fecdd3; border-color: rgba(251,113,133,.25); }
.muted { color: var(--muted); }
.tiny { color: var(--muted2); font-size: 10px; }

/* skeleton */
.skeleton { border-radius: 22px; background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.10), rgba(255,255,255,.04)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton.big { min-height: calc(100dvh - 150px); }
.skeleton.small { min-height: 220px; }

.feed-status { text-align: center; color: var(--muted2); font-size: 12px; padding: 20px; }
.sentinel { height: 1px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(2,4,8,.72); backdrop-filter: blur(10px); }
.modal-panel {
  position: relative; width: min(960px, 96vw); max-height: 92dvh; overflow: auto;
  border-radius: 26px; border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(180deg, rgba(24,29,41,.98), rgba(12,15,22,.99));
  box-shadow: 0 40px 120px rgba(0,0,0,.65);
}
.modal-close { position: sticky; top: 12px; float: right; margin: 12px 14px 0 0; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: rgba(7,8,12,.8); color: var(--text); font-size: 22px; line-height: 1; }
.modal-content { padding: 26px; }
.detail-head { display: flex; gap: 16px; align-items: flex-start; padding-right: 40px; }
.detail-head .app-icon { width: 84px; height: 84px; border-radius: 20px; border: 1px solid var(--line); }
.detail-head h2 { margin: 0 0 4px; font-size: clamp(22px, 3vw, 32px); line-height: 1.1; letter-spacing: -.6px; }
.detail-head .seller { color: var(--muted); font-size: 13px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.detail-shots { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; }
.detail-shots::-webkit-scrollbar { display: none; }
.detail-shots img { height: min(420px, 48dvh); width: auto; border-radius: 16px; border: 1px solid var(--line); background: #0b0e14; }
.detail-section { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 18px; }
.detail-section h3 { margin: 0 0 10px; font-size: 14px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.detail-desc { color: #dbe4f0; font-size: 14px; line-height: 1.7; white-space: pre-wrap; }
.detail-desc.zh { color: #e8f4ff; }
.translate-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px 18px; font-size: 13px; }
.meta-grid div { display: flex; gap: 8px; border-bottom: 1px dashed rgba(255,255,255,.06); padding: 7px 0; }
.meta-grid b { color: var(--muted); font-weight: 500; min-width: 82px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { border-radius: 999px; padding: 4px 9px; background: rgba(167,139,250,.14); color: #ddd6fe; font-size: 11px; border: 1px solid rgba(167,139,250,.25); }
.detail-loading { display: flex; align-items: center; justify-content: center; min-height: 320px; color: var(--muted); gap: 12px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,.15); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 200; max-width: 90vw; border-radius: 14px; padding: 11px 16px; background: rgba(18,22,32,.96); border: 1px solid var(--line); color: var(--text); font-size: 13px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .feed.layout-batch { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .brand small { display: none; }
}
@media (max-width: 720px) {
  :root { --topbar: 58px; --subbar: 52px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .brand { font-size: 17px; }
  .section-tabs button { padding: 6px 10px; font-size: 12px; }
  .top-actions { gap: 6px; }
  #layoutToggle { display: none; }
  .subbar {
    position: static;
    flex-wrap: wrap;
    overflow: visible;
    padding: 8px 14px;
    gap: 8px;
  }
  .country-tabs, .range-tabs, .layout-tabs { flex-wrap: wrap; }
  .layout-tabs { margin-left: 0; width: 100%; }
  .hero { padding: 16px 16px 12px; }
  .hero h1 { font-size: 28px; }
  .daystrip, .genrebar { padding-left: 16px; padding-right: 16px; }
  .feed { padding: 4px 14px 34px; }
  .feed.layout-1 { max-width: 100%; gap: 14px; }
  .feed.layout-4 { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .feed.layout-batch { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .card-1 { min-height: calc(100dvh - 138px); padding: 18px; border-radius: 24px; scroll-margin-top: 120px; }
  .card-1 .app-icon { width: 70px; height: 70px; border-radius: 18px; }
  .card-1 h2 { font-size: 25px; }
  .card-1 .shots img { height: 98px; }
  .card-1 .desc { -webkit-line-clamp: 3; font-size: 13px; }
  .card-4 { min-height: 190px; padding: 12px; border-radius: 18px; }
  .card-4 .app-icon { width: 48px; height: 48px; border-radius: 13px; }
  .card-4 h3 { font-size: 13px; }
  .card-4 .desc { -webkit-line-clamp: 2; }
  .card-batch { min-height: 132px; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-panel { width: 100vw; max-height: 94dvh; border-radius: 22px 22px 0 0; }
  .modal-content { padding: 18px; }
  .detail-head .app-icon { width: 64px; height: 64px; border-radius: 16px; }
  .detail-shots img { height: 300px; }
  .meta-grid { grid-template-columns: 1fr; }
  .search-wrap.open { width: 46vw; }
}

/* ---------- top 100 panel ---------- */
body.top-mode .hero,
body.top-mode #daystrip,
body.top-mode #genrebar,
body.top-mode #feed,
body.top-mode #sentinel,
body.top-mode #feedStatus { display: none !important; }
body.top-mode .subbar .range-tabs,
body.top-mode .subbar .layout-tabs { display: none; }

.top100-panel {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 22px 70px;
}
.top100-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.top100-head h1 {
  margin: 8px 0 6px;
  font-size: clamp(26px, 3.4vw, 42px);
  letter-spacing: -1px;
}
.top100-controls {
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: flex-end;
}
.top100-genres { padding: 0; margin: 0; max-width: 100%; }
.top100-table-wrap {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: auto;
  background: rgba(10, 13, 20, .55);
}
.top100-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 13px;
}
.top100-table th,
.top100-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.top100-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #10141d;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.top100-table tbody tr:hover { background: rgba(125, 211, 252, .05); }
.top100-table .app-cell { display: flex; align-items: center; gap: 10px; min-width: 260px; }
.top100-table .app-cell img { width: 38px; height: 38px; border-radius: 9px; flex: 0 0 auto; }
.top100-table .app-cell .name { font-weight: 650; color: var(--text); }
.top100-table .app-cell .sub { color: var(--muted2); font-size: 11px; }
.top100-table .rank { color: var(--accent); font-weight: 800; }
.top100-table .num { color: var(--muted); white-space: nowrap; }
@media (max-width: 720px) {
  .top100-panel { padding: 20px 14px 50px; }
  .top100-head { align-items: flex-start; flex-direction: column; }
  .top100-controls { align-items: flex-start; width: 100%; }
}

.top100-table th { white-space: nowrap; }
.top100-table .app-cell > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
body.top-mode #layoutToggle,
body.top-mode #searchToggle,
body.top-mode #searchWrap { display: none; }

/* ---------- light theme ---------- */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7fc;
  --bg2: #eaf0f8;
  --text: #0c1220;
  --muted: #5b6576;
  --muted2: #7c8798;
  --line: rgba(12, 18, 32, 0.10);
  --card: rgba(255, 255, 255, 0.94);
  --card-solid: #ffffff;
  --accent: #0284c7;
  --accent2: #7c3aed;
  --good: #059669;
  --warn: #d97706;
  --danger: #e11d48;
}
html:not([data-theme="light"]) { color-scheme: dark; }

html[data-theme="light"] body {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(2, 132, 199, 0.10), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(124, 58, 237, 0.08), transparent 55%),
    var(--bg);
}
html[data-theme="light"] .topbar { background: rgba(255, 255, 255, 0.84); }
html[data-theme="light"] .subbar { background: rgba(255, 255, 255, 0.78); }
html[data-theme="light"] .section-tabs { background: rgba(12, 18, 32, 0.05); }
html[data-theme="light"] .section-tabs button { color: #64748b; }
html[data-theme="light"] .section-tabs button.active { background: rgba(12, 18, 32, 0.10); color: var(--text); }
html[data-theme="light"] .icon-btn,
html[data-theme="light"] .country-tabs button,
html[data-theme="light"] .range-tabs button,
html[data-theme="light"] .layout-tabs button,
html[data-theme="light"] .daystrip button,
html[data-theme="light"] .genrebar button,
html[data-theme="light"] .pill {
  background: rgba(255, 255, 255, 0.78);
  border-color: var(--line);
  color: #5b6576;
}
html[data-theme="light"] .search-wrap input {
  background: #ffffff;
  color: var(--text);
  border-color: var(--line);
}
html[data-theme="light"] .search-wrap input::placeholder { color: #94a3b8; }
html[data-theme="light"] .pill b,
html[data-theme="light"] .hero h1,
html[data-theme="light"] .top100-head h1 { color: var(--text); }
html[data-theme="light"] .hero-note,
html[data-theme="light"] .feed-status { color: var(--muted2); }
html[data-theme="light"] .card-4,
html[data-theme="light"] .card-batch {
  background: linear-gradient(180deg, #ffffff, #f7f9fd);
  border-color: rgba(12, 18, 32, 0.10);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}
html[data-theme="light"] .card-4:hover,
html[data-theme="light"] .card-batch:hover { border-color: rgba(2, 132, 199, 0.35); }
html[data-theme="light"] .badge {
  background: rgba(12, 18, 32, 0.06);
  color: #334155;
  border-color: rgba(12, 18, 32, 0.08);
}
html[data-theme="light"] .badge.accent { background: rgba(2, 132, 199, 0.10); color: #0369a1; border-color: rgba(2, 132, 199, 0.20); }
html[data-theme="light"] .badge.good { background: rgba(5, 150, 105, 0.10); color: #047857; border-color: rgba(5, 150, 105, 0.20); }
html[data-theme="light"] .badge.warn { background: rgba(217, 119, 6, 0.10); color: #b45309; border-color: rgba(217, 119, 6, 0.20); }
html[data-theme="light"] .badge.danger { background: rgba(225, 29, 72, 0.10); color: #be123c; border-color: rgba(225, 29, 72, 0.20); }
html[data-theme="light"] .modal-backdrop { background: rgba(15, 23, 42, 0.42); }
html[data-theme="light"] .modal-panel {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border-color: rgba(12, 18, 32, 0.12);
  box-shadow: 0 40px 120px rgba(15, 23, 42, 0.25);
}
html[data-theme="light"] .modal-close { background: rgba(255, 255, 255, 0.92); color: var(--text); }
html[data-theme="light"] .detail-desc,
html[data-theme="light"] .detail-desc.zh { color: #1e293b; }
html[data-theme="light"] .detail-shots img,
html[data-theme="light"] .card-1 .shots img { background: #eef2f7; }
html[data-theme="light"] .meta-grid div { border-color: rgba(12, 18, 32, 0.08); }
html[data-theme="light"] .tag { background: rgba(124, 58, 237, 0.10); color: #6d28d9; border-color: rgba(124, 58, 237, 0.18); }
html[data-theme="light"] .toast {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
}
html[data-theme="light"] .top100-table-wrap { background: #ffffff; }
html[data-theme="light"] .top100-table th { background: #f1f5f9; color: #64748b; }
html[data-theme="light"] .top100-table tbody tr:hover { background: rgba(2, 132, 199, 0.04); }
html[data-theme="light"] .top100-table .app-cell .name { color: var(--text); }
html[data-theme="light"] .top100-table .app-cell .sub { color: var(--muted2); }
html[data-theme="light"] .skeleton {
  background: linear-gradient(90deg, rgba(12, 18, 32, 0.04), rgba(12, 18, 32, 0.08), rgba(12, 18, 32, 0.04));
  background-size: 200% 100%;
}

/* card 1: fully light in the light-only theme */
html[data-theme="light"] .card-1 {
  color: #0c1220;
  background-color: #eaf0f8;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.42) 0%, rgba(255,255,255,.78) 42%, rgba(255,255,255,.98) 100%),
    var(--bg, linear-gradient(135deg, #e0f2fe, #ede9fe));
}
html[data-theme="light"] .card-1 h2 { color: #0c1220; }
html[data-theme="light"] .card-1 .seller { color: #475569; }
html[data-theme="light"] .card-1 .desc { color: #334155; }
html[data-theme="light"] .card-1 .badge {
  background: rgba(255,255,255,.82);
  color: #334155;
  border-color: rgba(12,18,32,.10);
}
html[data-theme="light"] .card-1 .badge.accent { background: rgba(2,132,199,.10); color: #0369a1; border-color: rgba(2,132,199,.20); }
html[data-theme="light"] .card-1 .badge.good { background: rgba(5,150,105,.10); color: #047857; border-color: rgba(5,150,105,.20); }
html[data-theme="light"] .card-1 .badge.warn { background: rgba(217,119,6,.12); color: #b45309; border-color: rgba(217,119,6,.22); }
html[data-theme="light"] .card-1 .badge.danger { background: rgba(225,29,72,.10); color: #be123c; border-color: rgba(225,29,72,.20); }
html[data-theme="light"] .card-1 .btn {
  background: rgba(255,255,255,.82);
  color: #0c1220;
  border-color: rgba(12,18,32,.10);
}
html[data-theme="light"] .card-1 .btn.primary {
  background: linear-gradient(90deg, var(--accent), #38bdf8);
  color: #ffffff;
  border-color: transparent;
}
html[data-theme="light"] .card-1 .btn.ghost { background: rgba(255,255,255,.65); }
html[data-theme="light"] .card-1 .shots img { background: #eef2f7; border-color: rgba(12,18,32,.10); }

.apple-status {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
html[data-theme="light"] .apple-status { background: #f8fafc; }

/* 18 official game subgenres: keep one scrollable row */
.top100-genres {
  flex-wrap: nowrap;
  overflow-x: auto;
  max-width: min(900px, 70vw);
}
@media (max-width: 720px) {
  .top100-genres { max-width: 100%; }
}

.top100-table tbody tr { cursor: pointer; }

/* Country tabs must look enabled in the light theme (active + inactive). */
html[data-theme="light"] .country-tabs button {
  background: #ffffff;
  color: #334155;
  border-color: #cbd5e1;
}
html[data-theme="light"] .country-tabs button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
html[data-theme="light"] .country-tabs button.active,
html[data-theme="light"] .range-tabs button.active,
html[data-theme="light"] .layout-tabs button.active {
  background: linear-gradient(90deg, var(--accent), #bae6fd);
  color: #061018;
  border-color: transparent;
  font-weight: 700;
}

/* 马甲包标记 */
.jacket-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  cursor: help;
}
.jacket-badge.j-high { background: #fde8e8; color: #c02424; border: 1px solid #f5b5b5; }
.jacket-badge.j-sus  { background: #fdf3dc; color: #9a6b00; border: 1px solid #ecd9a0; }
.top100-table td .jacket-badge { font-size: 11px; padding: 2px 6px; }

/* 猜你喜欢 */
.related-list { display: flex; flex-wrap: wrap; gap: 8px; }
.related-item {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line, #e5e5e5); border-radius: 8px;
  padding: 6px 10px; text-decoration: none; color: inherit;
}
.related-item:hover { border-color: #9aa7ff; background: #f5f7ff; }
.ri-name { font-weight: 600; }
.ri-seller { color: #888; font-size: 12px; }
.ri-empty { color: #999; font-size: 13px; }


/* Remote iPad install */
#installIpad {
  white-space: nowrap;
}
.install-panel {
  width: min(680px, calc(100vw - 32px));
}
.install-head h2 {
  margin: 0 0 6px;
}
.install-actions {
  display: flex;
  gap: 8px;
  margin: 14px 0 10px;
}
.install-status {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}
.install-log {
  max-height: 320px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #070a10;
  color: #b9c3d3;
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.send-mini {
  margin-left: auto;
}


/* Markdown copy modal */
.markdown-panel {
  width: min(780px, calc(100vw - 32px));
}
.markdown-head h2 {
  margin: 0 0 6px;
}
.markdown-text {
  width: 100%;
  height: min(48vh, 440px);
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #070a10;
  color: #dbe4f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.55;
  resize: vertical;
}
.markdown-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}
.markdown-status {
  min-height: 17px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
