/* Liquid Glass + Bento Grid public UI */
:root {
    color-scheme: dark;
    --bg-primary: #07080d;
    --bg-secondary: rgba(16, 18, 28, 0.62);
    --bg-card: rgba(255, 255, 255, 0.075);
    --bg-card-hover: rgba(255, 255, 255, 0.12);
    --bg-input: rgba(255, 255, 255, 0.08);
    --border-color: rgba(255, 255, 255, 0.14);
    --border-hover: rgba(255, 255, 255, 0.28);
    --text-primary: #f8fafc;
    --text-secondary: #b7becd;
    --text-tertiary: #737b8d;
    --accent: #ff3b3b;
    --accent-hover: #ff5a52;
    --accent-glow: rgba(255, 59, 59, 0.18);
    --cyan: #9be7ff;
    --success: #46d787;
    --warning: #f7b955;
    --danger: #ff4d4d;
    --star: #ffd166;
    --glass-blur: blur(22px) saturate(160%);
    --shadow-sm: 0 10px 24px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 24px 70px rgba(0, 0, 0, 0.34);
    --shadow-lg: 0 34px 120px rgba(0, 0, 0, 0.46);
    --radius-sm: 10px;
    --radius-md: 18px;
    --radius-lg: 28px;
    --transition: 180ms cubic-bezier(.2, .8, .2, 1);
}

[data-theme="light"] {
    color-scheme: light;
    --bg-primary: #f5f7fb;
    --bg-secondary: rgba(255, 255, 255, 0.68);
    --bg-card: rgba(255, 255, 255, 0.62);
    --bg-card-hover: rgba(255, 255, 255, 0.84);
    --bg-input: rgba(255, 255, 255, 0.74);
    --border-color: rgba(20, 24, 34, 0.12);
    --border-hover: rgba(20, 24, 34, 0.24);
    --text-primary: #111827;
    --text-secondary: #475569;
    --text-tertiary: #7c8798;
    --accent-glow: rgba(255, 59, 59, 0.12);
    --shadow-sm: 0 10px 24px rgba(24, 32, 56, 0.08);
    --shadow-md: 0 24px 70px rgba(24, 32, 56, 0.14);
    --shadow-lg: 0 34px 120px rgba(24, 32, 56, 0.18);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    /* 横向裁剪必须放在根元素上。放在 body 时 overflow-x:hidden 会把 body 自己的
       overflow-y 算成 auto，body 于此变成第二个滚动容器，移动端由此出现吸顶栏抖动、
       惯性滚动被吞的现象。clip 不会创建滚动容器，hidden 只是旧浏览器兜底 */
    overflow-x: hidden;
    overflow-x: clip;
}

body {
    margin: 0;
    /* dvh 跟随地址栏收起后的真实可视高度，避免滚动过程中首屏高度跳变 */
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(circle at 18% 12%, rgba(255, 59, 59, 0.18), transparent 30vw),
        radial-gradient(circle at 82% 20%, rgba(155, 231, 255, 0.11), transparent 28vw),
        linear-gradient(180deg, #07080d 0%, #0d1018 44%, #06070b 100%);
    color: var(--text-primary);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

[data-theme="light"] body {
    background:
        radial-gradient(circle at 18% 12%, rgba(255, 59, 59, 0.12), transparent 30vw),
        radial-gradient(circle at 82% 18%, rgba(14, 165, 233, 0.13), transparent 28vw),
        linear-gradient(180deg, #f8fafc 0%, #edf2f8 48%, #f7f8fb 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -2;
    background:
        linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px),
        linear-gradient(0deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 74px 74px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.75), transparent 78%);
}

[data-theme="light"] body::before {
    background:
        linear-gradient(90deg, rgba(15,23,42,.055) 1px, transparent 1px),
        linear-gradient(0deg, rgba(15,23,42,.045) 1px, transparent 1px);
    background-size: 74px 74px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.55), transparent 76%);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0,0,0,.12), rgba(0,0,0,.54));
}

[data-theme="light"] body::after {
    background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.42));
}

.cinema-bg {
    position: fixed;
    inset: 0;
    z-index: -3;
    overflow: hidden;
}

.bg-grid {
    width: 100%;
    height: 100%;
    opacity: .8;
    animation: drift 18s ease-in-out infinite alternate;
}

[data-theme="light"] .bg-grid {
    opacity: .32;
}

