:root {
    --bg-color: #0b0f19; /* 偏蓝紫的极暗色 */
    --card-bg: rgba(20, 25, 45, 0.5); /* 浅蓝紫的玻璃背景 */
    --card-border: rgba(162, 155, 254, 0.15); /* 边框带点紫色 */
    --text-primary: #f0f4ff;
    --text-secondary: rgba(240, 244, 255, 0.6);
    --accent-color: #74b9ff; /* 浅蓝色为主色调 */
    --accent-hover: #a29bfe; /* 浅紫色为悬停色 */
    --accent-warm: #ffb766;
    --glass-blur: blur(16px);
    --border-radius: 20px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #080b12;
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

.video-background {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    object-fit: cover;
    background: #080b12;
}

.video-background-shade {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(4, 7, 13, 0.7) 0%, rgba(4, 7, 13, 0.24) 42%, rgba(4, 7, 13, 0.72) 100%),
        rgba(4, 7, 13, 0.2);
}

/* Typography */
h1, h2, h3 { font-weight: 600; letter-spacing: 0.5px; }
.page-title { font-size: 2.5rem; margin-bottom: 30px; margin-top: 10px;}
.section-title { font-size: 1.5rem; margin: 30px 0 20px; color: var(--text-secondary); }

/* Sidebar (TV Style - collapsed by default) */
.sidebar {
    width: 80px;
    background: rgba(10, 10, 15, 0.4); /* 更透明，透出地球 */
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    padding: 30px 0;
    transition: var(--transition);
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar:hover { width: 240px; }
.sidebar .text { opacity: 0; transition: opacity 0.2s; white-space: nowrap; margin-left: 15px; }
.sidebar:hover .text { opacity: 1; }

.logo {
    display: flex;
    align-items: center;
    padding: 0 25px;
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 50px;
}

.nav-links { list-style: none; flex: 1; }
.nav-links li { margin-bottom: 10px; }
.nav-links a {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.1rem;
    transition: var(--transition);
    border-left: 3px solid transparent;
}
.nav-links a:hover, .nav-links a.active {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
    border-left-color: var(--accent-color);
}
.nav-links a i { width: 24px; text-align: center; }

.user-profile {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 20px; /* 增加底部间距，避免紧贴屏幕边缘 */
}
.user-profile:hover { background: rgba(255,255,255,0.05); }
.avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--accent-color);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; /* 防止头像被挤压变形 */
}

/* Main Content */
.main-content {
    margin-left: 80px;
    flex: 1 1 auto;
    min-width: 0;
    padding: 30px 50px;
    max-width: none;
    width: calc(100% - 80px);
}

.top-bar,
#pages {
    width: 100%;
    max-width: 2400px;
    margin-right: auto;
    margin-left: auto;
}

/* Top Bar & Search */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--card-border);
    border-radius: 30px;
    padding: 12px 25px;
    width: 500px;
    backdrop-filter: var(--glass-blur);
    transition: var(--transition);
}
.search-box:focus-within {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    box-shadow: 0 0 20px rgba(108, 92, 231, 0.2);
}
.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: white;
    width: 100%;
    margin: 0 15px;
    font-size: 1rem;
}
.search-box input::placeholder { color: var(--text-secondary); }

.top-actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

/* 详情页富文本样式 */
.detail-rich-text h3 {
    color: var(--accent-color);
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.3rem;
    border-left: 4px solid var(--accent-color);
    padding-left: 12px;
}
.detail-rich-text p {
    margin-bottom: 15px;
    line-height: 1.8;
    color: #e0e0e0;
}
.detail-rich-text ul {
    margin-left: 20px;
    margin-bottom: 20px;
    line-height: 1.8;
    color: #e0e0e0;
}
.detail-rich-text li {
    margin-bottom: 10px;
}
.detail-rich-text strong {
    color: #ffffff;
    font-weight: bold;
}

.icon-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: var(--glass-blur);
}
.icon-btn:hover { background: var(--accent-color); border-color: var(--accent-color); }

