/* ========== 基础 ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: linear-gradient(135deg, #0d0d14 0%, #1a1520 50%, #0f1923 100%); min-height: 100vh; overflow-x: hidden; }

/* ========== 粒子背景 ========== */
.particles { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.particle {
    position: absolute; border-radius: 50%;
    background: radial-gradient(circle, rgba(212,168,83,0.3) 0%, transparent 70%);
    animation: floatUp linear infinite;
    opacity: 0;
}
@keyframes floatUp {
    0% { opacity: 0; transform: translateY(100vh) scale(0.5); }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-10vh) scale(1.2); }
}

/* ========== 导航栏 ========== */
.glass-nav {
    background: rgba(13, 13, 20, 0.75);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(212, 168, 83, 0.15);
}

/* ========== 毛玻璃卡片（暗色） ========== */
.glass-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(212, 168, 83, 0.12);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255,255,255,0.05);
    position: relative; overflow: hidden;
}
.glass-card::before {
    content: ''; position: absolute; inset: 0; border-radius: 20px;
    background: linear-gradient(135deg, rgba(212,168,83,0.08) 0%, transparent 50%);
    pointer-events: none;
}

/* ========== 3D 旋转画廊 ========== */
.unit-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    position: relative;
    z-index: 2;
}
.unit-tab {
    min-height: 82px;
    padding: 1rem 1.25rem;
    border-radius: 16px;
    border: 1px solid rgba(212,168,83,0.16);
    background: rgba(255,255,255,0.04);
    color: #c0b8a8;
    text-align: left;
    transition: all 0.3s ease;
}
.unit-tab:hover {
    transform: translateY(-2px);
    border-color: rgba(212,168,83,0.34);
    background: rgba(212,168,83,0.08);
}
.unit-tab.active {
    border-color: #d4a853;
    background: linear-gradient(135deg, rgba(212,168,83,0.18), rgba(255,255,255,0.05));
    box-shadow: 0 10px 28px rgba(0,0,0,0.28), 0 0 20px rgba(212,168,83,0.08);
}
.unit-tab-title {
    display: block;
    color: #e8c36a;
    font-family: 'Noto Serif SC', serif;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
}
.unit-tab-desc {
    display: block;
    margin-top: 0.35rem;
    color: #9ca3af;
    font-size: 0.78rem;
    line-height: 1.45;
}
.resource-tag {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(212,168,83,0.18);
    background: rgba(212,168,83,0.08);
    color: #d8c69f;
    font-size: 0.75rem;
    line-height: 1;
}
.observe-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(116, 151, 128, 0.3);
    background: rgba(116, 151, 128, 0.12);
    color: #c8d7c3;
    font-size: 0.78rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.25s ease;
}
.observe-chip:hover,
.observe-chip.active {
    border-color: rgba(232,195,106,0.65);
    background: rgba(212,168,83,0.18);
    color: #f2d98a;
}
.preview-image-button {
    position: relative;
    display: block;
    width: 100%;
    border: none;
    padding: 0;
    background: transparent;
    overflow: hidden;
}
.preview-image-button img {
    transition: transform 0.35s ease, filter 0.35s ease;
}
.preview-image-button:hover img {
    transform: scale(1.02);
    filter: brightness(1.08);
}
.preview-zoom-note {
    margin-top: 0.5rem;
    color: #9ca3af;
    font-size: 0.78rem;
    line-height: 1.5;
}
.preview-click-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
    cursor: crosshair;
}
.audience-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 4px;
    border-radius: 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(212,168,83,0.12);
}
.audience-btn {
    min-height: 38px;
    border-radius: 10px;
    color: #9ca3af;
    font-size: 0.88rem;
    transition: all 0.25s ease;
}
.audience-btn.active {
    color: #1a1520;
    background: linear-gradient(135deg, #c9953c, #e8c36a);
    font-weight: 700;
}
.zoom-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0,0,0,0.76);
    backdrop-filter: blur(12px);
}
.zoom-panel {
    width: min(1120px, 96vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid rgba(212,168,83,0.18);
    background: rgba(13,13,20,0.95);
    box-shadow: 0 24px 80px rgba(0,0,0,0.55);
}
.zoom-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.zoom-inspector {
    display: grid;
    grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
    gap: 16px;
}
.zoom-context,
.zoom-detail {
    min-width: 0;
}
.zoom-context-image {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(212,168,83,0.12);
    background: rgba(255,255,255,0.04);
}
.zoom-context-image img {
    width: 100%;
    max-height: 62vh;
    object-fit: contain;
    display: block;
}
.zoom-context-box {
    position: absolute;
    z-index: 3;
    border: 2px solid #e8c36a;
    border-radius: 10px;
    background: rgba(232,195,106,0.12);
    box-shadow: 0 0 0 999px rgba(0,0,0,0.28), 0 0 28px rgba(232,195,106,0.35);
}
.zoom-crop {
    height: min(52vh, 460px);
    border-radius: 16px;
    border: 1px solid rgba(212,168,83,0.22);
    background-color: rgba(255,255,255,0.04);
    background-repeat: no-repeat;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), 0 16px 36px rgba(0,0,0,0.28);
}
.zoom-note {
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(116,151,128,0.22);
    background: rgba(116,151,128,0.1);
}
.zoom-note h4 {
    color: #e8c36a;
    font-family: 'Noto Serif SC', serif;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.zoom-note p {
    color: #d8d0c2;
    font-size: 0.92rem;
    line-height: 1.7;
}
.zoom-points {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.zoom-free-tip {
    color: #9ca3af;
    font-size: 0.78rem;
    line-height: 1.4;
}
.zoom-modal.hidden { display: none; }

.masterpiece-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    position: relative;
    z-index: 2;
}
.masterpiece-tile {
    display: grid;
    grid-template-rows: 168px auto;
    min-height: 270px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(212,168,83,0.14);
    background: rgba(255,255,255,0.04);
    color: #d8d0c2;
    text-align: left;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.masterpiece-tile:hover {
    transform: translateY(-4px);
    border-color: rgba(212,168,83,0.42);
    box-shadow: 0 12px 30px rgba(0,0,0,0.34), 0 0 22px rgba(212,168,83,0.08);
}
.masterpiece-thumb {
    width: 100%;
    height: 168px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.22);
    overflow: hidden;
}
.masterpiece-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.empty-thumb {
    color: #6b7280;
    font-size: 0.85rem;
}
.masterpiece-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 13px 14px 15px;
}
.masterpiece-title {
    color: #e8c36a;
    font-family: 'Noto Serif SC', serif;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.35;
}
.masterpiece-meta,
.masterpiece-lesson {
    color: #9ca3af;
    font-size: 0.76rem;
    line-height: 1.4;
}