.container {
    width: min(1220px, calc(100% - 40px));
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.glass-panel,
.nav-header,
.link-card,
.category-nav,
.sort-bar,
.ad-slot,
.detail-header,
.health-item,
.rating-summary,
.review-item,
.comment-form,
.tabs,
.toast,
.footer {
    background: linear-gradient(145deg, rgba(255,255,255,.13), rgba(255,255,255,.055));
    border: 1px solid var(--border-color);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.16), var(--shadow-sm);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.nav-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 70px;
    padding: 12px max(22px, calc((100vw - 1220px) / 2));
    border-width: 0 0 1px;
    background: rgba(9, 10, 16, .72);
}

[data-theme="light"] .nav-header {
    background: rgba(255, 255, 255, .7);
}

.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    text-decoration: none;
}

.logo a::before {
    content: "";
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background:
        radial-gradient(circle at 68% 32%, #fff 0 9%, transparent 10%),
        linear-gradient(135deg, #ff3b3b, #7f1d1d 54%, #171923);
    box-shadow: 0 0 28px rgba(255,59,59,.38);
}

[data-theme="light"] .logo a::before {
    box-shadow: 0 0 28px rgba(255,59,59,.24);
}

.logo-text {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .02em;
}

.nav-links {
    display: flex;
    justify-content: center;
    flex: 1;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.nav-links::-webkit-scrollbar,
.category-nav::-webkit-scrollbar {
    display: none;
}

.nav-links a,
.detail-back,
.footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.nav-links a {
    flex: 0 0 auto;
    padding: 8px 13px;
    border-radius: 999px;
    font-size: 13px;
    transition: color var(--transition), background var(--transition), transform var(--transition);
}

.nav-links a:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,.08);
    transform: translateY(-1px);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--transition), border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, #ff3b3b, #bd1f2d);
    box-shadow: 0 16px 42px rgba(255, 59, 59, .26);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 54px rgba(255, 59, 59, .34);
}

.btn-secondary {
    background: rgba(255,255,255,.07);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.btn-sm {
    min-height: 34px;
    padding: 0 13px;
}

.theme-toggle {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,.07);
    color: var(--text-secondary);
    cursor: pointer;
}

.theme-toggle:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.theme-toggle .moon-icon {
    display: none;
}

[data-theme="light"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="light"] .theme-toggle .moon-icon {
    display: block;
}

.hero-bento {
    min-height: calc(100vh - 92px);
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(320px, .88fr);
    grid-template-rows: 1fr auto;
    gap: 18px;
    padding: 42px 0 24px;
}

.hero-copy {
    grid-row: span 2;
    min-height: 560px;
    padding: clamp(28px, 6vw, 68px);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.hero-copy::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 20%, rgba(255,255,255,.2), transparent 13%),
        radial-gradient(circle at 85% 80%, rgba(255,59,59,.2), transparent 24%);
    opacity: .88;
}

.hero-copy > * {
    position: relative;
    z-index: 1;
}

.eyebrow {
    width: fit-content;
    margin-bottom: 20px;
    padding: 7px 12px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 999px;
    color: var(--cyan);
    background: rgba(255,255,255,.06);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.hero-copy h1 {
    max-width: 820px;
    margin: 0 0 18px;
    font-size: clamp(34px, 5.2vw, 78px);
    line-height: 1.04;
    letter-spacing: 0;
    overflow-wrap: break-word;
}

.subtitle {
    max-width: 720px;
    margin: 0;
    color: var(--text-secondary);
    font-size: 18px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 34px;
}

.hero-visual,
.hero-search {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.hero-visual {
    min-height: 360px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transform: translate3d(0,0,0);
}

.liquid-mark {
    width: 100%;
    min-height: 260px;
}

.metric-strip {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 8px;
}

.metric-strip span {
    min-width: 0;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255,255,255,.065);
    color: var(--text-secondary);
    font-size: 12px;
}

.metric-strip strong {
    display: block;
    color: var(--text-primary);
    font-size: 26px;
    line-height: 1;
}

.hero-search {
    padding: 14px;
}

.search-box {
    min-height: 62px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(7, 8, 13, .48);
    border: 1px solid rgba(255,255,255,.12);
}

[data-theme="light"] .search-box {
    background: rgba(255, 255, 255, .72);
}

.search-icon {
    display: grid;
    place-items: center;
    color: var(--text-tertiary);
}

.search-box input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: 15px;
}

.search-box input::placeholder {
    color: rgba(183, 190, 205, .62);
}

.clear-btn {
    display: none;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: var(--text-secondary);
    cursor: pointer;
}