.user-profile-top {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 5px 15px 5px 5px;
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: var(--glass-blur);
}
.user-profile-top:hover {
    background: rgba(116, 185, 255, 0.2);
    border-color: var(--accent-color);
}
.user-profile-top .avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
}
.user-profile-top .text {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Pages */
.page { display: none; animation: fadeIn 0.4s ease; }
.page.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 首页轮播 --- */
.home-carousel {
    position: relative;
    width: 100%;
    height: min(62vh, 560px);
    min-height: 430px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(8, 11, 16, 0.24);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
    isolation: isolate;
}

.home-carousel::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 170px;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 0%, rgba(8, 11, 18, 0.24) 46%, rgba(8, 11, 18, 0.88) 100%);
}

.carousel-slides,
.carousel-slide {
    position: absolute;
    inset: 0;
}

.carousel-slide {
    opacity: 0;
    visibility: hidden;
    transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1), visibility 700ms;
}

.carousel-slide.is-active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    transform: scale(1.035);
    transition: transform 7s linear;
}

.carousel-slide.is-active img {
    transform: scale(1.105);
}

.carousel-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(4, 7, 12, 0.92) 0%, rgba(4, 7, 12, 0.62) 42%, rgba(4, 7, 12, 0.05) 76%),
        linear-gradient(0deg, rgba(4, 7, 12, 0.76) 0%, transparent 48%);
}

.carousel-copy {
    position: absolute;
    left: 56px;
    bottom: 92px;
    width: min(620px, 58%);
    z-index: 3;
}

.carousel-copy > * {
    opacity: 0;
    transform: translateY(22px);
}

.carousel-slide.is-active .carousel-copy > * {
    animation: hero-copy-in 700ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.carousel-slide.is-active .carousel-copy > *:nth-child(2) { animation-delay: 90ms; }
.carousel-slide.is-active .carousel-copy > *:nth-child(3) { animation-delay: 160ms; }
.carousel-slide.is-active .carousel-copy > *:nth-child(4) { animation-delay: 230ms; }

@keyframes hero-copy-in {
    to { opacity: 1; transform: translateY(0); }
}

.carousel-kicker {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 14px;
    color: #ffd29e;
    font-size: 0.9rem;
    font-weight: 650;
}

.carousel-copy h1,
.carousel-copy h2 {
    margin: 0;
    max-width: 600px;
    color: #f8f4ed;
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: 0;
    text-wrap: balance;
    text-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
}

.carousel-copy p {
    max-width: 540px;
    margin: 18px 0 24px;
    color: rgba(248, 244, 237, 0.82);
    font-size: 1.08rem;
    line-height: 1.7;
}

.carousel-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 4px;
    background: #f3eee6;
    color: #10141b;
    font-weight: 700;
    text-decoration: none;
    transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), background 180ms;
}

.carousel-link:hover {
    background: var(--accent-warm);
    transform: translateY(-2px);
}

.carousel-credit {
    position: absolute;
    top: 24px;
    right: 28px;
    z-index: 3;
    color: rgba(248, 244, 237, 0.58);
    font-size: 0.72rem;
}

.carousel-controls {
    position: absolute;
    right: 28px;
    bottom: 28px;
    left: 56px;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.carousel-dots,
.carousel-arrows {
    display: flex;
    align-items: center;
    gap: 10px;
}

.carousel-dot {
    width: 28px;
    height: 3px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: background 180ms, transform 180ms;
}

.carousel-dot.is-active {
    background: var(--accent-warm);
    transform: scaleX(1.25);
}

.carousel-arrow {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    background: rgba(5, 8, 13, 0.55);
    color: #f8f4ed;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: background 180ms, border-color 180ms, transform 180ms;
}

.carousel-arrow:hover {
    background: rgba(255, 183, 102, 0.92);
    border-color: var(--accent-warm);
    color: #10141b;
    transform: translateY(-2px);
}

.carousel-progress {
    position: absolute;
    right: 8%;
    bottom: 9px;
    left: 8%;
    z-index: 5;
    height: 3px;
    overflow: hidden;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.12);
}

.carousel-progress span {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--accent-warm);
    transform: scaleX(0);
    transform-origin: left;
}

.home-carousel.is-running .carousel-progress span {
    animation: carousel-progress 6.5s linear forwards;
}

@keyframes carousel-progress {
    to { transform: scaleX(1); }
}

