:root {
    color-scheme: dark;
    --bg: #060907;
    --surface: #0d1210;
    --surface-2: #111815;
    --surface-3: #151d19;
    --text: #f3f7f5;
    --muted: #8e9a94;
    --border: #26312c;
    --border-bright: #34453d;
    --primary: #19e68c;
    --primary-hover: #39f3a4;
    --primary-dark: #062d1d;
    --danger: #ff5c6a;
    --shadow: 0 20px 60px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.55; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; color: var(--primary-hover); }
button, input, select, textarea { font: inherit; }
.container { width: min(1420px, calc(100% - 64px)); margin: 0 auto; }
.page { padding-block: 30px 56px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

h1, h2 { margin-top: 0; line-height: 1.22; letter-spacing: -.02em; }
h1 { margin-bottom: 8px; font-size: clamp(26px, 3vw, 36px); }
h2 { font-size: 19px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(4, 7, 5, .94); border-bottom: 1px solid #1a231f; backdrop-filter: blur(18px); }
.nav-wrap { min-height: 74px; display: flex; align-items: center; gap: 20px; }
.wordmark { display: inline-flex; align-items: baseline; color: #fff; font-weight: 800; letter-spacing: .12em; line-height: 1; white-space: nowrap; }
.wordmark:hover { color: #fff; }
.wordmark span { font-size: 1.12em; }
.wordmark.compact { font-size: 18px; }
.wordmark.compact span { font-size: 24px; }
.brand-divider { width: 1px; height: 28px; background: #36413c; }
.product-name { color: #f4f7f5; font-size: 17px; font-weight: 650; white-space: nowrap; }
.product-name:hover { color: #fff; }
nav { display: flex; align-self: stretch; gap: 34px; margin-left: 28px; flex: 1; }
nav > a { position: relative; display: inline-flex; align-items: center; color: #8b9791; font-weight: 550; white-space: nowrap; }
nav > a:hover, nav > a.active { color: var(--primary); }
nav > a.active::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--primary); box-shadow: 0 0 14px rgba(25, 230, 140, .55); }
.account { display: flex; align-items: center; gap: 10px; color: #d5dbd8; white-space: nowrap; }
.account form { margin: 0; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #324039; border-radius: 50%; background: #19211d; color: var(--primary); font-size: 13px; font-weight: 800; }
.link-button { border: 0; background: transparent; color: var(--muted); padding: 5px; cursor: pointer; }
.link-button:hover { color: var(--primary); }

/* Buttons and fields */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 18px; border: 1px solid var(--border-bright); border-radius: 7px; background: var(--surface-2); color: var(--text); cursor: pointer; font-weight: 650; transition: .18s ease; }
.button:hover { color: #fff; border-color: #53635b; transform: translateY(-1px); }
.button.primary { color: #03150d; background: var(--primary); border-color: var(--primary); box-shadow: 0 0 24px rgba(25, 230, 140, .12); }
.button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.button.danger { color: #fff; background: #8c2530; border-color: #a93440; }
.button:disabled { opacity: .6; cursor: wait; transform: none; }
input, select, textarea { width: 100%; padding: 11px 13px; color: var(--text); background: #090d0b; border: 1px solid var(--border); border-radius: 7px; outline: none; }
input::placeholder, textarea::placeholder { color: #66716b; }
input:focus, select:focus, textarea:focus { border-color: #2b9f6a; box-shadow: 0 0 0 3px rgba(25, 230, 140, .1); }
select { color-scheme: dark; }

/* Login */
.auth-shell { min-height: 100vh; overflow-x: hidden; }
.auth-page { min-height: 100vh; }
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: radial-gradient(circle at 22% 50%, rgba(0, 116, 68, .24), transparent 27%), linear-gradient(116deg, #030705 0 51%, #111613 51% 100%); }
.auth-brand-panel { position: relative; display: grid; place-items: center; overflow: hidden; }
.auth-brand-panel::before { content: ""; position: absolute; inset: 0; opacity: .22; background-image: linear-gradient(rgba(25, 230, 140, .22) 1px, transparent 1px), linear-gradient(90deg, rgba(25, 230, 140, .22) 1px, transparent 1px); background-size: 92px 92px; mask-image: radial-gradient(circle, #000 20%, transparent 72%); }
.tech-orbit { position: absolute; width: min(72vw, 680px); aspect-ratio: 1; border: 1px solid rgba(25, 230, 140, .12); border-radius: 50%; box-shadow: inset 0 0 120px rgba(25, 230, 140, .025); }
.wordmark.hero { position: relative; z-index: 1; font-size: clamp(46px, 5vw, 72px); text-shadow: 0 6px 26px rgba(0, 0, 0, .5); }
.wordmark.hero span { font-size: 1.18em; }
.auth-form-panel { display: grid; place-items: center; padding: 40px; background: linear-gradient(145deg, rgba(255,255,255,.025), transparent 50%); }
.auth-card { position: relative; width: min(100%, 520px); padding: 58px 50px 46px; border: 1px solid #315141; border-radius: 22px; background: rgba(7, 12, 9, .8); box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.025); }
.status-light { position: absolute; top: -10px; left: calc(50% - 10px); width: 20px; height: 20px; border: 5px solid #123b27; border-radius: 50%; background: var(--primary); box-shadow: 0 0 24px var(--primary); }
.auth-card h1 { margin-bottom: 10px; text-align: center; font-size: 36px; }
.auth-eyebrow { margin: 0 0 34px; color: var(--primary); text-align: center; letter-spacing: .28em; font-size: 12px; font-weight: 800; }
.auth-form { gap: 16px; }
.auth-form input { height: 58px; padding-inline: 18px; background: #121715; border-color: #3b4641; }
.auth-form .button { height: 58px; margin-top: 10px; font-size: 16px; }
.secure-note { margin: 28px 0 0; color: #79857f; text-align: center; font-size: 14px; }
.secure-note span { color: var(--primary); }

/* Page structure */
.page-heading, .detail-heading, .interaction-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.page-heading { margin-bottom: 22px; }
.page-heading p { margin: 0; }
.category-tabs { display: flex; width: fit-content; max-width: 100%; gap: 0; margin: 0 0 10px; padding: 0; overflow-x: auto; background: transparent; border: 1px solid var(--border); border-radius: 8px 8px 0 0; }
.category-tabs a { position: relative; min-width: 145px; padding: 13px 24px; border-right: 1px solid #1e2823; color: #89958f; text-align: center; font-weight: 650; white-space: nowrap; }
.category-tabs a:last-child { border-right: 0; }
.category-tabs a:hover { color: #d7dfdb; background: #0d1410; }
.category-tabs a.active { color: var(--primary); background: #0b110e; }
.category-tabs a.active::after { content: ""; position: absolute; right: 32%; bottom: -1px; left: 32%; height: 2px; background: var(--primary); box-shadow: 0 0 12px rgba(25,230,140,.5); }
.filters { display: grid; grid-template-columns: minmax(230px, 1fr) 180px 180px 190px auto; align-items: end; gap: 14px; margin-bottom: 20px; padding: 18px; background: rgba(12, 17, 14, .78); border: 1px solid var(--border); border-radius: 0 10px 10px 10px; }
.filters label, .stack-form label { display: grid; gap: 7px; color: #b8c1bc; font-size: 13px; font-weight: 650; }

/* Asset cards */
.asset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.asset-card { overflow: hidden; background: linear-gradient(155deg, #111714, #0b100e); border: 1px solid var(--border); border-radius: 9px; box-shadow: 0 8px 28px rgba(0,0,0,.16); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.asset-card:hover { transform: translateY(-3px); border-color: #3a4a42; box-shadow: 0 18px 42px rgba(0,0,0,.3); }
.preview { position: relative; display: block; aspect-ratio: 16 / 9; background: #0c100e; overflow: hidden; }
.preview img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .35s ease; }
.asset-card:hover .preview img { transform: scale(1.025); }
.play-overlay { position: absolute; inset: 50% auto auto 50%; display: grid; place-items: center; width: 56px; height: 56px; padding-left: 4px; transform: translate(-50%, -50%); border: 2px solid #fff; border-radius: 50%; background: rgba(3, 8, 5, .52); color: #fff; font-size: 18px; backdrop-filter: blur(5px); }
.video-placeholder { width: 100%; height: 100%; display: grid; place-content: center; justify-items: center; gap: 7px; color: #9aa59f; background: radial-gradient(circle, #17241d, #0b0e0d 68%); }
.video-placeholder span { display: grid; place-items: center; width: 54px; height: 54px; padding-left: 4px; border: 1px solid #4c5c54; border-radius: 50%; color: var(--primary); font-size: 20px; }
.asset-card-body { padding: 15px 16px 16px; }
.asset-card-body h2 { margin: 12px 0 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 18px; }
.asset-card-body h2 a { color: var(--text); }
.badge-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.badge { display: inline-flex; padding: 3px 8px; border: 1px solid rgba(25, 230, 140, .28); border-radius: 5px; background: rgba(25, 230, 140, .07); color: var(--primary); font-size: 11px; font-weight: 750; }
.badge.subtle { color: #bac3be; background: #161d19; border-color: #303b35; }
.meta { margin: 0; }
.meta div { display: flex; justify-content: space-between; gap: 12px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.meta.compact { display: grid; gap: 5px; font-size: 12px; }
.empty-state { padding: 80px 20px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed #344039; border-radius: 10px; }
.empty-state h2 { color: var(--text); }

/* Detail and interactions */
.back-link { display: inline-block; margin-bottom: 20px; color: #aab5af; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, .7fr); gap: 22px; align-items: start; }
.detail-layout.single { grid-template-columns: minmax(0, 1fr); }
.detail-layout > section, .comments-panel, .form-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 36px rgba(0,0,0,.18); }
.detail-layout > section { padding: 20px; }
.media-viewer { display: grid; place-items: center; min-height: 300px; overflow: hidden; border-radius: 7px; background: #020403; }
.media-viewer img { display: block; width: 100%; max-height: 70vh; object-fit: contain; }
.media-viewer video { display: block; width: 100%; max-height: 70vh; }
.detail-heading { align-items: flex-end; margin-top: 20px; }
.detail-heading h1 { margin: 8px 0 0; font-size: 26px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 28px; padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--border); font-size: 13px; }
.comments-panel { padding: 20px; }
.interaction-head h2 { margin: 0 0 2px; }
.interaction-head > div > span { color: var(--muted); font-size: 13px; }
.like-button { display: inline-flex; align-items: center; gap: 7px; min-width: 72px; padding: 8px 12px; color: #9da8a2; background: #101613; border: 1px solid #334139; border-radius: 999px; cursor: pointer; font-weight: 750; }
.like-button span { font-size: 18px; }
.like-button:hover, .like-button.liked { color: var(--primary); border-color: #23794f; background: rgba(25,230,140,.08); }
.stack-form { display: grid; gap: 11px; }
.comment-form { margin: 20px 0 24px; }
.comment-form textarea { resize: vertical; min-height: 98px; }
.comment-form .button { justify-self: end; }
.comment-list { display: grid; gap: 14px; max-height: 560px; overflow-y: auto; padding-right: 3px; }
.comment { padding-top: 14px; border-top: 1px solid var(--border); }
.comment-head { display: flex; align-items: center; justify-content: space-between; }
.comment p { margin: 8px 0; overflow-wrap: anywhere; color: #d8dfdb; }
.comment time { color: #6f7b75; font-size: 11px; }
.empty-comments { padding: 30px 0; color: var(--muted); text-align: center; font-size: 13px; }

/* Forms, messages and tables */
.form-card { max-width: 680px; margin: 0 auto; padding: 30px; }
.form-card.narrow { max-width: 520px; }
.form-card input[type="file"] { padding: 15px; background: #080c0a; }
.form-card .button.primary { margin-top: 8px; }
.form-errors { padding: 10px 12px; color: #ff9ca5; background: rgba(255, 92, 106, .1); border: 1px solid rgba(255,92,106,.25); border-radius: 7px; font-size: 13px; }
.upload-progress { padding: 13px; background: #080c0a; border-radius: 7px; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 7px; font-size: 13px; }
progress { width: 100%; accent-color: var(--primary); }
.messages { display: grid; gap: 8px; margin-bottom: 18px; }
.message { padding: 11px 14px; border: 1px solid #314038; border-radius: 7px; background: #101713; }
.message.success { color: #8df3bd; background: rgba(25,230,140,.08); border-color: rgba(25,230,140,.25); }
.message.error { color: #ff9ca5; background: rgba(255,92,106,.08); border-color: rgba(255,92,106,.25); }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: #8e9a94; font-size: 12px; background: #0a0f0c; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #111814; }
tbody tr:last-child td { border-bottom: 0; }
.table-actions { display: flex; gap: 12px; }
.danger-text { color: var(--danger); }

@media (max-width: 1050px) {
    .container { width: min(100% - 32px, 1420px); }
    .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filters { grid-template-columns: 1fr 1fr 1fr; }
    nav { gap: 20px; margin-left: 8px; }
}

@media (max-width: 820px) {
    .auth-layout { grid-template-columns: 1fr; background: radial-gradient(circle at 50% 20%, rgba(0,116,68,.26), transparent 30%), #060907; }
    .auth-brand-panel { min-height: 30vh; }
    .tech-orbit { width: 70vw; }
    .auth-form-panel { align-items: start; padding-top: 10px; }
    .wordmark.hero { font-size: 42px; }
    .detail-layout { grid-template-columns: 1fr; }
    .brand-divider, .product-name { display: none; }
}

@media (max-width: 650px) {
    .container { width: min(100% - 20px, 1420px); }
    .site-header { position: static; }
    .nav-wrap { padding-block: 12px; flex-wrap: wrap; gap: 12px 16px; }
    nav { order: 3; width: 100%; min-height: 44px; overflow-x: auto; gap: 22px; margin-left: 0; border-top: 1px solid var(--border); }
    .account { margin-left: auto; }
    .account > span:not(.avatar) { display: none; }
    .page { padding-top: 22px; }
    .page-heading, .detail-heading { align-items: flex-start; flex-direction: column; }
    .asset-grid, .filters { grid-template-columns: 1fr; }
    .category-tabs { width: 100%; }
    .category-tabs a { flex: 1; min-width: 112px; padding-inline: 13px; }
    .detail-layout > section, .comments-panel, .form-card { padding: 16px; }
    .detail-meta { grid-template-columns: 1fr; }
    .media-viewer { min-height: 210px; }
    .auth-brand-panel { min-height: 24vh; }
    .auth-form-panel { padding: 0 16px 30px; }
    .auth-card { padding: 42px 22px 30px; border-radius: 14px; }
    .auth-card h1 { font-size: 29px; }
}