.clear-btn.visible {
    display: inline-grid;
    place-items: center;
}

.category-nav {
    display: flex;
    gap: 8px;
    padding: 8px;
    margin: 8px 0 16px;
    border-radius: 999px;
    overflow-x: auto;
}

.cat-btn {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.cat-btn:hover,
.cat-btn.active {
    color: #fff;
    background: rgba(255,59,59,.18);
}

.cat-btn.active {
    box-shadow: inset 0 0 0 1px rgba(255,59,59,.3);
}

.cat-count {
    margin-left: 6px;
    color: rgba(255,255,255,.52);
}

.sort-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 0 0 22px;
    padding: 14px 16px;
    border-radius: 20px;
}

.sort-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.sort-label strong {
    color: var(--text-primary);
}

.sort-bar select {
    min-height: 38px;
    padding: 0 38px 0 14px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: rgba(7,8,13,.64);
    color: var(--text-primary);
    outline: none;
}

[data-theme="light"] .sort-bar select,
[data-theme="light"] input,
[data-theme="light"] textarea,
[data-theme="light"] select {
    background: rgba(255, 255, 255, .78);
}

.links-section {
    margin: 34px 0 46px;
}

.section-title {
    margin: 0 0 16px;
    color: var(--text-primary);
    font-size: 18px;
    letter-spacing: .02em;
}

.section-title::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 10px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 22px rgba(255,59,59,.66);
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 14px;
}

.link-card {
    grid-column: span 4;
    min-height: 190px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px;
    border-radius: 24px;
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    position: relative;
    transition: transform var(--transition), border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.link-card.bento-wide {
    grid-column: span 6;
}

.link-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    background: radial-gradient(circle at 20% 0%, rgba(255,255,255,.18), transparent 34%),
                radial-gradient(circle at 92% 92%, rgba(255,59,59,.18), transparent 28%);
    opacity: .68;
    pointer-events: none;
}

.link-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-md);
}

.card-header,
.card-desc,
.card-footer {
    position: relative;
    z-index: 1;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-icon,
.detail-icon {
    --avatar-hue: 220;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    overflow: hidden;
    background:
        radial-gradient(circle at 30% 24%, rgba(255, 255, 255, .4), transparent 48%),
        linear-gradient(145deg, hsl(var(--avatar-hue), 84%, 63%), hsl(var(--avatar-hue), 62%, 34%));
    border: 1px solid rgba(255, 255, 255, .18);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .38);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24);
}

.card-icon {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    font-weight: 800;
}

.card-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
}

.card-desc {
    margin: 16px 0;
    color: var(--text-secondary);
    font-size: 13px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--text-tertiary);
    font-size: 12px;
}

.card-url,
.card-tag,
.card-score,
.detail-badge {
    max-width: 100%;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(255,255,255,.07);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[data-theme="light"] .card-url,
[data-theme="light"] .card-tag,
[data-theme="light"] .card-score,
[data-theme="light"] .detail-badge,
[data-theme="light"] .metric-strip span {
    background: rgba(15,23,42,.055);
}

.card-score {
    color: var(--star);
}

.highlight {
    color: #fff;
    background: rgba(255,59,59,.38);
    border-radius: 5px;
    padding: 0 3px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.detail-page {
    width: min(920px, calc(100% - 40px));
    margin: 0 auto;
    padding: 42px 0 80px;
}

.detail-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--text-secondary);
}

.detail-back:hover {
    color: #fff;
}