.home-search-container {
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 5;
    margin: -38px auto 52px;
    padding: 0 32px;
}
.large-search {
    position: relative;
    width: min(1100px, 100%);
    min-height: 68px;
    padding: 20px 30px;
    font-size: 1.25rem;
    background: rgba(188, 169, 240, 0.3);
    border-color: rgba(234, 225, 255, 0.68);
    box-shadow: 0 20px 54px rgba(37, 24, 70, 0.46), 0 0 34px rgba(168, 137, 235, 0.18), inset 0 1px 1px rgba(255,255,255,0.3);
    backdrop-filter: blur(20px);
}
.large-search::after {
    content: '';
    position: absolute;
    right: 22%;
    bottom: -1px;
    left: 22%;
    height: 2px;
    border-radius: 50%;
    background: linear-gradient(90deg, transparent, rgba(242, 235, 255, 0.95), transparent);
    opacity: 0.85;
    pointer-events: none;
}
.large-search input {
    font-size: 1.25rem;
}
.large-search input::placeholder {
    color: rgba(252, 249, 255, 0.9);
}

.nav-cards-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 70px;
}
.nav-mini-card {
    background: rgba(25, 26, 35, 0.5); /* 稍微降低透明度 */
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px; /* 更大的圆角 */
    padding: 25px 35px; /* 更大的内边距 */
    color: white;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    transition: var(--transition);
    min-width: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.nav-mini-card i {
    font-size: 2.2rem; /* 更大的图标 */
    color: var(--accent-color);
    transition: transform 0.3s ease;
}
.nav-mini-card span {
    font-size: 1.1rem;
    font-weight: 500;
}
.nav-mini-card:hover {
    transform: translateY(-8px);
    background: rgba(108, 92, 231, 0.25);
    border-color: rgba(108, 92, 231, 0.6);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}
.nav-mini-card:hover i {
    transform: scale(1.15);
    color: #a29bfe;
}

.share-cards-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px;
}
.share-large-card {
    position: relative;
    width: 100%;
    height: 250px;
    border-radius: 24px;
    overflow: hidden;
    padding: 0;
    display: flex;
    align-items: flex-end;
    transition: var(--transition);
    cursor: pointer;
}
.share-large-card .card-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.7);
    transition: transform 0.5s;
    z-index: 1;
}
.share-large-card .content {
    position: relative;
    z-index: 2;
    padding: 30px;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
}
.share-large-card:hover {
    transform: scale(1.02);
}
.share-large-card:hover .card-bg {
    transform: scale(1.08);
    filter: brightness(0.9);
}
.share-large-card h3 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}
.share-large-card p {
    color: rgba(255,255,255,0.8);
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    color: rgba(255,255,255,0.8);
    z-index: 3;
    transition: var(--transition);
}
.share-large-card:hover .play-icon {
    color: white;
    transform: translate(-50%, -50%) scale(1.1);
}
/* --- 新首页布局样式结束 --- */

/* Buttons */
.btn-primary {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.btn-primary:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(108, 92, 231, 0.3);
}

/* TV Cards Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}
.home-grid { grid-template-columns: repeat(3, 1fr); }

.tv-card {
    position: relative;
    height: 200px;
    border-radius: 20px;
    padding: 30px;
    text-decoration: none;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    border: 1px solid var(--card-border);
    transition: var(--transition);
}
.tv-card .card-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center;
    z-index: 1; transition: transform 0.5s;
    filter: brightness(0.6);
}
.tv-card h3, .tv-card p { position: relative; z-index: 2; }
.tv-card h3 { font-size: 1.5rem; margin-bottom: 5px; }
.tv-card p { color: rgba(255,255,255,0.8); }

.tv-card:hover { transform: scale(1.03); border-color: rgba(255,255,255,0.3); box-shadow: 0 15px 30px rgba(0,0,0,0.5); }
.tv-card:hover .card-bg { transform: scale(1.1); filter: brightness(0.8); }

/* Mock Backgrounds */
.knowledge-card .card-bg { background: linear-gradient(to top, rgba(10,10,15,0.9), transparent), url('https://images.unsplash.com/photo-1518066000714-58c45f1a2c0a?q=80&w=800'); background-size: cover; background-position: center; }
.parts-card .card-bg { background: linear-gradient(to top, rgba(10,10,15,0.9), transparent), url('https://images.unsplash.com/photo-1532094349884-543bc11b234d?q=80&w=800'); background-size: cover; background-position: center; }
.community-card .card-bg { background: linear-gradient(to top, rgba(10,10,15,0.9), transparent), url('https://images.unsplash.com/photo-1519681393784-d120267933ba?q=80&w=800'); background-size: cover; background-position: center; }

