:root {
    color-scheme: light;
    --bg: #f5f6f8;
    --surface: #ffffff;
    --text: #1c2430;
    --muted: #687386;
    --border: #dde2e8;
    --primary: #2457d6;
    --primary-hover: #1948bd;
    --danger: #ba2d3b;
    --shadow: 0 10px 30px rgba(28, 36, 48, .08);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: -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: underline; }
button, input, select, textarea { font: inherit; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.page { padding-block: 32px 56px; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.nav-wrap { min-height: 64px; display: flex; align-items: center; gap: 28px; }
.brand { color: var(--text); font-size: 19px; font-weight: 700; white-space: nowrap; }
.brand:hover { text-decoration: none; }
nav { display: flex; gap: 20px; flex: 1; }
nav a { color: #3e4b5e; }
.account { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.account form { margin: 0; }
.link-button { border: 0; background: transparent; color: var(--primary); padding: 0; cursor: pointer; }
h1, h2 { line-height: 1.25; margin-top: 0; }
h1 { font-size: clamp(25px, 3vw, 34px); margin-bottom: 8px; }
h2 { font-size: 19px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.page-heading, .detail-heading, .comments-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.page-heading { margin-bottom: 24px; }
.page-heading p { margin: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; font-weight: 600; }
.button:hover { text-decoration: none; border-color: #aab4c2; }
.button.primary { color: #fff; background: var(--primary); border-color: var(--primary); }
.button.primary:hover { background: var(--primary-hover); }
.button.danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.button:disabled { opacity: .65; cursor: wait; }
.filters { display: grid; grid-template-columns: minmax(220px, 1fr) 150px 170px auto; align-items: end; gap: 12px; margin-bottom: 24px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.filters label, .stack-form label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
input, select, textarea { width: 100%; padding: 10px 12px; color: var(--text); background: var(--surface); border: 1px solid #cbd2dc; border-radius: 8px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(36, 87, 214, .13); }
.asset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.asset-card { overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 4px 16px rgba(28, 36, 48, .04); }
.preview { position: relative; display: block; aspect-ratio: 16 / 10; background: #e8ebf0; overflow: hidden; }
.preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.play-overlay { position: absolute; inset: 50% auto auto 50%; display: grid; place-items: center; width: 48px; height: 48px; padding-left: 3px; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(255, 255, 255, .9); color: var(--primary); font-size: 18px; box-shadow: var(--shadow); }
.video-placeholder { width: 100%; height: 100%; display: grid; place-content: center; justify-items: center; gap: 6px; color: #4c5a70; background: linear-gradient(145deg, #e8ecf4, #d9deea); }
.video-placeholder span { display: grid; place-items: center; width: 52px; height: 52px; padding-left: 4px; border-radius: 50%; background: var(--surface); color: var(--primary); font-size: 20px; box-shadow: var(--shadow); }
.asset-card-body { padding: 16px; }
.asset-card-body h2 { margin: 10px 0 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-card-body h2 a { color: var(--text); }
.badge-row { display: flex; align-items: center; justify-content: space-between; }
.badge { display: inline-flex; padding: 3px 8px; border-radius: 999px; background: #e8eefc; color: #214cae; font-size: 12px; font-weight: 700; }
.badge.subtle { color: #536075; background: #eef0f3; }
.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 { font-size: 13px; display: grid; gap: 5px; }
.empty-state { padding: 70px 20px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed #c8ced8; border-radius: 14px; }
.empty-state h2 { color: var(--text); }
.back-link { display: inline-block; margin-bottom: 20px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr); gap: 24px; align-items: start; }
.detail-layout > section, .comments-panel, .form-card, .auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 4px 18px rgba(28, 36, 48, .04); }
.detail-layout > section { padding: 20px; }
.media-viewer { display: grid; place-items: center; min-height: 260px; overflow: hidden; border-radius: 10px; background: #111827; }
.media-viewer img { display: block; width: 100%; max-height: 68vh; object-fit: contain; }
.media-viewer video { display: block; width: 100%; max-height: 68vh; }
.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: 14px; }
.comments-panel { padding: 20px; }
.comments-title h2 { margin: 0; }
.comments-title span { color: var(--muted); }
.stack-form { display: grid; gap: 10px; }
.comment-form { margin: 18px 0 22px; }
.comment-form .button { justify-self: end; }
.comment-list { display: grid; gap: 14px; }
.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; }
.comment time { color: var(--muted); font-size: 12px; }
.empty-comments { padding: 30px 0; color: var(--muted); text-align: center; }
.form-card { max-width: 640px; margin: 0 auto; padding: 28px; }
.form-card.narrow { max-width: 520px; }
.form-card input[type="file"] { padding: 14px; background: var(--bg); }
.form-card .button.primary { margin-top: 8px; }
.form-errors { padding: 9px 11px; color: #8e1f2b; background: #fff0f1; border-radius: 7px; font-size: 14px; }
.upload-progress { padding: 12px; background: var(--bg); border-radius: 8px; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 7px; font-size: 13px; }
progress { width: 100%; accent-color: var(--primary); }
.auth-card { max-width: 420px; margin: 8vh auto 0; padding: 32px; }
.auth-card .button { width: 100%; margin-top: 8px; }
.messages { display: grid; gap: 8px; margin-bottom: 18px; }
.message { padding: 11px 14px; border-radius: 8px; background: #e9eef9; }
.message.success { color: #1f623c; background: #e8f7ee; }
.message.error { color: #8e1f2b; background: #fff0f1; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-size: 13px; background: #fafbfc; }
tbody tr:last-child td { border-bottom: 0; }
.table-actions { display: flex; gap: 12px; }
.danger-text { color: var(--danger); }

@media (max-width: 900px) {
    .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-layout { grid-template-columns: 1fr; }
    .filters { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 650px) {
    .container { width: min(100% - 20px, 1180px); }
    .site-header { position: static; }
    .nav-wrap { padding-block: 12px; flex-wrap: wrap; gap: 12px 20px; }
    nav { order: 3; width: 100%; overflow-x: auto; gap: 16px; padding-top: 10px; border-top: 1px solid var(--border); }
    nav a { white-space: nowrap; }
    .account { margin-left: auto; }
    .page { padding-top: 22px; }
    .page-heading, .detail-heading { align-items: flex-start; flex-direction: column; }
    .asset-grid, .filters { grid-template-columns: 1fr; }
    .detail-layout > section, .comments-panel, .form-card, .auth-card { border-radius: 10px; }
    .detail-layout > section, .comments-panel, .form-card { padding: 16px; }
    .detail-meta { grid-template-columns: 1fr; }
    .media-viewer { min-height: 200px; }
}
