:root {
    --bg: #0e0d0b;
    --bg-soft: #15130f;
    --surface: #1c1914;
    --surface-2: #231f19;
    --surface-3: #2b251d;
    --border: rgba(198, 154, 85, .25);
    --border-strong: rgba(222, 193, 138, .46);
    --text: #eee4d3;
    --muted: #b8ac9a;
    --faint: #776b5b;
    --primary: #a63c2d;
    --primary-hover: #c04b37;
    --primary-soft: rgba(166, 60, 45, .15);
    --gold: #c69a55;
    --gold-light: #dec18a;
    --amber: #c69a55;
    --success: #5f8b70;
    --hong: #3f8b7b;
    --hong-light: #8bc8b7;
    --hong-soft: rgba(63, 139, 123, .14);
    --danger: #b64c3c;
    --radius-sm: 3px;
    --radius: 6px;
    --radius-lg: 8px;
    --shadow: 0 24px 70px rgba(0, 0, 0, .38);
    --font: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
    --serif: "STKaiti", "KaiTi", "FangSong", "Noto Serif SC", serif;
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body { font-family: var(--font) !important; background-color: var(--bg) !important; color: var(--text) !important; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }
::selection { background: rgba(166, 60, 45, .55); color: #fff8e9; }

.site-header {
    width: min(1180px, calc(100% - 48px)); height: 76px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border); position: relative; z-index: 5;
}
.site-header::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 84px; height: 3px; background: var(--primary); }
.site-brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font: 700 1.08rem var(--serif); letter-spacing: .12em; }
.site-brand-mark { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 42px; filter: drop-shadow(0 8px 16px rgba(91, 27, 19, .35)); }
.site-brand-mark img, .sidebar-brand-mark img, .login-brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.site-nav { display: flex; align-items: center; gap: 2px; }
.site-nav a { position: relative; color: var(--muted); text-decoration: none; font-size: .84rem; padding: 10px 13px; transition: color .18s ease; }
.site-nav a::after { content: ""; position: absolute; left: 13px; right: 13px; bottom: 5px; height: 1px; transform: scaleX(0); background: var(--gold); transition: transform .18s ease; }
.site-nav a:hover, .site-nav a.active { color: var(--text); }
.site-nav a:hover::after, .site-nav a.active::after { transform: scaleX(1); }
.site-nav .nav-primary { color: #fff7e9; background: var(--primary); border: 1px solid rgba(231, 197, 138, .35); margin-left: 8px; padding: 9px 16px; }
.site-nav .nav-primary::after { display: none; }
.site-nav .nav-primary:hover { background: var(--primary-hover); }

.public-home, .public-buy, .admin-login {
    background-image: linear-gradient(180deg, rgba(14,13,11,.2), #0e0d0b 78%), url("../wuxia-landscape.svg") !important;
    background-position: center top, center top !important; background-size: cover, max(1280px, 100vw) auto !important; background-repeat: no-repeat !important;
}
.public-home { display: block !important; min-height: 100vh; padding: 0 0 38px !important; }
.public-home .container { width: min(1120px, calc(100% - 48px)) !important; max-width: none !important; margin: 0 auto; }
.portal-intro { min-height: 430px; display: grid; grid-template-columns: minmax(0, 1fr) 270px; align-items: end; gap: 64px; padding: 92px 0 56px; }
.hero-kicker { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 18px; color: var(--gold-light); font: 700 .75rem var(--serif); letter-spacing: .3em; }
.hero-kicker::before { content: ""; width: 38px; height: 1px; background: var(--primary); }
.portal-intro h1, .buy-context h1 { margin: 0; color: var(--text); font-family: var(--serif); font-weight: 700; text-shadow: 0 4px 24px #000; }
.portal-intro h1 { max-width: 720px; font-size: clamp(2.7rem, 5vw, 4.4rem); line-height: 1.08; letter-spacing: .06em; }
.portal-intro p { max-width: 650px; margin-top: 20px; color: var(--muted); font-size: 1rem; line-height: 1.9; }
.portal-intro-meta { padding: 6px 0 4px 24px; border-left: 1px solid var(--border-strong); color: var(--muted); font-size: .82rem; line-height: 1.75; }
.portal-intro-meta strong { display: block; color: var(--gold-light); font: 700 .98rem var(--serif); letter-spacing: .12em; margin: 9px 0 1px; }
.portal-intro-meta strong:first-child { margin-top: 0; }

.public-home .card, .public-buy .card, .admin-login .login-card, .admin-login .card {
    position: relative; background: rgba(28, 25, 20, .94) !important; border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important; box-shadow: var(--shadow) !important;
}
.public-home .card::before, .public-buy .card::before, .admin-login .login-card::before {
    content: ""; position: absolute; pointer-events: none; inset: 7px; border: 1px solid rgba(198,154,85,.08); border-radius: 3px;
}
.public-home .card:first-of-type { padding: 32px !important; }
.public-home .logo { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; text-align: left !important; margin-bottom: 30px !important; }
.public-home .logo h1, .public-home .logo p { grid-column: 1 / -1; }
.public-home .logo h1 { color: var(--text); font-family: var(--serif); letter-spacing: .08em; }
.inline-brand-mark { width: 32px; height: 32px; display: inline-block; vertical-align: middle; margin-right: 10px; }
.public-home .logo p { color: var(--muted) !important; margin: -3px 0 10px !important; font-size: .82rem; }
.public-home .logo > a {
    min-height: 62px; margin: 0 !important; padding: 11px 15px !important; display: flex !important; align-items: center; justify-content: center; gap: 12px;
    border: 1px solid var(--border) !important; border-radius: var(--radius-sm) !important; background: var(--surface-2) !important;
    color: var(--text) !important; text-decoration: none; text-align: left !important; transform: none !important; transition: border-color .18s, background .18s !important;
}
.public-home .logo > a:first-of-type { background: var(--primary) !important; border-color: var(--gold) !important; }
.public-home .logo > a:hover { border-color: var(--gold-light) !important; background: var(--surface-3) !important; }
.public-home .logo > a:first-of-type:hover { background: var(--primary-hover) !important; }
.public-home .logo > a b { display: block; font: 700 .94rem var(--serif); letter-spacing: .08em; }
.public-home .logo > a small { display: block; margin-top: 3px; color: var(--muted); font-size: .68rem; font-weight: 400; }
.public-home .logo > a:first-of-type small { color: #ebc9af; }
.action-seal, .title-seal, .price-seal, .folder-emblem { display: inline-grid; place-items: center; flex: 0 0 auto; font-family: var(--serif); }
.action-seal { width: 30px; height: 30px; border: 1px solid var(--gold); color: var(--gold-light); font-weight: 800; transform: rotate(-3deg); }
.public-home .logo > a:first-of-type .action-seal { border-color: #f2dcc0; color: #fff8eb; }

.lookup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.lookup-panel { min-width: 0; padding: 22px; background: rgba(14, 13, 11, .55); border: 1px solid var(--border); border-radius: var(--radius); }
.lookup-panel-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; color: var(--gold-light); font: 700 .92rem var(--serif); letter-spacing: .05em; }
.lookup-panel-title span { color: var(--faint); font: 400 .7rem var(--font); letter-spacing: 0; }
.public-home .input-group input, .downloads-toolbar input, .public-buy .input-group textarea, .public-buy .input-group input[type="text"], .admin-app input, .admin-app textarea, .admin-app select {
    background: #100f0c !important; border: 1px solid var(--border) !important; border-radius: var(--radius-sm) !important; color: var(--text) !important;
}
.public-home .input-group input { font-family: var(--font) !important; letter-spacing: 0 !important; font-size: .87rem !important; }
.public-home .input-group input:focus, .downloads-toolbar input:focus, .public-buy input:focus, .public-buy textarea:focus { border-color: var(--gold) !important; box-shadow: 0 0 0 3px rgba(198,154,85,.09) !important; }
.public-home .btn, .public-buy .btn, .admin-login button { min-height: 42px; border-radius: var(--radius-sm) !important; }
.public-home .btn-primary, .public-buy .btn-primary, .admin-login button { background: var(--primary) !important; border-color: var(--gold) !important; color: #fff8e9 !important; box-shadow: none !important; }
.public-home #btnUnlock { background: var(--success) !important; border-color: #87a88f !important; }
.public-home .btn-primary:hover:not(:disabled), .public-buy .btn-primary:hover:not(:disabled), .admin-login button:hover { background: var(--primary-hover) !important; }

.public-home .files-section { margin-top: 22px !important; padding: 28px !important; box-shadow: none !important; }
.public-home .files-section .title { color: var(--gold-light) !important; font: 700 1.12rem var(--serif) !important; letter-spacing: .08em; border: 0 !important; margin-bottom: 17px !important; }
.downloads-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 10px; margin-bottom: 16px; }
.downloads-toolbar input { min-width: 0; width: 100%; padding: 11px 13px; outline: 0; }
.download-state { display: flex; align-items: center; color: var(--muted); font-size: .8rem; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.download-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); margin-right: 8px; }
.download-state.unlocked { color: #a8c8ae; border-color: rgba(95,139,112,.55); }
.download-state.unlocked::before { background: var(--success); }
.public-home .folder-label { padding: 14px 4px 11px !important; color: var(--gold-light) !important; border-top: 1px solid var(--border) !important; }
.folder-emblem { width: 21px; height: 21px; margin-right: 8px; color: var(--gold-light); border: 1px solid var(--border-strong); font-size: .7rem; }
.folder-ext-link { margin-left: .6rem; color: var(--gold) !important; font-size: .7rem; text-decoration: none; }
.file-glyph { width: 22px; height: 22px; margin-right: 7px; display: inline-grid; place-items: center; border: 1px solid var(--border); color: var(--gold-light); font: 700 .68rem var(--serif); }
.query-pending { color: var(--muted); }
.public-home .file-item { padding: 13px 14px !important; background: rgba(14,13,11,.6) !important; border: 0 !important; border-bottom: 1px solid rgba(198,154,85,.15) !important; border-radius: 0 !important; margin: 0 !important; }
.public-home .file-item .name { font-size: .83rem !important; }
.public-home .file-item .meta { color: var(--faint) !important; }
.public-home .file-item .dl-btn { padding: 8px 12px !important; border-radius: 2px !important; background: var(--primary) !important; color: #fff8e9 !important; }
.public-home .file-item span.dl-btn { background: #3b352c !important; color: var(--muted) !important; }
.public-home .footer { padding: 25px 0 0; color: var(--faint) !important; }
.public-home .footer a { color: var(--muted) !important; text-decoration: none !important; }

/* Home: clear dual-product architecture */
.home-shell { width: min(1280px, calc(100% - 48px)); margin: 0 auto; }
.dual-hero { min-height: 650px; padding: 92px 0 44px; display: grid; align-content: end; }
.dual-hero-copy { text-align: center; margin-bottom: 46px; }
.dual-hero-copy h1 { margin: 0; color: var(--text); font: 800 clamp(3rem, 5.4vw, 5.3rem)/1.04 var(--serif); letter-spacing: .08em; text-shadow: 0 5px 28px #000; }
.dual-hero-copy p { margin: 18px auto 0; color: #c7b99f; font: 400 1rem/1.8 var(--serif); letter-spacing: .12em; }
.product-gates { position: relative; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--border-strong); border-bottom: 1px solid var(--border-strong); }
.product-gates::after { content: "江湖"; position: absolute; z-index: 2; left: 50%; top: 50%; translate: -50% -50%; width: 66px; height: 66px; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50%; background: #100f0c; color: var(--gold-light); font: 800 .92rem var(--serif); letter-spacing: .15em; box-shadow: 0 0 0 8px rgba(14,13,11,.82); }
.product-gate { position: relative; min-height: 270px; display: grid; grid-template-columns: 84px 1fr; gap: 28px; align-items: center; padding: 38px 72px; overflow: hidden; isolation: isolate; }
.product-gate + .product-gate { border-left: 1px solid var(--border-strong); }
.product-gate::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .68; transition: opacity .22s ease, transform .22s ease; }
.product-gate:hover::before { opacity: .95; transform: scale(1.015); }
.product-gate-zf::before { background: radial-gradient(circle at 12% 100%, rgba(166,60,45,.42), transparent 58%), linear-gradient(110deg, rgba(166,60,45,.14), transparent 65%); }
.product-gate-hong::before { background: radial-gradient(circle at 88% 100%, rgba(63,139,123,.4), transparent 58%), linear-gradient(250deg, rgba(63,139,123,.14), transparent 65%); }
.gate-seal { width: 76px; height: 76px; display: grid; place-items: center; border: 2px solid currentColor; font: 900 2.3rem var(--serif); transform: rotate(-2deg); box-shadow: inset 0 0 0 5px rgba(14,13,11,.35); }
.product-gate-zf .gate-seal, .product-gate-zf h2 { color: #d35a48; }
.product-gate-hong .gate-seal, .product-gate-hong h2 { color: var(--hong-light); }
.gate-copy h2 { margin: 0; font: 800 clamp(2rem, 3vw, 3.1rem)/1.1 var(--serif); letter-spacing: .12em; }
.gate-copy > p { margin: 11px 0 25px; color: #c7b99f; font: 600 .86rem var(--serif); letter-spacing: .1em; }
.gate-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.gate-actions a { min-height: 46px; padding: 0 19px; display: inline-flex; align-items: center; justify-content: center; color: var(--text); text-decoration: none; border: 1px solid var(--border-strong); font: 700 .8rem var(--serif); letter-spacing: .08em; transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.gate-actions a:hover { transform: translateY(-2px); border-color: var(--gold-light); }
.product-gate-zf .gate-primary { background: var(--primary); border-color: #dca06b; color: #fff8eb; }
.product-gate-hong .gate-primary { background: #286c60; border-color: var(--hong-light); color: #f1fff9; }
.product-gate-hong .gate-secondary { border-color: rgba(139,200,183,.42); }

.service-rail { margin: 0 24px; min-height: 112px; display: grid; grid-template-columns: repeat(3, 1fr); background: #cdb991; color: #271d13; border: 1px solid #ead6a9; box-shadow: 0 18px 52px rgba(0,0,0,.32); }
.service-rail a { position: relative; padding: 22px 30px; display: flex; align-items: center; gap: 17px; color: inherit; text-decoration: none; }
.service-rail a + a::before { content: ""; position: absolute; left: 0; top: 24px; bottom: 24px; width: 1px; background: rgba(64,43,24,.35); }
.service-index { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border: 1px solid rgba(64,43,24,.65); font: 800 .8rem var(--serif); transform: rotate(-2deg); }
.service-rail strong, .service-rail small { display: block; }
.service-rail strong { font: 800 1rem var(--serif); letter-spacing: .1em; }
.service-rail small { margin-top: 5px; color: #675741; font-size: .7rem; }

.account-tools { margin: 64px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.account-tool { padding: 25px; background: rgba(20,18,14,.86); border: 1px solid var(--border); }
.tool-heading { margin-bottom: 18px; display: flex; align-items: center; gap: 14px; }
.tool-heading > span { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--border-strong); color: var(--gold-light); font: 800 .86rem var(--serif); }
.tool-heading h2 { color: var(--text); font: 800 1.02rem var(--serif); letter-spacing: .08em; }
.tool-heading p { margin-top: 4px; color: var(--faint); font-size: .7rem; }
.account-tool .input-group { margin-bottom: 0; }
.account-tool .btn { flex: 0 0 auto; min-width: 84px; }
.tool-result { margin-top: 14px; font-size: .82rem; line-height: 1.65; }

.download-center { margin-top: 92px; scroll-margin-top: 24px; }
.download-center-title { margin-bottom: 30px; text-align: center; }
.download-center-title h2 { color: var(--gold-light); font: 800 clamp(2rem, 4vw, 3.5rem)/1.1 var(--serif); letter-spacing: .12em; }
.download-center-title p { margin-top: 11px; color: var(--muted); font: .88rem/1.7 var(--serif); letter-spacing: .1em; }
.download-layout { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(360px, 1fr); gap: 22px; align-items: start; }
.download-product { position: relative; min-width: 0; padding: 30px; background: rgba(18,16,12,.94); border: 1px solid var(--border-strong); scroll-margin-top: 22px; }
.download-product::before, .download-product::after { content: ""; position: absolute; width: 24px; height: 24px; pointer-events: none; }
.download-product::before { left: 8px; top: 8px; border-left: 1px solid currentColor; border-top: 1px solid currentColor; }
.download-product::after { right: 8px; bottom: 8px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; }
.download-zf { color: #c75a49; }
.download-hong { color: var(--hong-light); position: sticky; top: 22px; background: rgba(8,28,25,.94); border-color: rgba(139,200,183,.52); }
.download-product-head { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 24px; }
.product-download-seal { width: 54px; height: 54px; flex: 0 0 54px; display: grid; place-items: center; border: 2px solid currentColor; font: 900 1.55rem var(--serif); }
.download-product-head h3 { color: currentColor; font: 800 1.32rem var(--serif); letter-spacing: .08em; }
.download-product-head p { margin-top: 7px; color: var(--muted); font-size: .76rem; line-height: 1.7; }
.download-auth-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid rgba(198,154,85,.2); }
.download-auth-row input { min-width: 0; width: 100%; padding: 12px 14px; background: #0d0c0a; border: 1px solid rgba(199,90,73,.5); color: var(--text); outline: 0; }
.download-auth-row input:focus { border-color: #db8b78; box-shadow: 0 0 0 3px rgba(166,60,45,.12); }
.public-home .download-zf #btnUnlock { background: var(--primary) !important; border-color: #dca06b !important; }
.public-home .download-zf #btnUnlock:hover:not(:disabled) { background: var(--primary-hover) !important; }
.download-zf .downloads-toolbar { margin-top: 18px; grid-template-columns: minmax(190px,1fr) auto; }
.download-zf .downloads-toolbar input { border-color: rgba(199,90,73,.34) !important; }
.download-zf #filesList { max-height: 690px; overflow-y: auto; padding-right: 5px; scrollbar-color: rgba(198,154,85,.45) transparent; }
.download-zf .folder-label { padding: 15px 5px 12px !important; color: var(--gold-light) !important; border-top: 1px solid var(--border) !important; }
.download-zf .file-item { padding: 13px 12px !important; background: rgba(7,7,6,.45) !important; border: 0 !important; border-bottom: 1px solid rgba(198,154,85,.13) !important; border-radius: 0 !important; margin: 0 !important; color: var(--text); }
.download-zf .file-item .name { color: var(--text); font-size: .82rem; }
.download-zf .file-item .meta { color: var(--faint); }
.download-zf .file-item .dl-btn { border-radius: 0 !important; background: var(--primary) !important; color: #fff8e9 !important; }
.download-zf .file-item span.dl-btn { background: #372f27 !important; color: var(--muted) !important; }

.hong-download-button, .hong-buy-button { width: 100%; min-height: 60px; display: flex; align-items: center; justify-content: center; gap: 12px; color: #effff8; text-decoration: none; border: 1px solid var(--hong-light); font: 800 .95rem var(--serif); letter-spacing: .08em; transition: background .18s ease, transform .18s ease; }
.hong-download-button { margin: 34px 0; background: #286c60; box-shadow: inset 0 0 0 5px rgba(7,32,28,.42); }
.hong-download-button:hover, .hong-buy-button:hover { background: #347f71; transform: translateY(-2px); }
.hong-download-button.is-disabled { opacity: .45; pointer-events: none; }
.hong-password-row { min-height: 78px; margin-bottom: 24px; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 16px; border-top: 1px solid rgba(139,200,183,.34); border-bottom: 1px solid rgba(139,200,183,.34); color: #c5b795; }
.hong-password-row span { font: 700 .8rem var(--serif); }
.hong-password-row strong { color: var(--hong-light); font: 800 1.8rem var(--serif); letter-spacing: .18em; text-align: center; }
.hong-password-row button { min-height: 36px; padding: 0 13px; border: 1px solid rgba(139,200,183,.65); background: transparent; color: var(--hong-light); cursor: pointer; }
.hong-buy-button { min-height: 52px; background: transparent; border-color: rgba(139,200,183,.5); }
.hong-warning { margin: 19px 0 2px; color: #ce8778; font-size: .72rem; line-height: 1.6; text-align: center; }
.hong-warning::before { content: "!"; width: 18px; height: 18px; margin-right: 7px; display: inline-grid; place-items: center; border: 1px solid currentColor; font-weight: 800; }
.home-shell > .footer { padding: 40px 0 0; color: var(--faint); }

@media (max-width: 1000px) {
    .product-gate { padding-inline: 38px; }
    .product-gates::after { display: none; }
    .download-layout { grid-template-columns: 1fr; }
    .download-hong { position: static; }
}

@media (max-width: 760px) {
    .home-shell { width: min(100% - 24px, 1280px); }
    .dual-hero { min-height: auto; padding: 70px 0 24px; }
    .dual-hero-copy { text-align: left; margin-bottom: 28px; }
    .dual-hero-copy h1 { font-size: clamp(2.65rem, 13vw, 4.2rem); }
    .dual-hero-copy p { margin-left: 0; font-size: .84rem; letter-spacing: .06em; }
    .product-gates, .account-tools, .service-rail { grid-template-columns: 1fr; }
    .product-gate { min-height: 238px; padding: 30px 22px; grid-template-columns: 58px 1fr; gap: 18px; }
    .product-gate + .product-gate { border-left: 0; border-top: 1px solid var(--border-strong); }
    .gate-seal { width: 56px; height: 56px; font-size: 1.65rem; }
    .gate-copy h2 { font-size: 2rem; }
    .gate-actions a { width: 100%; }
    .service-rail { margin: 0; }
    .service-rail a { padding: 18px 22px; }
    .service-rail a + a::before { top: 0; bottom: auto; left: 22px; right: 22px; width: auto; height: 1px; }
    .account-tools { margin-top: 42px; }
    .download-center { margin-top: 66px; }
    .download-center-title { text-align: left; }
    .download-product { padding: 22px 18px; }
    .download-auth-row, .download-zf .downloads-toolbar { grid-template-columns: 1fr; }
    .download-auth-row .btn { width: 100%; }
    .download-state { min-height: 40px; }
    .hong-password-row { grid-template-columns: 1fr auto; }
    .hong-password-row span { grid-column: 1 / -1; }
}

/* Purchase */
.public-buy { display: block !important; min-height: 100vh; padding: 0 0 42px !important; }
.buy-layout { width: min(1080px, calc(100% - 48px)); margin: 0 auto; padding: 70px 0; display: grid; grid-template-columns: minmax(0, 1fr) 470px; gap: 88px; align-items: start; }
.buy-context { position: sticky; top: 110px; padding-top: 34px; }
.buy-context h1 { font-size: clamp(3rem, 5vw, 4.8rem); line-height: 1.06; letter-spacing: .08em; }
.buy-context > p { margin-top: 20px; color: var(--muted); line-height: 1.9; max-width: 500px; }
.buy-assurance { margin-top: 40px; display: grid; gap: 18px; }
.buy-assurance div { display: grid; grid-template-columns: 38px 1fr; gap: 14px; align-items: start; color: var(--muted); font-size: .8rem; line-height: 1.6; }
.buy-assurance strong { color: var(--text); display: block; font-family: var(--serif); font-size: .92rem; letter-spacing: .08em; margin-bottom: 2px; }
.assurance-icon { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--border-strong); color: var(--gold-light); font: 700 .78rem var(--serif); transform: rotate(-2deg); }
.public-buy .container { width: 100% !important; max-width: none !important; }
.public-buy .card { padding: 30px !important; }
.public-buy .logo { text-align: left !important; }
.public-buy .logo h1 { color: var(--text); font-family: var(--serif); letter-spacing: .06em; }
.public-buy .logo p { color: var(--muted) !important; }
.title-seal { width: 28px; height: 28px; margin-right: 9px; color: var(--gold-light); border: 1px solid var(--gold); font-size: .78rem; vertical-align: middle; }
.product-tabs > div, .mode-tabs > div { min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px; background: #12100d !important; border-color: var(--border) !important; border-radius: var(--radius-sm) !important; color: var(--muted) !important; }
.product-tabs > div:hover, .mode-tabs > div:hover { border-color: var(--gold) !important; color: var(--text) !important; }
.product-tabs > div.is-active, .mode-tabs > div.is-active { color: var(--gold-light) !important; border-color: var(--gold) !important; background: var(--primary-soft) !important; }
.product-tabs span { width: 23px; height: 23px; display: inline-grid; place-items: center; border: 1px solid var(--border-strong); font: 700 .7rem var(--serif); }
.field-label { color: var(--gold-light) !important; font-family: var(--serif); letter-spacing: .06em; }
.public-buy .price-item { background: rgba(14,13,11,.58) !important; border-color: var(--border) !important; border-radius: var(--radius-sm) !important; }
.public-buy .price-item.selected { border-color: var(--gold) !important; background: var(--primary-soft) !important; }
.public-buy .price-item:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.price-seal { width: 24px; height: 24px; margin-right: 5px; border: 1px solid var(--border-strong); color: var(--gold-light); font-size: .68rem; }
.public-buy .steps span.active { color: var(--gold-light) !important; border-bottom-color: var(--primary) !important; }
.public-buy .amount-display, .public-buy .price { color: var(--gold-light) !important; }
.public-buy .back-link a, .public-buy a { color: var(--gold) !important; }
.waiting-seal { width: 34px; height: 34px; margin: 0 auto .6rem; display: grid; place-items: center; border: 1px solid var(--gold); color: var(--gold-light); font: 700 .9rem var(--serif); }

/* Admin */
.admin-app { min-height: 100vh; background: #100f0c !important; }
.admin-app .sidebar { position: fixed !important; inset: 0 auto 0 0 !important; width: 242px !important; padding: 22px 14px !important; display: flex; flex-direction: column; background: #17140f !important; border-right: 1px solid var(--border) !important; z-index: 20; }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 2px 10px 24px; color: var(--text); }
.sidebar-brand-mark { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 40px; }
.sidebar-brand strong { display: block; font: 700 .95rem var(--serif); letter-spacing: .08em; }
.sidebar-brand span { display: block; color: var(--faint); font-size: .65rem; margin-top: 3px; }
.sidebar-nav { display: grid; gap: 3px; }
.admin-app .sidebar h2 { display: none; }
.admin-app .sidebar a { display: flex !important; align-items: center; gap: 11px; min-height: 43px; margin: 0 !important; padding: 9px 11px !important; border-radius: 2px !important; color: var(--muted) !important; font-size: .8rem !important; text-decoration: none; transition: .16s ease; }
.admin-app .sidebar a:hover { color: var(--text) !important; background: rgba(198,154,85,.05) !important; }
.admin-app .sidebar a.active { color: var(--text) !important; background: var(--primary-soft) !important; box-shadow: inset 2px 0 var(--primary); }
.sidebar-nav-icon { width: 24px; height: 24px; display: inline-grid; place-items: center; border: 1px solid rgba(198,154,85,.28); color: var(--faint); font: 700 .67rem var(--serif); }
.admin-app .sidebar a.active .sidebar-nav-icon { color: var(--gold-light); border-color: var(--gold); }
.sidebar-footer { margin-top: auto; padding-top: 15px; border-top: 1px solid var(--border); display: grid; gap: 3px; }
.admin-app .main { margin-left: 242px !important; width: auto !important; max-width: none !important; padding: 36px 44px 60px !important; }
.admin-app .header { min-height: 46px; margin-bottom: 26px !important; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.admin-app .header h1 { color: var(--text) !important; font: 700 1.65rem var(--serif) !important; letter-spacing: .08em; }
.admin-app .header a { color: var(--muted) !important; text-decoration: none; }
.admin-app .stat-row { gap: 12px !important; margin-bottom: 12px !important; }
.admin-app .stat-card, .admin-app .type-card, .admin-app .section, .admin-app .chart-container, .admin-app .form-card, .admin-app .settings-card, .admin-app .table-wrap { background: var(--surface) !important; border-color: var(--border) !important; border-radius: var(--radius) !important; }
.admin-app .stat-card { padding: 17px 18px !important; min-height: 88px; }
.admin-app .stat-card .num { font-size: 1.45rem !important; color: var(--gold-light); }
.admin-app .stat-card .label { font-size: .72rem !important; color: var(--muted) !important; margin-top: 8px !important; }
.admin-app .type-card { padding: 12px !important; }
.admin-app .chart-container, .admin-app .section { padding: 22px !important; margin-top: 16px !important; }
.admin-app .section h2, .admin-app .chart-container h3 { font: 700 .98rem var(--serif) !important; color: var(--text) !important; letter-spacing: .06em; margin-bottom: 16px !important; }
.admin-app table { background: transparent !important; border: 0 !important; border-radius: 0 !important; font-size: .74rem !important; }
.admin-app th { padding: 12px 10px !important; color: var(--muted) !important; background: rgba(198,154,85,.035) !important; border-bottom: 1px solid var(--border) !important; font-weight: 600 !important; text-align: left; white-space: nowrap; }
.admin-app td { padding: 11px 10px !important; border-bottom: 1px solid rgba(198,154,85,.13) !important; color: #d0c4b1 !important; }
.admin-app tbody tr:hover td { background: rgba(198,154,85,.025); }
.admin-app button, .admin-app .gen-btn, .admin-app .btn-p { border-radius: 2px !important; }
.admin-app .modal { background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: var(--radius) !important; box-shadow: var(--shadow); }
.order-badge { margin-left: auto !important; }
.inventory-alert { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; padding: 14px 16px; background: rgba(198,154,85,.08); border: 1px solid rgba(198,154,85,.28); border-radius: 3px; color: var(--gold-light); font-size: .78rem; }

/* Admin operations command center */
.ops-dashboard { background: #090d0f !important; }
.ops-dashboard .sidebar { background: #0d1215 !important; }
.ops-main { max-width: 1680px !important; margin-right: auto; }
.ops-header { min-height: 64px; margin-bottom: 18px; padding-bottom: 17px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--gold); }
.ops-header h1 { margin: 0; color: var(--gold-light); font: 800 1.68rem var(--serif); letter-spacing: .12em; }
.ops-header p { margin-top: 5px; color: var(--faint); font-size: .72rem; }
.ops-header-actions { display: flex; align-items: center; gap: 12px; }
.ops-header-actions time { margin-right: 10px; color: #cdbd9e; font: .78rem var(--serif); letter-spacing: .04em; }
.ops-button { min-height: 38px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--gold) !important; background: rgba(198,154,85,.06); color: var(--gold-light); text-decoration: none; cursor: pointer; font: 700 .74rem var(--serif) !important; letter-spacing: .06em; }
.ops-button span { width: 21px; height: 21px; display: inline-grid; place-items: center; border: 1px solid currentColor; font-size: .62rem; }
.ops-button:hover { background: rgba(198,154,85,.13); }
.ops-button-quiet { border-color: rgba(198,154,85,.42) !important; color: var(--muted); }

.ops-metric-rail { display: grid; grid-template-columns: 1.48fr repeat(4, minmax(0, 1fr)); border: 1px solid var(--border-strong); background: #0c1215; box-shadow: inset 0 1px rgba(226,192,120,.03); }
.ops-metric { min-width: 0; min-height: 126px; padding: 22px 23px; display: flex; align-items: center; gap: 17px; position: relative; }
.ops-metric + .ops-metric::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 1px; background: var(--border); }
.ops-metric-seal { width: 52px; height: 52px; flex: 0 0 52px; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold-light); font: 800 1.1rem var(--serif); }
.ops-metric p { margin: 0 0 7px; color: #d7c9ae; font: 700 .78rem var(--serif); letter-spacing: .04em; }
.ops-metric strong { display: block; color: var(--gold-light); font: 800 1.72rem var(--serif); letter-spacing: .02em; white-space: nowrap; }
.ops-metric small { display: block; margin-top: 8px; color: var(--faint); font: .64rem var(--font); line-height: 1.45; }
.ops-metric-primary { padding-left: 26px; background: linear-gradient(90deg, rgba(198,154,85,.06), transparent 88%); }
.ops-metric-primary strong { font-size: 2.12rem; }
.ops-metric-primary small { color: #bfae90; }
.ops-metric-cost strong { color: #83b85a; }
.ops-metric-today strong { font-size: 1.55rem; }
.ops-metric.is-alert strong, .ops-metric.is-alert .ops-metric-seal { color: #d26350; border-color: #b84f3d; }

.ops-lifetime-rail { margin-top: 10px; min-height: 68px; display: grid; grid-template-columns: 1.42fr repeat(4, minmax(0, 1fr)); align-items: stretch; border: 1px solid rgba(198,154,85,.24); background: linear-gradient(90deg, rgba(198,154,85,.045), #0b1013 34%); }
.ops-lifetime-heading, .ops-lifetime-rail dl { min-width: 0; margin: 0; padding: 12px 18px; display: flex; align-items: center; gap: 12px; position: relative; }
.ops-lifetime-rail dl::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 1px; background: rgba(198,154,85,.17); }
.ops-lifetime-heading > span { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border: 1px solid rgba(198,154,85,.62); color: var(--gold-light); font: 800 .78rem var(--serif); transform: rotate(-2deg); }
.ops-lifetime-heading strong { display: block; color: #d8c49e; font: 800 .78rem var(--serif); letter-spacing: .08em; }
.ops-lifetime-heading small { display: block; margin-top: 4px; color: var(--faint); font-size: .6rem; }
.ops-lifetime-rail dt { color: var(--faint); font-size: .64rem; }
.ops-lifetime-rail dd { margin: 5px 0 0; color: #dfc99f; font: 800 1rem var(--serif); white-space: nowrap; }
.ops-lifetime-rail dl:nth-of-type(2) dd { color: var(--gold-light); }

.ops-alert-rail { margin-top: 12px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border-strong); background: #0c1215; }
.ops-alert-rail a { min-height: 82px; padding: 15px 21px; display: grid; grid-template-columns: 42px 1fr auto; gap: 13px; align-items: center; position: relative; color: var(--text); text-decoration: none; }
.ops-alert-rail a + a::before { content: ""; position: absolute; left: 0; top: 13px; bottom: 13px; width: 1px; background: var(--border); }
.ops-alert-rail a:hover { background: rgba(198,154,85,.045); }
.ops-alert-icon { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid currentColor; font: 800 .75rem var(--serif); transform: rotate(-2deg); }
.ops-alert-icon.danger { color: #d15242; }
.ops-alert-icon.warning { color: #d58a3f; }
.ops-alert-icon.safe { color: #79a44b; }
.ops-alert-rail b { display: block; color: #cdbfa7; font: 700 .75rem var(--serif); }
.ops-alert-rail strong { display: block; margin-top: 4px; color: var(--gold-light); font: 800 1.16rem var(--serif); }
.ops-alert-rail i { color: var(--gold); font: 400 1.35rem var(--serif); }
.ops-inventory-note { margin-top: 10px; min-height: 42px; padding: 9px 13px; display: flex; align-items: center; gap: 14px; border-left: 2px solid var(--primary); background: rgba(166,60,45,.08); color: var(--muted); font-size: .7rem; }
.ops-inventory-note strong { color: #dc8b79; }
.ops-inventory-note span { flex: 1; }
.ops-inventory-note i { color: var(--faint); font-style: normal; }
.ops-inventory-note a { color: var(--gold-light); text-decoration: none; }

.ops-primary-grid, .ops-secondary-grid { margin-top: 12px; display: grid; gap: 12px; }
.ops-primary-grid { grid-template-columns: minmax(0, 1.36fr) minmax(480px, 1fr); }
.ops-secondary-grid { grid-template-columns: minmax(0, 1.35fr) minmax(420px, 1fr); }
.ops-panel { min-width: 0; background: #0c1215; border: 1px solid var(--border-strong); }
.ops-panel-title { min-height: 51px; padding: 0 17px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--border); }
.ops-panel-title h2 { margin: 0; color: var(--gold-light); font: 800 .94rem var(--serif); letter-spacing: .07em; }
.ops-panel-title > div:first-child small { display: block; margin-top: 4px; color: var(--faint); font-size: .62rem; }
.ops-panel-title small, .ops-panel-title > div > span { color: var(--faint); font-size: .66rem; }
.ops-panel-title a { color: var(--gold); text-decoration: none; font-size: .68rem; }
.ops-chart-legend { display: flex; gap: 18px; color: var(--muted); font-size: .66rem; }
.ops-chart-legend span::before { content: ""; width: 18px; height: 2px; margin-right: 6px; display: inline-block; vertical-align: middle; background: currentColor; }
.ops-chart-legend .zf { color: #d15242; }
.ops-chart-legend .hong { color: #78a948; }
.ops-chart-legend .net { color: var(--gold-light); }
.ops-chart-wrap { height: 292px; padding: 18px 16px 10px 8px; position: relative; }
.ops-chart-wrap svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart-grid { stroke: rgba(198,154,85,.15); stroke-width: 1; stroke-dasharray: 3 4; }
.chart-label { fill: #766b5b; font: 10px var(--font); }
.chart-line { fill: none; stroke-width: 2.2; vector-effect: non-scaling-stroke; }
.chart-line.zf { stroke: #d15242; }
.chart-line.hong { stroke: #78a948; }
.chart-line.net { stroke: var(--gold-light); }
.chart-hit-area { fill: transparent; cursor: crosshair; }
.chart-hover-line { stroke: rgba(226,192,120,.5); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; pointer-events: none; vector-effect: non-scaling-stroke; }
.chart-hover-mark { stroke-width: 3; opacity: 0; pointer-events: none; vector-effect: non-scaling-stroke; }
.chart-hover-line.is-visible, .chart-hover-mark.is-visible { opacity: 1; }
.chart-hover-mark.zf { stroke: #f3a193; }
.chart-hover-mark.hong { stroke: #b6d68f; }
.chart-hover-mark.net { stroke: #fff0c5; }
.ops-chart-tooltip { width: 224px; padding: 11px 13px; position: absolute; z-index: 5; top: 11px; transform: translateX(-50%); border: 1px solid rgba(226,192,120,.6); background: rgba(8,13,15,.96); box-shadow: 0 8px 26px rgba(0,0,0,.38); pointer-events: none; }
.ops-chart-tooltip strong { display: block; margin-bottom: 7px; color: var(--gold-light); font: 800 .75rem var(--serif); letter-spacing: .05em; }
.ops-chart-tooltip dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 5px 12px; }
.ops-chart-tooltip dl div { min-width: 0; display: flex; justify-content: space-between; gap: 7px; }
.ops-chart-tooltip dl div:first-child { grid-column: 1 / -1; padding-bottom: 5px; margin-bottom: 1px; border-bottom: 1px solid rgba(198,154,85,.2); }
.ops-chart-tooltip dt { color: var(--faint); font-size: .59rem; }
.ops-chart-tooltip dd { margin: 0; color: #ddd0b8; font: 700 .62rem var(--serif); white-space: nowrap; }
.ops-chart-tooltip dl div:first-child dd { color: var(--gold-light); }

.ops-product-compare { min-height: 292px; display: grid; grid-template-columns: 1fr 1fr; }
.ops-product-column + .ops-product-column { border-left: 1px solid var(--border); }
.ops-product-column h3 { min-height: 49px; margin: 0; display: grid; place-items: center; border-bottom: 1px solid var(--border); font: 800 1rem var(--serif); letter-spacing: .08em; }
.ops-product-column.zhuifeng h3, .ops-product-column.zhuifeng dd { color: #d45543; }
.ops-product-column.hong h3, .ops-product-column.hong dd { color: #83b85a; }
.ops-product-column dl { margin: 0; padding: 0 13px; }
.ops-product-column dl div { min-height: 55px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid rgba(198,154,85,.16); }
.ops-product-column dt { color: #c8baa2; font-size: .7rem; }
.ops-product-column dd { margin: 0; font: 800 .98rem var(--serif); }
.ops-profit-table { min-width: 610px; }
.ops-dashboard .ops-profit-table th { padding-block: 13px !important; text-align: right; }
.ops-dashboard .ops-profit-table th:first-child,
.ops-dashboard .ops-profit-table td:first-child { text-align: left; }
.ops-dashboard .ops-profit-table td { height: 62px; text-align: right; font-size: .72rem; }
.ops-profit-table .profit-value { color: var(--gold-light) !important; font: 800 .88rem var(--serif); }
.ops-profit-table .profit-row.zhuifeng .profit-value { color: #d65d4b !important; }
.ops-profit-table .profit-row.hong .profit-value { color: #84b95a !important; }
.ops-profit-table .profit-value.is-negative { color: #d65d4b !important; }
.ops-profit-table .profit-total td { border-top: 1px solid rgba(198,154,85,.55) !important; color: #dfcda9 !important; font-weight: 800; }
.ops-cost-note { margin: 0; min-height: 44px; padding: 11px 14px; border-top: 1px solid var(--border); color: var(--faint); font-size: .62rem; line-height: 1.65; }

.ops-table-scroll { overflow-x: auto; }
.ops-table { min-width: 650px; width: 100%; border-collapse: collapse; }
.ops-dashboard .ops-table th { padding: 11px 13px !important; background: rgba(198,154,85,.035) !important; }
.ops-dashboard .ops-table td { padding: 10px 13px !important; font-size: .69rem; white-space: nowrap; }
.ops-dashboard .ops-table .mono { font-family: ui-monospace, Consolas, monospace; }
.ops-table .product-name.zhuifeng { color: #d65d4b !important; }
.ops-table .product-name.hong { color: #84b95a !important; }
.ops-table .wait-time, .ops-table .failure-action { color: #d99a45 !important; }
.ops-row-action { min-height: 28px; padding: 0 10px; display: inline-flex; align-items: center; border: 1px solid var(--gold); color: var(--gold-light); text-decoration: none; }
.ops-empty { height: 76px; text-align: center; color: var(--faint) !important; }
.ops-running { color: #79a44b; font-size: .68rem; }
.ops-running::before { content: ""; width: 6px; height: 6px; margin-right: 6px; display: inline-block; border-radius: 50%; background: currentColor; }
.ops-system-list { margin: 0; }
.ops-system-list > div { min-height: 52px; padding: 9px 13px; display: grid; grid-template-columns: 110px minmax(0, 1fr) 78px; gap: 12px; align-items: center; border-bottom: 1px solid rgba(198,154,85,.16); }
.ops-system-list dt { color: #c9baa2; font-size: .69rem; }
.ops-system-list dd { min-width: 0; margin: 0; color: #e0d2bb; font: .7rem ui-monospace, Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-system-list button, .ops-system-list a { min-height: 29px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(198,154,85,.65) !important; background: transparent; color: var(--gold-light); text-decoration: none; cursor: pointer; font-size: .65rem !important; }
.ops-system-list a.is-disabled { pointer-events: none; border-color: rgba(198,154,85,.2) !important; color: var(--faint); }
.ops-system-list span { text-align: center; color: #79a44b; font-size: .65rem; }
.ops-failure-panel { margin-top: 12px; }
.ops-failure-panel .ops-panel-title > div { display: flex; align-items: center; gap: 16px; }
.ops-toast { position: fixed; right: 22px; top: 22px; z-index: 200; max-width: 360px; padding: 12px 16px; translate: 0 -16px; opacity: 0; pointer-events: none; border: 1px solid #73986c; background: #142017; color: #bdd6b7; font-size: .76rem; transition: .18s ease; }
.ops-toast.is-visible { translate: 0 0; opacity: 1; }
.ops-toast.is-error { border-color: #a95749; background: #271310; color: #e4a499; }

@media (max-width: 1220px) {
    .ops-primary-grid, .ops-secondary-grid { grid-template-columns: 1fr; }
    .ops-metric { padding-inline: 17px; }
    .ops-metric-seal { width: 44px; height: 44px; flex-basis: 44px; }
}
@media (max-width: 760px) {
    .ops-header { align-items: flex-start; flex-direction: column; }
    .ops-header-actions { width: 100%; flex-wrap: wrap; }
    .ops-header-actions time { width: 100%; }
    .ops-metric-rail, .ops-alert-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ops-metric-primary { grid-column: 1 / -1; }
    .ops-metric:nth-child(2)::before, .ops-metric:nth-child(4)::before, .ops-alert-rail a:nth-child(3)::before { display: none; }
    .ops-metric:nth-child(n+2), .ops-alert-rail a:nth-child(n+3) { border-top: 1px solid var(--border); }
    .ops-metric { min-height: 104px; }
    .ops-lifetime-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ops-lifetime-heading { grid-column: 1 / -1; border-bottom: 1px solid rgba(198,154,85,.17); }
    .ops-lifetime-rail dl:nth-of-type(odd)::before { display: none; }
    .ops-lifetime-rail dl:nth-of-type(n+3) { border-top: 1px solid rgba(198,154,85,.17); }
    .ops-inventory-note { align-items: flex-start; flex-direction: column; }
    .ops-product-compare { min-width: 0; grid-template-columns: 1fr; }
    .ops-product-column + .ops-product-column { border-left: 0; border-top: 1px solid var(--border); }
}
@media (max-width: 460px) {
    .ops-metric { padding: 14px 11px; gap: 10px; }
    .ops-metric-seal { width: 36px; height: 36px; flex-basis: 36px; font-size: .84rem; }
    .ops-metric strong { font-size: 1.35rem; }
    .ops-alert-rail a { padding: 12px 10px; grid-template-columns: 32px 1fr auto; gap: 8px; }
    .ops-alert-icon { width: 30px; height: 30px; }
    .ops-chart-legend { gap: 8px; }
    .ops-chart-legend span::before { width: 10px; }
    .ops-system-list > div { grid-template-columns: 94px minmax(0,1fr) 68px; gap: 7px; }
}

/* Presence monitor */
.presence-header { margin-bottom: 18px; }
.presence-live-mark { display: inline-flex; align-items: center; gap: 7px; color: #8db66b; font: 700 .7rem var(--serif); letter-spacing: .05em; }
.presence-live-mark i { width: 7px; height: 7px; border-radius: 50%; background: #8db66b; box-shadow: 0 0 0 4px rgba(141,182,107,.11); }
.presence-metric-rail { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border-strong); background: #0c1215; }
.presence-metric { min-height: 116px; padding: 19px 23px; display: flex; align-items: center; gap: 16px; position: relative; }
.presence-metric + .presence-metric::before { content: ""; position: absolute; left: 0; top: 17px; bottom: 17px; width: 1px; background: var(--border); }
.presence-metric-seal { width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold-light); font: 800 .95rem var(--serif); }
.presence-metric p { margin: 0 0 6px; color: #d7c9ae; font: 700 .75rem var(--serif); letter-spacing: .04em; }
.presence-metric strong { color: var(--gold-light); font: 800 1.65rem var(--serif); }
.presence-metric small { margin-left: 5px; color: var(--gold); font: .68rem var(--serif); }
.presence-metric.is-online .presence-metric-seal, .presence-metric.is-online strong { color: #8db66b; border-color: #719555; }
.presence-metric.is-idle .presence-metric-seal, .presence-metric.is-idle strong { color: #d99a45; border-color: #b47b38; }
.presence-buy-panel { margin-top: 12px; }
.presence-buy-breakdown { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 19px; padding: 14px 17px 17px; }
.presence-buy-breakdown h3 { margin: 0 0 9px; color: #dbc9a8; font: 700 .72rem var(--serif); letter-spacing: .05em; }
.presence-breakdown-list { display: grid; gap: 7px; }
.presence-breakdown-row { display: grid; grid-template-columns: 74px minmax(0,1fr) 22px; align-items: center; gap: 8px; color: #b9ad98; font-size: .66rem; }
.presence-breakdown-row > i { height: 5px; display: block; background: rgba(198,154,85,.14); overflow: hidden; }
.presence-breakdown-row > i b { height: 100%; display: block; background: var(--gold); }
.presence-breakdown-row strong { color: var(--gold-light); font: 700 .7rem var(--serif); text-align: right; }
.presence-breakdown-empty { color: var(--faint); font-size: .66rem; }
.presence-filter-row { padding: 13px 17px; display: flex; align-items: end; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.presence-filter-row label { display: grid; gap: 5px; color: var(--muted); font-size: .66rem; }
.presence-filter-row select, .presence-filter-row input[type="search"] { min-width: 126px; height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 2px; background: #101619; color: var(--text); font: .7rem var(--font); outline: none; }
.presence-filter-row input[type="search"] { min-width: 225px; }
.presence-filter-row select:focus, .presence-filter-row input[type="search"]:focus { border-color: var(--gold); }
.presence-filter-button { min-height: 34px; }
.presence-updated { margin-left: auto; color: var(--faint); font-size: .66rem; }
.presence-auto { min-height: 34px; display: inline-flex !important; align-items: center; grid-template-columns: auto auto; gap: 7px !important; color: #9a8e7c !important; }
.presence-auto input { accent-color: var(--gold); }
.presence-table-panel { margin-top: 12px; }
.presence-legend { display: flex; align-items: center; gap: 14px; font-size: .65rem; }
.presence-legend span::before { content: ""; width: 6px; height: 6px; margin-right: 5px; display: inline-block; border-radius: 50%; background: currentColor; }
.presence-legend .online { color: #8db66b; }
.presence-legend .idle { color: #d99a45; }
.presence-legend .offline { color: #80766a; }
.presence-table { min-width: 990px; }
.presence-table td { vertical-align: middle; }
.presence-status { display: inline-flex; align-items: center; gap: 6px; font-size: .69rem; }
.presence-status i { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: currentColor; }
.presence-status.online { color: #8db66b; }
.presence-status.idle { color: #d99a45; }
.presence-status.offline { color: #80766a; }
.presence-product { display: block; font-size: .72rem; font-weight: 700; }
.presence-product.zhuifeng { color: #d65d4b; }
.presence-product.hong { color: #84b95a; }
.presence-card, .presence-action { display: block; margin-top: 4px; color: var(--faint); font: .63rem ui-monospace, Consolas, monospace; }
.presence-page-cell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; color: #d2c5af !important; }
.presence-context { display: block; max-width: 220px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; color: var(--faint); font-size: .6rem; white-space: nowrap; }
.presence-last-seen { display: block; color: var(--gold-light); font: 700 .7rem var(--serif); }
.presence-first-seen { color: var(--faint) !important; font-size: .65rem !important; }
.presence-footnote { margin-top: 11px; display: flex; justify-content: space-between; gap: 12px; color: var(--faint); font-size: .64rem; }

@media (max-width: 900px) {
    .presence-metric { padding-inline: 16px; }
    .presence-metric-seal { width: 40px; height: 40px; flex-basis: 40px; }
    .presence-buy-breakdown { gap: 12px; }
}
@media (max-width: 760px) {
    .presence-metric-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .presence-metric:nth-child(3)::before { display: none; }
    .presence-metric:nth-child(n+3) { border-top: 1px solid var(--border); }
    .presence-filter-row { align-items: stretch; }
    .presence-buy-breakdown { grid-template-columns: 1fr; gap: 15px; }
    .presence-filter-row label, .presence-filter-row select, .presence-filter-row input[type="search"] { width: 100%; }
    .presence-updated { margin-left: 0; }
    .presence-auto { width: auto !important; margin-left: 0; }
    .presence-filter-button { width: 100%; }
    .presence-legend { gap: 8px; }
    .presence-footnote { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 460px) {
    .presence-metric { padding: 14px 11px; gap: 9px; }
    .presence-metric-seal { width: 34px; height: 34px; flex-basis: 34px; font-size: .78rem; }
    .presence-metric strong { font-size: 1.35rem; }
    .presence-filter-row { padding-inline: 12px; }
    .presence-buy-breakdown { padding-inline: 12px; }
    .presence-legend { display: none; }
}

/* Login */
.admin-login { display: grid !important; place-items: center; min-height: 100vh; padding: 28px !important; }
.admin-login .login-card, .admin-login .card { width: min(420px, 100%); background: rgba(28,25,20,.96) !important; padding: 42px !important; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 13px; margin-bottom: 22px; }
.login-brand-mark { width: 52px; height: 52px; flex: 0 0 52px; filter: drop-shadow(0 10px 18px rgba(91,27,19,.35)); }
.login-brand h1 { color: var(--text); font-family: var(--serif); letter-spacing: .08em; text-align: left; margin: 0; }
.login-brand p { color: var(--faint); font-size: .7rem; margin-top: 4px; }
.admin-login .subtitle { color: var(--muted) !important; }
.admin-login input { background: #100f0c !important; border-color: var(--border) !important; border-radius: 2px !important; }
.admin-login input:focus { border-color: var(--gold) !important; }
.admin-login label { color: var(--muted) !important; }
.admin-login .back a { color: var(--muted) !important; }

@media (max-width: 900px) {
    .site-nav a:not(.nav-primary) { display: none; }
    .portal-intro { min-height: 380px; padding-top: 64px; grid-template-columns: 1fr; gap: 22px; }
    .portal-intro-meta { border-left: 0; border-top: 1px solid var(--border); padding: 16px 0 0; }
    .lookup-grid { grid-template-columns: 1fr; }
    .buy-layout { grid-template-columns: 1fr; gap: 34px; padding-top: 44px; }
    .buy-context { position: static; padding-top: 0; }
    /* 移动端：下单面板提到首屏，说明内容后置压缩 */
    .buy-layout { display: flex; flex-direction: column; }
    .buy-layout > .container { order: -1; }
    .buy-context > p { margin-top: 12px; font-size: .9rem; line-height: 1.7; }
    .buy-context h1 { font-size: 2.2rem; }
    .buy-assurance { display: none; }
    .buy-assurance { grid-template-columns: repeat(3, 1fr); }
    .admin-app .sidebar { position: static !important; width: 100% !important; height: auto; padding: 10px 14px !important; border-right: 0 !important; border-bottom: 1px solid var(--border) !important; }
    .sidebar-brand { padding: 3px 8px 10px; }
    .sidebar-brand span { display: none; }
    .sidebar-nav { display: flex; overflow-x: auto; gap: 4px; padding-bottom: 3px; }
    .admin-app .sidebar a { flex: 0 0 auto; min-height: 38px; padding: 7px 10px !important; }
    .sidebar-footer { display: none; }
    .admin-app .main { margin-left: 0 !important; padding: 24px 18px 50px !important; }
    .admin-app .stat-row[style] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

@media (max-width: 620px) {
    .site-header, .public-home .container, .buy-layout { width: min(100% - 24px, 1120px) !important; }
    .site-header { height: 64px; }
    .site-brand-mark { width: 36px; height: 36px; flex-basis: 36px; }
    .site-brand { font-size: .96rem; }
    .site-nav .nav-primary { padding: 8px 10px; font-size: .75rem; }
    .public-home, .public-buy { background-size: cover, 980px auto !important; background-position: center top, 58% top !important; }
    .portal-intro { min-height: 410px; padding: 58px 0 30px; align-items: end; }
    .portal-intro h1, .buy-context h1 { font-size: 2.6rem; }
    .portal-intro p { font-size: .86rem; line-height: 1.75; }
    .portal-intro-meta { display: none; }
    .public-home .card:first-of-type, .public-home .files-section, .public-buy .card { padding: 19px !important; }
    .public-home .logo { grid-template-columns: 1fr; }
    .public-home .logo h1, .public-home .logo p { grid-column: auto; }
    .lookup-panel { padding: 17px; }
    .lookup-panel-title { align-items: flex-start; flex-direction: column; gap: 4px; }
    .downloads-toolbar { grid-template-columns: 1fr; }
    .download-state { min-height: 40px; }
    .buy-layout { padding: 38px 0; }
    .buy-assurance { grid-template-columns: 1fr; gap: 13px; }
    .admin-app .main { padding-inline: 12px !important; }
    .admin-app .stat-row[style] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .admin-app .chart-row { flex-direction: column; }
    .admin-app .section, .admin-app .chart-container { padding: 14px !important; }
    .admin-app .header { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
