:root {
  color-scheme: dark;
  --bg: #101412;
  --surface: #171c19;
  --surface-2: #1d231f;
  --surface-3: #242b26;
  --text: #f3f5f3;
  --text-2: #aeb8b1;
  --text-3: #778079;
  --line: #2b342e;
  --line-strong: #3a463e;
  --green: #7bc95b;
  --green-soft: rgba(123, 201, 91, 0.12);
  --cyan: #72c6d4;
  --amber: #e6b85c;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
  --max-width: 1160px;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6f2;
  --surface: #ffffff;
  --surface-2: #edf2ec;
  --surface-3: #e4ebe3;
  --text: #182019;
  --text-2: #526057;
  --text-3: #7b887f;
  --line: #d8e0d8;
  --line-strong: #c1ccc2;
  --green: #3e8c32;
  --green-soft: rgba(62, 140, 50, 0.1);
  --cyan: #277e90;
  --amber: #9a6c10;
  --shadow: 0 18px 48px rgba(25, 43, 29, 0.1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg); color: var(--text); font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.7; letter-spacing: 0; transition: background-color 180ms ease, color 180ms ease; }
a { color: inherit; text-decoration: none; transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease; }
button { font: inherit; color: inherit; letter-spacing: 0; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.breadcrumb { position: sticky; top: 0; z-index: 100; height: 68px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(18px); }
.detail-nav-inner { width: min(calc(100% - 40px), var(--max-width)); height: 100%; margin: 0 auto; display: flex; align-items: center; gap: 28px; }
.detail-brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.detail-brand-mark { width: 36px; height: 36px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface-2); box-shadow: inset 0 0 0 3px var(--surface); }
.detail-brand-mark img { width: 24px; height: 24px; object-fit: contain; }
.detail-brand-mark > span { color: var(--green); font-weight: 900; }
.detail-brand-copy { display: grid; line-height: 1.1; }
.detail-brand-copy strong { font-size: 0.88rem; }
.detail-brand-copy small { margin-top: 4px; color: var(--text-3); font-size: 0.62rem; }
.breadcrumb ol { min-width: 0; height: 100%; margin: 0; padding: 0; display: flex; align-items: center; gap: 8px; list-style: none; color: var(--text-3); font-size: 0.68rem; }
.breadcrumb li { flex: none; }
.breadcrumb li:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb a { color: var(--text-2); font-weight: 650; }
.breadcrumb a:hover { color: var(--green); }
.breadcrumb .sep { color: var(--line-strong); font-size: 0.52rem; }
.breadcrumb .current { color: var(--green); }
.detail-nav-actions { margin-left: auto; display: flex; gap: 8px; }
.nav-icon-button, .copy-link-button { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--text-2); cursor: pointer; }
.nav-icon-button:hover, .copy-link-button:hover { border-color: var(--line-strong); background: var(--surface-2); color: var(--text); }
.nav-icon-button svg, .copy-link-button svg { width: 16px; height: 16px; }
.theme-sun { display: none; }
[data-theme="light"] .theme-moon { display: none; }
[data-theme="light"] .theme-sun { display: block; }