/* Glass Cards (General) */
.glass-card {
    background: rgba(25, 26, 35, 0.4); /* 增加透明度让地球透出来 */
    backdrop-filter: blur(10px); /* 稍微降低模糊度 */
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 25px;
}

/* Post Feed (瀑布流/网格布局) */
.community-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.post-feed { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 25px; 
    align-items: start;
}
.post-card {
    display: flex; flex-direction: column; gap: 10px;
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
}
.post-header { display: flex; align-items: center; gap: 15px; margin-bottom: 5px; }
.post-meta h4 { font-size: 1.05rem; margin-bottom: 2px;}
.post-meta span { font-size: 0.85rem; color: var(--text-secondary); }
.post-image-wrapper {
    margin: 10px -20px; /* 负边距让图片撑满卡片宽度 */
    overflow: hidden;
}
.post-image-wrapper img {
    width: 100%;
    height: 220px; /* 固定高度保持卡片整齐 */
    object-fit: cover; /* 裁剪图片以适应 */
    display: block;
    transition: transform 0.5s ease;
}
.post-card:hover .post-image-wrapper img {
    transform: scale(1.05);
}
.post-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 5px 0; }
.tag { background: rgba(108, 92, 231, 0.2); color: #a29bfe; padding: 4px 10px; border-radius: 15px; font-size: 0.8rem; }
.post-content { 
    line-height: 1.5; 
    font-size: 0.95rem;
    color: #ddd;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-actions { display: flex; justify-content: space-between; margin-top: 15px; border-top: 1px solid var(--card-border); padding-top: 15px;}
.action-btn { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 0.95rem; display: flex; align-items: center; gap: 6px; transition: var(--transition); }
.action-btn:hover { color: var(--accent-color); transform: scale(1.1); }

/* Modals */
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(5px); z-index: 1000;
    align-items: center; justify-content: center;
}
.modal.active { display: flex; }
.modal-content { width: 400px; position: relative; animation: modalIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes modalIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.close-btn { position: absolute; top: 20px; right: 20px; font-size: 1.5rem; cursor: pointer; color: var(--text-secondary); }
.close-btn:hover { color: white; }

/* Forms */
.input-group { margin-bottom: 20px; }
.input-group label { display: block; margin-bottom: 8px; color: var(--text-secondary); font-size: 0.9rem; }
.input-group input, .input-group textarea {
    width: 100%; background: rgba(0,0,0,0.2); border: 1px solid var(--card-border);
    color: white; padding: 12px 15px; border-radius: 10px; font-size: 1rem; transition: var(--transition);
}
.input-group input:focus, .input-group textarea:focus { border-color: var(--accent-color); outline: none; }
.switch-auth { text-align: center; margin-top: 15px; font-size: 0.9rem; color: var(--text-secondary); cursor: pointer; }
.switch-auth:hover { color: var(--accent-color); }

/* In-app notifications */
.toast-region {
    position: fixed;
    top: max(22px, env(safe-area-inset-top));
    right: 22px;
    z-index: 2200;
    display: grid;
    width: min(380px, calc(100vw - 32px));
    gap: 10px;
    pointer-events: none;
}

.app-toast {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) 32px;
    align-items: center;
    gap: 12px;
    min-height: 54px;
    padding: 10px 10px 10px 16px;
    border: 1px solid rgba(232, 225, 255, 0.28);
    border-radius: 8px;
    background: rgba(18, 17, 28, 0.94);
    color: #f5f1ff;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.36);
    backdrop-filter: blur(18px);
    opacity: 0;
    transform: translateX(24px);
    transition: opacity 220ms cubic-bezier(0.16, 1, 0.3, 1), transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

.app-toast::before {
    content: '';
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #bca9f0;
    box-shadow: 0 0 14px rgba(188, 169, 240, 0.7);
}

.app-toast.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.app-toast-success::before { background: #62d6a4; box-shadow: 0 0 14px rgba(98, 214, 164, 0.65); }
.app-toast-error::before { background: #ff7f8f; box-shadow: 0 0 14px rgba(255, 127, 143, 0.65); }
.app-toast-warning::before { background: #ffc36b; box-shadow: 0 0 14px rgba(255, 195, 107, 0.65); }

.app-toast-close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: rgba(245, 241, 255, 0.66);
    font-size: 1.3rem;
    cursor: pointer;
}

.app-toast-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f5f1ff;
}

.app-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(4, 6, 12, 0.7);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 220ms cubic-bezier(0.16, 1, 0.3, 1), visibility 220ms;
}

.app-confirm-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.app-confirm-dialog {
    width: min(420px, 100%);
    padding: 24px;
    border: 1px solid rgba(232, 225, 255, 0.25);
    border-radius: 8px;
    background: rgba(18, 17, 28, 0.97);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.48);
    color: #f5f1ff;
    transform: translateY(14px);
    transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

.app-confirm-overlay.is-active .app-confirm-dialog { transform: translateY(0); }
.app-confirm-dialog h2 { margin-bottom: 10px; font-size: 1.2rem; }
.app-confirm-message { color: rgba(245, 241, 255, 0.72); line-height: 1.65; }
.app-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.app-confirm-actions button { min-width: 84px; min-height: 42px; border-radius: 6px; cursor: pointer; font-weight: 650; }
.app-confirm-cancel { border: 1px solid rgba(232, 225, 255, 0.22); background: transparent; color: #f5f1ff; }
.app-confirm-submit { border: 0; background: #d9cbff; color: #211a33; }

/* --- 响应式布局 --- */
@media (min-width: 1600px) {
    .main-content {
        padding: 32px 56px 56px;
    }

    .home-carousel {
        height: min(68vh, 680px);
    }

    .share-large-card {
        height: min(17vw, 360px);
        min-height: 280px;
    }

    .tv-card {
        height: 260px !important;
    }

    .part-card-image {
        height: 220px !important;
    }

    .post-feed {
        gap: 24px;
    }
}

@media (max-width: 1180px) {
    .main-content {
        padding: 26px 30px;
    }

    .carousel-copy {
        left: 40px;
        width: 66%;
    }

    .carousel-copy h1,
    .carousel-copy h2 {
        font-size: 3.6rem;
    }

    .carousel-controls {
        left: 40px;
    }

    .nav-cards-row {
        gap: 12px;
    }

    .nav-mini-card {
        padding: 22px 12px;
    }
}

@media (max-width: 920px) {
    .home-carousel {
        height: 520px;
    }

    .carousel-copy {
        width: 72%;
    }

    .nav-cards-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-bottom: 46px;
    }

    .share-cards-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .card-grid,
    .post-feed {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }
}

@media (max-width: 760px) {
    body {
        display: block;
        padding-right: env(safe-area-inset-right);
        padding-left: env(safe-area-inset-left);
    }

    .sidebar,
    .sidebar:hover {
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        height: calc(68px + env(safe-area-inset-bottom));
        padding: 0 0 env(safe-area-inset-bottom);
        border-top: 1px solid rgba(255, 255, 255, 0.14);
        border-right: 0;
        background: rgba(7, 10, 16, 0.94);
    }

    .logo {
        display: none;
    }

    .nav-links {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        width: 100%;
        height: 68px;
    }

    .nav-links li {
        min-width: 0;
        margin: 0;
    }

    .nav-links a {
        height: 100%;
        padding: 7px 2px 6px;
        border-top: 3px solid transparent;
        border-left: 0;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        font-size: 0.9rem;
    }

    .nav-links a:hover,
    .nav-links a.active {
        border-top-color: var(--accent-warm);
        border-left-color: transparent;
    }

    .sidebar .text,
    .sidebar:hover .text {
        max-width: 100%;
        margin-left: 0;
        overflow: hidden;
        opacity: 1;
        font-size: 0.67rem;
        line-height: 1;
        text-overflow: ellipsis;
    }

    .nav-links a i {
        width: auto;
    }

    .main-content {
        width: 100%;
        max-width: none;
        margin-left: 0;
        padding: 14px 14px calc(92px + env(safe-area-inset-bottom));
    }

    .top-bar {
        min-height: 40px;
        margin-bottom: 12px;
    }

    .top-actions {
        gap: 10px;
    }

    .top-actions .text {
        display: none;
    }

    .user-profile-top {
        padding-right: 5px;
    }

    .home-carousel {
        height: min(470px, calc(100svh - 180px));
        min-height: 380px;
        border-radius: 6px;
    }

    .carousel-slide img {
        object-position: 58% center;
    }

    .carousel-shade {
        background:
            linear-gradient(0deg, rgba(4, 7, 12, 0.96) 0%, rgba(4, 7, 12, 0.62) 55%, rgba(4, 7, 12, 0.08) 100%),
            linear-gradient(90deg, rgba(4, 7, 12, 0.5), transparent 75%);
    }

    .carousel-copy {
        right: 18px;
        bottom: 88px;
        left: 18px;
        width: auto;
    }

    .carousel-copy h1,
    .carousel-copy h2 {
        font-size: 2.65rem;
        line-height: 1.08;
    }

    .carousel-copy p {
        margin: 12px 0 18px;
        font-size: 0.95rem;
        line-height: 1.55;
    }

    .carousel-credit {
        top: 14px;
        right: 14px;
        font-size: 0.64rem;
    }

    .carousel-controls {
        right: 16px;
        bottom: 16px;
        left: 18px;
    }

    .carousel-arrow {
        width: 42px;
        height: 42px;
    }

    .home-search-container {
        margin: -22px auto 34px;
        padding: 0 10px;
    }

    .large-search {
        padding: 14px 16px;
    }

    .large-search input {
        margin: 0 10px;
        min-width: 0;
        font-size: 0.95rem;
    }

    .large-search .fa-microphone {
        display: none;
    }

    .nav-cards-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 40px;
    }

    .nav-mini-card {
        min-height: 112px;
        padding: 16px 8px;
        border-radius: 8px;
        gap: 10px;
    }

    .nav-mini-card i {
        font-size: 1.7rem;
    }

    .nav-mini-card span {
        font-size: 0.9rem;
    }

    .share-cards-row,
    .card-grid,
    .post-feed,
    .home-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .share-large-card {
        height: auto;
        aspect-ratio: 16 / 10;
        border-radius: 8px;
    }

    .share-large-card .content {
        padding: 22px;
    }

    .page-title {
        margin: 6px 0 22px;
        font-size: 2rem;
    }

    .community-header {
        align-items: flex-start;
        gap: 14px;
        flex-wrap: wrap;
    }

    .community-header .btn-primary {
        min-height: 44px;
    }

    .tv-card {
        height: 190px;
        border-radius: 8px;
        padding: 22px;
    }

    .glass-card {
        border-radius: 8px;
        padding: 18px;
    }

    .post-image-wrapper {
        margin-right: -18px;
        margin-left: -18px;
    }

    .modal {
        padding: max(16px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom));
    }

    .modal-content {
        width: 100%;
        max-height: 88vh;
        overflow-y: auto;
    }

    #search-results-container {
        padding: 14px !important;
    }
}

@media (max-width: 390px) {
    .carousel-copy h1,
    .carousel-copy h2 {
        font-size: 2.3rem;
    }

    .carousel-copy p {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .carousel-dots {
        gap: 7px;
    }

    .carousel-dot {
        width: 20px;
    }
}

@media (max-width: 760px) and (max-height: 620px) {
    .home-carousel {
        min-height: 350px;
    }

    .carousel-copy {
        bottom: 76px;
    }

    .carousel-copy h1,
    .carousel-copy h2 {
        font-size: 2.2rem;
    }

    .carousel-copy p {
        margin: 10px 0 14px;
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }
}

@media (pointer: coarse) {
    .carousel-dot {
        height: 12px;
        background-clip: content-box;
        padding: 4px 0;
    }

    .action-btn {
        min-height: 44px;
    }
}