.carousel-scene {
    perspective: 1000px;
    width: 100%; height: 380px;
    display: flex; align-items: center; justify-content: center;
    position: relative;
    margin-top: 20px;
}
.carousel-ring {
    width: 200px; height: 280px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.carousel-item {
    position: absolute; width: 200px; height: 280px;
    border-radius: 12px; overflow: visible;
}
.carousel-inner {
    width: 100%; height: 100%;
    border-radius: 12px; overflow: hidden;
    cursor: pointer;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    box-shadow: 0 0 30px rgba(0,0,0,0.5), 0 0 60px rgba(212,168,83,0.1);
    position: relative;
}
.carousel-inner::after {
    content: ''; position: absolute; inset: 0;
    border: 2px solid rgba(212, 168, 83, 0.25);
    border-radius: 12px; pointer-events: none;
    transition: border-color 0.3s;
}
.carousel-inner:hover {
    transform: scale(1.12);
    box-shadow: 0 0 40px rgba(0,0,0,0.6), 0 0 80px rgba(212,168,83,0.3);
}
.carousel-inner:hover::after { border-color: rgba(212, 168, 83, 0.7); }
.carousel-inner img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 左右箭头 */
.carousel-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(212, 168, 83, 0.15); border: 1px solid rgba(212,168,83,0.3);
    color: #d4a853; font-size: 1.2rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 10;
    transition: all 0.3s;
}
.carousel-arrow:hover { background: rgba(212,168,83,0.3); box-shadow: 0 0 20px rgba(212,168,83,0.3); }
.carousel-arrow.left { left: 5%; }
.carousel-arrow.right { right: 5%; }

/* ========== 按钮 ========== */
.btn-primary {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #c9953c, #e8c36a);
    color: #1a1520; font-weight: 600;
    border-radius: 14px; border: none; font-size: 0.95rem;
    cursor: pointer; transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(212,168,83,0.3);
    position: relative; overflow: hidden;
}
.btn-primary::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.15) 50%, transparent 70%);
    transform: rotate(45deg) translateX(-100%);
    transition: transform 0.6s;
}
.btn-primary:hover::before { transform: rotate(45deg) translateX(100%); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 30px rgba(212,168,83,0.5); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 2rem;
    background: rgba(255,255,255,0.06); color: #d4a853;
    border: 1px solid rgba(212,168,83,0.3);
    border-radius: 14px; font-weight: 500; font-size: 0.95rem;
    cursor: pointer; transition: all 0.3s;
}
.btn-secondary:hover { background: rgba(212,168,83,0.12); transform: translateY(-1px); }