.detail-header {
    padding: 26px;
    border-radius: var(--radius-lg);
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.detail-icon {
    width: 74px;
    height: 74px;
    border-radius: 24px;
    font-size: 28px;
    font-weight: 800;
}

.detail-title {
    font-size: 44px;
    line-height: 1;
    font-weight: 900;
    margin: 0 0 10px;
}

.detail-url a {
    color: var(--cyan);
    word-break: break-all;
}

.detail-desc,
.detail-fulldesc,
.review-content {
    color: var(--text-secondary);
}

.detail-fulldesc {
    margin: 20px 0 0;
    font-size: 14px;
    line-height: 1.8;
}

.panel-title {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 700;
}

a.detail-badge {
    color: inherit;
    text-decoration: none;
}

a.detail-badge:hover {
    color: var(--text-primary);
    background: rgba(255, 59, 59, .18);
}

.detail-badges {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.detail-actions {
    display: flex;
    gap: 12px;
    margin: 18px 0;
    flex-wrap: wrap;
}

.tabs {
    display: flex;
    gap: 8px;
    padding: 8px;
    border-radius: 999px;
    margin: 24px 0;
    overflow-x: auto;
}

.tab {
    padding: 10px 18px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.tab.active,
.tab:hover {
    color: #fff;
    background: rgba(255,59,59,.18);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.health-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.health-item,
.rating-summary,
.review-item,
.comment-form {
    border-radius: 22px;
    padding: 18px;
}

.health-value {
    font-size: 26px;
    font-weight: 900;
}

.health-label,
.review-date {
    color: var(--text-tertiary);
    font-size: 12px;
}

.rating-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.rating-big {
    font-size: 48px;
    line-height: 1;
    font-weight: 900;
}

.stars,
.review-stars {
    color: var(--star);
}

.review-list {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.review-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.review-user {
    font-weight: 800;
}

.comment-form h4 {
    margin: 0 0 16px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    min-height: 44px;
    padding: 10px 13px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: rgba(7,8,13,.55);
    color: var(--text-primary);
    outline: none;
}

[data-theme="light"] input,
[data-theme="light"] textarea,
[data-theme="light"] select {
    color: var(--text-primary);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(255,59,59,.58);
    box-shadow: 0 0 0 4px rgba(255,59,59,.1);
}

.empty-state {
    padding: 56px 20px;
    text-align: center;
    color: var(--text-tertiary);
}

.empty-icon {
    font-size: 42px;
    margin-bottom: 12px;
}

.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 90;
    width: 48px;
    height: 48px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: rgba(255,59,59,.82);
    color: #fff;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ===== 广告位（后台可编辑，两个可选位置）=====
   .ad-slot-top 在页头下方，进站第一屏必然可见；
   .ad-slot-below_hero 在首屏介绍与分类导航之间（类名后缀取自设置里的取值）。
   用左侧描边而不是整块高饱和背景：足够醒目，又不会盖过站点自身的内容层级 */
.ad-slot {
    position: relative;
    margin: 18px 0;
    border-radius: 20px;
    border-left: 3px solid var(--accent);
    overflow: hidden;
}

.ad-slot-top {
    margin: 20px 0 4px;
}

.ad-slot .ad-link,
.ad-slot > .ad-body {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    text-decoration: none;
    color: inherit;
}

.ad-slot .ad-link {
    transition: background .2s ease, transform .2s ease;
}

.ad-slot .ad-link:hover {
    background: rgba(255, 59, 59, .08);
    transform: translateX(2px);
}

.ad-media {
    flex: 0 0 auto;
    width: 88px;
    height: 56px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, .06);
}

.ad-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ad-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}

.ad-badge {
    flex: 0 0 auto;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--accent-glow);
    border: 1px solid rgba(255, 59, 59, .3);
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
}

.ad-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
}

.ad-text {
    flex: 1 1 240px;
    min-width: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.ad-cta {
    flex: 0 0 auto;
    padding: 8px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), #bd1f2d);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.footer-note {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.footer {
    margin: 34px 0 42px;
    padding: 18px;
    border-radius: 22px;
    color: var(--text-tertiary);
    text-align: center;
    font-size: 13px;
}

.footer a:hover {
    color: #fff;
}

.toast-container {
    position: fixed;
    top: 86px;
    right: 20px;
    z-index: 200;
}

.toast {
    margin-bottom: 10px;
    padding: 12px 16px;
    border-radius: 16px;
    color: var(--text-primary);
    animation: slideIn .28s ease;
}

.toast-success {
    border-color: rgba(70,215,135,.35);
}

.toast-error {
    border-color: rgba(255,77,77,.45);
}

/*
 * 入场动画属于渐进增强：只有早期内联脚本确认支持动画并给 <html> 加上 js-reveal 后才隐藏内容。
 * 这样 JS 未执行、脚本报错、或 IntersectionObserver 不回调时内容依然可见，
 * 不会出现"整页空白"这种致命表现。
 */
.reveal {
    transition: opacity 620ms ease, transform 620ms cubic-bezier(.2,.8,.2,1);
}

html.js-reveal .reveal {
    opacity: 0;
    transform: translateY(22px) scale(.985);
}

html.js-reveal .reveal.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@keyframes drift {
    from { transform: translate3d(-1.5%, -1%, 0) scale(1.02); }
    to { transform: translate3d(1.5%, 1%, 0) scale(1.05); }
}

@keyframes slideIn {
    from { transform: translateX(16px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 1020px) {
    .hero-bento {
        grid-template-columns: 1fr;
        /* 桌面端的 1fr 行高在单列下会留出大片空白，单列一律按内容高度排 */
        grid-template-rows: auto;
        min-height: auto;
    }

    .hero-copy {
        min-height: 470px;
        grid-row: auto;
    }

    .link-card,
    .link-card.bento-wide {
        grid-column: span 6;
    }
}

@media (max-width: 760px) {
    .container,
    .detail-page {
        width: min(100% - 28px, 1220px);
    }

    .nav-header {
        flex-wrap: wrap;
        /* 换行后 gap 会同时充当行间距，18px 行距让吸顶栏白白高出近 20px */
        min-height: 0;
        row-gap: 6px;
        padding: 10px 14px;
    }

    .logo-text {
        max-width: 68vw;
    }

    .nav-links {
        order: 3;
        justify-content: flex-start;
        width: 100%;
    }

    .hero-bento {
        gap: 12px;
        padding: 22px 0 18px;
    }

    .hero-copy {
        /* 手机上不再撑固定高度：原本 430px 配 justify-content:flex-end，
           标题上方会空出一大块，首屏几乎只剩留白 */
        min-height: 0;
        padding: 26px 22px;
    }

    .subtitle {
        font-size: 16px;
    }

    .detail-title {
        font-size: 34px;
    }

    .hero-visual {
        min-height: 0;
        padding: 12px;
    }

    /* 纯装饰图形在手机上要占掉 260px，把搜索框和分类栏一起顶到两屏之外 */
    .liquid-mark {
        display: none;
    }

    .metric-strip {
        grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    }

    .metric-strip strong {
        font-size: 20px;
    }

    .detail-header,
    .review-header {
        flex-direction: column;
        align-items: stretch;
    }

    /* 站点数与排序下拉在手机上并排就放得下，竖排只会让这一栏高出一倍 */
    .sort-bar {
        padding: 10px 12px;
    }

    .sort-bar select {
        width: auto;
        min-width: 0;
        flex: 0 1 auto;
    }

    /* 窄屏下广告位改为纵向堆叠，按钮撑满一行，避免文字被挤成一列 */
    .ad-slot .ad-link,
    .ad-slot > .ad-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px;
    }

    .ad-media {
        width: 100%;
        height: 120px;
    }

    .ad-cta {
        width: 100%;
        text-align: center;
    }

    .links-grid,
    .health-bar,
    .form-row {
        grid-template-columns: 1fr;
    }

    .link-card,
    .link-card.bento-wide {
        grid-column: span 1;
    }

    .detail-header {
        display: flex;
    }

    /* 手机 GPU 撑不住二十多层实时毛玻璃，滚动时会掉帧甚至闪烁。
       只给吸顶栏和首屏面板保留模糊，长列表里的重复元素改用半透明底色 */
    .link-card,
    .category-nav,
    .sort-bar,
    .ad-slot,
    .footer,
    .toast {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .bg-grid {
        animation: none;
    }

    /* 吸顶栏换行后约 100px 高，提示条原来的 top:86px 会被压在下面 */
    .toast-container {
        top: 106px;
        left: 12px;
        right: 12px;
    }
}

@media (max-width: 460px) {
    .hero-actions {
        flex-direction: column;
    }

    /* 只让首屏、详情页和表单里的动作按钮撑满一行。
       原来的全局 .btn{width:100%} 会把顶栏「投稿」也撑开，
       .nav-actions 随之溢出，主题切换按钮被挤成 31px 宽的扁椭圆 */
    .hero-actions .btn,
    .detail-actions .btn,
    .empty-state .btn,
    form .btn {
        width: 100%;
    }

    .category-nav {
        border-radius: 20px;
    }
}

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

    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #07080d;
}

::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.18);
    border-radius: 999px;
}

/* ===== 图标字段三态渲染（追加式增量，不改既有主题变量） ===== */

/* 图片图标：img 填满容器，外框复用 .card-icon 的尺寸与圆角 */
.card-icon-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 文本/表情图标：保留色块背景，仅替换首字母为图标内容 */
.card-icon-text span {
    font-size: 22px;
    line-height: 1;
    font-weight: 400;
    text-shadow: none;
}

/* 分类导航小图标（cat-btn 内、分类名前） */
.cat-icon {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    margin-right: 6px;
    border-radius: 6px;
    overflow: hidden;
    vertical-align: -3px;
    font-size: 13px;
    line-height: 1;
}

.cat-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cat-icon-text span {
    font-size: 13px;
    line-height: 1;
}