.detail-container { width: min(calc(100% - 40px), var(--max-width)); margin: 0 auto; padding: 38px 0 34px; }
.hero-section { position: relative; margin-bottom: 14px; overflow: hidden; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); background: linear-gradient(90deg, color-mix(in srgb, var(--green) 6%, transparent) 1px, transparent 1px), linear-gradient(color-mix(in srgb, var(--green) 6%, transparent) 1px, transparent 1px), var(--surface); background-size: 30px 30px; }
.hero-section::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 3px; background: var(--green); }
.hero-top { min-height: 248px; display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: center; gap: 30px; padding: 42px 44px; }
.hero-logo { width: 104px; height: 104px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--bg); box-shadow: inset 0 0 0 6px var(--surface-2); }
.hero-logo img { width: 64px; height: 64px; object-fit: contain; }
.hero-logo .fallback { width: 100%; height: 100%; align-items: center; justify-content: center; font-size: 2rem; }
.hero-info { min-width: 0; }
.hero-eyebrow { margin: 0 0 8px; color: var(--green); font-size: 0.64rem; font-weight: 800; }
.hero-info h1 { margin: 0 0 12px; overflow-wrap: anywhere; font-size: clamp(2rem, 5vw, 3.7rem); line-height: 1.08; font-weight: 850; }
.hero-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--text-2); font-size: 0.78rem; }
.pixel-badge { display: inline-flex; padding: 3px 8px; border: 1px solid rgba(123, 201, 91, 0.24); border-radius: 4px; background: var(--green-soft); color: var(--green); font-size: 0.63rem; font-weight: 700; }
.pixel-badge.deprecated { border-color: var(--line-strong); background: var(--surface-3); color: var(--text-3); }
.hero-action-row { margin-top: 25px; display: flex; align-items: center; gap: 8px; }
.hero-link { min-height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; border: 1px solid var(--green); border-radius: 5px; background: var(--green); color: #0b140c; font-size: 0.75rem; font-weight: 750; }
.hero-link:hover { background: #8bd86b; color: #0b140c; transform: translateY(-1px); }
.hero-link svg { width: 15px; height: 15px; }

.info-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.info-item { min-width: 0; min-height: 100px; padding: 15px 16px; display: grid; grid-template-columns: 30px minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; column-gap: 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.info-icon { grid-row: 1 / 3; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--green); }
.info-icon svg { width: 14px; height: 14px; }
.info-item .label { margin-bottom: 3px; color: var(--text-3); font-size: 0.6rem; font-weight: 700; }
.info-item .value { min-width: 0; overflow-wrap: anywhere; color: var(--text-2); font-size: 0.72rem; font-weight: 600; }
.info-item .value a { color: var(--cyan); }
.info-item .value a:hover { color: var(--green); }

.detail-content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: 14px; }
.content-card { margin: 0 0 14px; padding: 30px 32px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.content-card h2 { margin: 0 0 24px; padding-bottom: 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); font-size: 1rem; line-height: 1.4; }
.section-icon { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border: 1px solid rgba(123, 201, 91, 0.25); border-radius: 4px; background: var(--green-soft); color: var(--green); }
.section-icon svg { width: 14px; height: 14px; }
.content-card p { margin: 0 0 15px; color: var(--text-2); font-size: 0.84rem; line-height: 2; }
.content-card p:last-child { margin-bottom: 0; }
.content-card ul, .content-card ol { margin: 0 0 16px; padding-left: 22px; }
.content-card li { margin-bottom: 7px; color: var(--text-2); font-size: 0.83rem; line-height: 1.85; }
.content-card li::marker { color: var(--green); }
.content-card .highlight { color: var(--amber); font-weight: 650; }

.related-section { position: sticky; top: 86px; margin: 0; padding: 0; border: 0; background: transparent; }
.related-section h2 { margin-bottom: 12px; padding: 12px 0; }
.related-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.related-card { min-width: 0; min-height: 68px; padding: 11px; display: grid; grid-template-columns: 34px minmax(0, 1fr) 16px; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.related-card:hover { border-color: var(--line-strong); background: var(--surface-2); transform: translateY(-1px); box-shadow: var(--shadow); }
.related-card img { width: 34px; height: 34px; padding: 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); object-fit: contain; }
.related-card > div { min-width: 0; }
.related-card .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 0.71rem; font-weight: 700; }
.related-card .cat { margin-top: 2px; color: var(--text-3); font-size: 0.59rem; }
.related-arrow { width: 14px; height: 14px; color: var(--text-3); }

.back-section { width: min(calc(100% - 40px), var(--max-width)); margin: 0 auto 48px; }
.back-link { min-height: 38px; display: inline-flex; align-items: center; gap: 8px; padding: 0 13px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--text-2); font-size: 0.71rem; font-weight: 650; }
.back-link:hover { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.back-link svg { width: 14px; height: 14px; }

.detail-footer { min-height: 132px; padding: 28px 20px; display: grid; place-items: center; align-content: center; gap: 4px; border-top: 1px solid var(--line); background: var(--surface); text-align: center; }
.footer-mark { margin-bottom: 8px; color: var(--green); font-size: 0.66rem; font-weight: 800; }
.detail-footer .brand { color: var(--text-2); font-size: 0.7rem; }
.detail-footer .brand strong { color: var(--green); }
.detail-footer .beian, .detail-footer .beian a { color: var(--text-3); font-size: 0.62rem; }
.detail-footer .beian a:hover { color: var(--green); }
.pixel-blocks { display: none; }
.detail-toast { position: fixed; right: 20px; bottom: 20px; z-index: 1000; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface-2); color: var(--text); box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); font-size: 0.72rem; transition: opacity 160ms ease, transform 160ms ease; }
.detail-toast.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; } }
@media (max-width: 920px) {
  .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-content-grid { grid-template-columns: 1fr; }
  .related-section { position: static; }
  .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 660px) {
  .detail-nav-inner, .detail-container, .back-section { width: min(calc(100% - 28px), var(--max-width)); }
  .detail-nav-inner { gap: 14px; }
  .detail-brand-copy, .breadcrumb li:not(:last-child), .breadcrumb .sep { display: none; }
  .breadcrumb ol { flex: 1; }
  .detail-container { padding-top: 24px; }
  .hero-top { min-height: 0; grid-template-columns: 1fr; gap: 22px; padding: 28px 22px; }
  .hero-logo { width: 72px; height: 72px; }
  .hero-logo img { width: 44px; height: 44px; }
  .hero-info h1 { font-size: 2.05rem; }
  .info-grid { grid-template-columns: 1fr; }
  .info-item { min-height: 78px; }
  .content-card { padding: 24px 20px; }
  .content-card p { font-size: 0.8rem; }
  .related-grid { grid-template-columns: 1fr; }
}