/* ========== 输入框 ========== */
.input-field {
    width: 100%; padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(212,168,83,0.2);
    border-radius: 14px; font-size: 0.95rem;
    color: #e8e0d4; outline: none;
    transition: all 0.3s;
}
.input-field::placeholder { color: #5a6577; }
.input-field:focus { border-color: #d4a853; box-shadow: 0 0 0 3px rgba(212,168,83,0.1); }

/* ========== 选择卡片 ========== */
.select-card {
    padding: 1.25rem; border-radius: 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(212,168,83,0.1);
    cursor: pointer; transition: all 0.3s; text-align: center;
    position: relative; overflow: hidden;
}
.select-card::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(212,168,83,0.05) 0%, transparent 60%);
    opacity: 0; transition: opacity 0.3s;
}
.select-card:hover { transform: translateY(-3px); border-color: rgba(212,168,83,0.3); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.select-card:hover::before { opacity: 1; }
.select-card.selected { border-color: #d4a853; background: rgba(212,168,83,0.08); }

/* ========== 结果卡片 ========== */
.result-card {
    background: rgba(255,255,255,0.04); border-radius: 16px; padding: 1.25rem;
    border: 1px solid rgba(212,168,83,0.08);
}
.result-label {
    font-size: 0.75rem; font-weight: 700; color: #d4a853;
    text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.5rem;
}

/* ========== 步骤指示器 ========== */
.step-nav { display: flex; align-items: center; gap: 0; }
.step-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: rgba(212,168,83,0.2); border: 1px solid rgba(212,168,83,0.3);
    transition: all 0.4s; cursor: pointer; position: relative; z-index: 1;
}
.step-dot.active { background: #d4a853; box-shadow: 0 0 12px rgba(212,168,83,0.5); width: 12px; height: 12px; }
.step-dot.completed { background: #d4a853; }
.step-line { width: 32px; height: 1px; background: rgba(212,168,83,0.2); }

/* ========== 动画 ========== */
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-in { animation: fadeSlideIn 0.5s ease-out; }

@keyframes spin { to { transform: rotate(360deg); } }
.loading-spinner {
    width: 44px; height: 44px;
    border: 2px solid rgba(212,168,83,0.15);
    border-top-color: #d4a853;
    border-radius: 50%; animation: spin 0.8s linear infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ========== 建议卡片 ========== */
.suggestion-card {
    padding: 0.875rem 1.25rem; border-radius: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(212,168,83,0.1);
    cursor: pointer; transition: all 0.3s;
    display: flex; align-items: center; gap: 0.875rem;
    color: #c0b8a8;
}
.suggestion-card:hover { background: rgba(212,168,83,0.08); border-color: rgba(212,168,83,0.25); }
.suggestion-card.selected { border-color: #d4a853; background: rgba(212,168,83,0.1); color: #e8e0d4; }
.suggestion-card .suggestion-num {
    width: 30px; height: 30px; border-radius: 50%;
    background: rgba(212,168,83,0.15); color: #d4a853;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
}

/* ========== 画廊卡片 ========== */
.gallery-card {
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(212,168,83,0.1);
    border-radius: 20px; overflow: hidden;
    transition: all 0.4s;
}
.gallery-card:hover { transform: translateY(-6px); box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 20px rgba(212,168,83,0.1); border-color: rgba(212,168,83,0.25); }

/* ========== 页面切换 ========== */
.page-section { position: relative; z-index: 1; }
.page-section.entering { animation: fadeSlideIn 0.5s ease-out; }

/* ========== 标题装饰 ========== */
.section-title {
    position: relative; display: inline-block;
}
.section-title::after {
    content: ''; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
    width: 60px; height: 2px;
    background: linear-gradient(90deg, transparent, #d4a853, transparent);
}

@media (max-width: 640px) {
    .unit-tabs { grid-template-columns: 1fr; }
    .zoom-inspector { grid-template-columns: 1fr; }
    .zoom-crop { height: 300px; }
    .carousel-scene { height: 310px; }
    .carousel-ring { width: 160px; height: 230px; }
    .carousel-item { width: 160px; height: 230px; }
    .carousel-arrow.left { left: 0; }
    .carousel-arrow.right { right: 0; }
}
