/* ================= 核心变量 (保持一致) ================= */
:root {
    --primary: #D4AF37; 
    --primary-light: #F4D078;
    --bg-deep: #050505;
    --text-main: #E0E0E0;
    --text-sub: #999;
    --glass-bg: rgba(20, 20, 20, 0.85);
    --border-light: rgba(255, 255, 255, 0.1);
}

body { 
    margin: 0; background: var(--bg-deep); overflow: hidden; 
    font-family: 'Noto Serif SC', 'Rajdhani', sans-serif;
    color: var(--text-main); user-select: none;
}

#webgl { position: fixed; inset: 0; z-index: 0; pointer-events: none; transition: opacity 1s; }

/* ================= UI 装饰 ================= */
.ui-layer { position: fixed; inset: 0; pointer-events: none; z-index: 10; transition: opacity 0.5s; }

.bg-typography {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-family: 'Cinzel', serif; font-weight: 700;
    font-size: 16vw; line-height: 0.8; text-align: center;
    color: rgba(255, 255, 255, 0.02);
    z-index: 1; pointer-events: none; white-space: nowrap;
}

.border-frame { position: absolute; inset: 25px; border: 1px solid rgba(255, 255, 255, 0.04); }
.corner-deco { position: absolute; width: 6px; height: 6px; background: var(--primary); box-shadow: 0 0 8px var(--primary); opacity: 0.8; transition: background 0.5s; }
.cd-tl { top: 25px; left: 25px; } .cd-tr { top: 25px; right: 25px; }
.cd-bl { bottom: 25px; left: 25px; } .cd-br { bottom: 25px; right: 25px; }

/* === 侧边面板 === */
.side-panel {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 260px; display: flex; flex-direction: column; gap: 30px; z-index: 15;
}
.panel-left { left: 6%; text-align: left; }
.panel-right { right: 6%; text-align: right; align-items: flex-end; }

.guide-block { display: flex; align-items: center; gap: 12px; opacity: 0.9; margin-bottom: 10px; }
.guide-arrow { font-size: 20px; color: var(--primary); animation: arrow-bounce 1.5s infinite; }
.guide-text { font-size: 16px; color: #fff; letter-spacing: 2px; font-weight: 600; line-height: 1.2; }
.guide-text span { display: block; font-family: 'Rajdhani'; font-size: 10px; color: #666; letter-spacing: 1px; margin-top: 2px; }

.data-block { padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.data-label { font-size: 11px; color: var(--primary); margin-bottom: 5px; font-weight: 700; letter-spacing: 1px; transition: color 0.5s; text-transform: uppercase; }
.data-value { font-family: 'Noto Serif SC', serif; font-size: 18px; color: #fff; letter-spacing: 1px; font-weight: 600; margin-top: 5px; }
.data-desc { font-size: 12px; line-height: 1.5; color: var(--text-sub); margin-top: 8px; font-weight: 400; }

/* ================= STAGE 1: 罗盘样式 ================= */
#stage-selection {
    position: absolute; inset: 0; z-index: 20;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.wheel-container { 
    position: relative; width: 640px; height: 640px; 
    display: flex; align-items: center; justify-content: center; 
    animation: float 8s ease-in-out infinite; 
}

.svg-wheel { width: 100%; height: 100%; transform-origin: center; cursor: grab; overflow: visible; }
.svg-wheel:active { cursor: grabbing; }

.sector-path { fill: transparent; stroke: rgba(255,255,255,0.06); stroke-width: 1; transition: all 0.3s; }
.sector-text { font-family: 'Noto Serif SC'; pointer-events: none; text-anchor: middle; dominant-baseline: middle; transition: all 0.3s; }

.inner-text { font-size: 16px !important; font-weight: 700 !important; fill: rgba(255, 255, 255, 0.7) !important; letter-spacing: 3px; opacity: 1 !important; transition: fill 0.3s ease; }
.sector-group.active .inner-text { fill: #FFFFFF !important; font-size: 19px !important; text-shadow: 0 0 20px var(--primary); }
.sector-group.active .inner-path { stroke: var(--primary); stroke-width: 2; fill: rgba(255,255,255,0.03); }

.outer-group { cursor: pointer; }
.outer-path { fill: rgba(255,255,255,0.01); stroke: rgba(255,255,255,0.05); }
.outer-text { font-size: 11px; fill: #888; font-weight: 400; letter-spacing: 1px; opacity: 0.1; transition: opacity 0.4s ease, fill 0.3s ease; }
.sector-group.active .outer-text { opacity: 1; fill: #ccc; }
.outer-group:hover .outer-text { opacity: 1; fill: #fff; }
.outer-group:hover .outer-path { fill: rgba(255,255,255,0.08); stroke: rgba(255,255,255,0.3); }
.outer-group.selected .outer-path { fill: var(--primary); stroke: var(--primary); opacity: 0.8; box-shadow: 0 0 15px var(--primary); }
.outer-group.selected .outer-text { fill: #000; font-weight: 700; opacity: 1; }

.wheel-center { 
    position: absolute; width: 160px; height: 160px; border-radius: 50%; 
    background: radial-gradient(circle, #1a1a1a 0%, #050505 100%); 
    border: 1px solid rgba(255,255,255,0.15); box-shadow: 0 0 50px rgba(0,0,0,0.8); 
    display: flex; flex-direction: column; align-items: center; justify-content: center; 
    pointer-events: none; z-index: 10;
}
.wc-label { font-family: 'Rajdhani'; font-size: 10px; color: var(--primary); letter-spacing: 2px; margin-bottom: 5px; opacity: 0.8; }
.wc-main { font-family: 'Noto Serif SC'; font-size: 28px; color: #fff; font-weight: 700; margin-bottom: 5px; }
.indicator { position: absolute; top: 15px; left: 50%; transform: translateX(-50%); width: 1px; height: 90px; z-index: 25; background: linear-gradient(to bottom, var(--primary), transparent); box-shadow: 0 0 10px var(--primary); }

.controls-layer { position: absolute; bottom: 50px; width: 100%; display: flex; flex-direction: column; align-items: center; z-index: 30; }
.glass-panel { width: 550px; padding: 25px 40px; background: var(--glass-bg); border: 1px solid var(--border-light); border-radius: 4px; display: flex; flex-direction: column; align-items: center; }

.mood-wrapper { width: 100%; display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.mood-label-side { font-size: 12px; color: #888; letter-spacing: 2px; width: 60px; text-align: center; }
.mood-track-container { position: relative; flex-grow: 1; margin: 0 20px; height: 40px; display: flex; align-items: center; }
.mood-track { position: absolute; width: 100%; height: 2px; background: rgba(255,255,255,0.1); }
.mood-fill { position: absolute; top: 50%; left: 0; width: 50%; height: 2px; background: var(--primary); box-shadow: 0 0 8px var(--primary); transform: translateY(-50%); }
.mood-knob { position: absolute; top: 50%; left: 50%; width: 12px; height: 12px; background: #fff; border-radius: 50%; transform: translate(-50%, -50%); cursor: grab; box-shadow: 0 0 10px #fff; }
#moodRange { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.mood-percent-display { font-family: 'Rajdhani', monospace; font-size: 24px; color: var(--primary); width: 60px; text-align: right; text-shadow: 0 0 10px rgba(212,175,55,0.3); font-weight: 700; }

.launch-btn { padding: 12px 60px; background: transparent; border: 1px solid var(--primary); color: var(--primary); font-size: 14px; letter-spacing: 4px; cursor: pointer; transition: 0.3s; font-family: 'Rajdhani'; font-weight: 700; }
.launch-btn:hover { background: var(--primary); color: #000; box-shadow: 0 0 25px var(--primary); }

/* ================= STAGE 2: 琥珀漩涡 ================= */
#stage-loading { 
    position: absolute; inset: 0; z-index: 30; display: none; opacity: 0; 
    flex-direction: column; align-items: center; justify-content: center; 
    background: rgba(0,0,0,0.7); backdrop-filter: blur(15px); perspective: 1000px;
}
.vortex-container { position: relative; width: 400px; height: 400px; display: flex; align-items: center; justify-content: center; }
.liquid-core { width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #fff, var(--primary), #000); box-shadow: 0 0 60px var(--primary); z-index: 10; animation: core-pulse 2s ease-in-out infinite alternate; }
.vortex-arm { position: absolute; width: 100%; height: 100%; border-radius: 50%; border: 2px solid transparent; border-top-color: rgba(212, 175, 55, 0.6); border-right-color: rgba(212, 175, 55, 0.1); filter: blur(1px); }
.va-1 { width: 200px; height: 200px; animation: spin 3s linear infinite; }
.va-2 { width: 280px; height: 280px; animation: spin 5s linear infinite reverse; border-top-color: rgba(255,255,255,0.3); border-width: 1px; }
.va-3 { width: 380px; height: 380px; animation: spin 8s linear infinite; border-top-color: var(--primary); border-width: 1px; opacity: 0.5; }
/* 由 JS 控制的粒子环：移除单轴 360° 旋转，改为多方向、平滑漂移（JS 在 selection.js 中实现） */
.gathering-particles { position: absolute; width: 100%; height: 100%; will-change: transform, opacity; pointer-events: none; transform-origin: 50% 50%; transform: translateZ(0) scale(var(--gp-scale, 1)); transition: transform 280ms cubic-bezier(.2,.9,.2,1); }
.g-particle { position: absolute; width: 4px; height: 4px; background: #fff; border-radius: 50%; top: 50%; left: 50%; box-shadow: 0 0 5px #fff; transform-origin: 50% 50%; }
.gp-1 { transform: translate(var(--tx), var(--ty)); }
.gp-2 { transform: translate(var(--tx), var(--ty)); }
.gp-3 { transform: translate(var(--tx), var(--ty)); }

.loading-text-container { margin-top: 50px; text-align: center; z-index: 10; }
.loading-title { font-family: 'Noto Serif SC', serif; font-size: 20px; color: #fff; letter-spacing: 2px; text-shadow: 0 0 20px var(--primary); font-weight: 700; }
.loading-sub { font-family: 'Noto Serif SC', serif; font-size: 14px; color: var(--primary); letter-spacing: 2px; margin-top: 15px; animation: blink 1.5s infinite alternate; }

/* ================= STAGE 3: 结果页 ================= */
#stage-result { position: absolute; inset: 0; z-index: 40; background: transparent; display: none; opacity: 0; grid-template-rows: 70px 1fr 70px; }
.res-header { display: flex; justify-content: space-between; align-items: center; padding: 0 50px; background: rgba(0,0,0,0.9); border-bottom: 1px solid var(--border-light); }
.res-content { display: grid; grid-template-columns: 320px 1fr 320px; padding: 0 50px; align-items: center; gap: 40px; }
.info-box { margin-bottom: 25px; }
.ib-title { font-size: 10px; color: var(--primary); letter-spacing: 2px; margin-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 4px; display: inline-block; }
.ib-text { font-size: 12px; color: #ccc; line-height: 1.6; text-align: justify; }
.ib-list { font-size: 12px; color: #ddd; display: flex; flex-direction: column; gap: 8px; }
.ib-row { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px dashed rgba(255,255,255,0.05); padding-bottom: 4px; }
.label-cn { color: #888; font-weight: 400; font-size: 12px; }
.label-en { font-family: 'Rajdhani'; font-size: 10px; color: #555; margin-left: 4px; text-transform: uppercase; letter-spacing: 1px; }
.val-text { color: #fff; font-weight: 500; text-align: right; }
.val-text small { font-family: 'Rajdhani'; font-size: 10px; color: var(--primary); margin-left: 5px; opacity: 0.8; text-transform: uppercase; }

/* 收藏按钮 */
.fav-btn-container { width: 100%; margin-bottom: 30px; }
.fav-btn {
    position: relative; width: 100%; padding: 12px 0; background: rgba(255, 255, 255, 0.02); border: 1px solid var(--primary); color: var(--primary);
    font-family: 'Noto Serif SC', 'Rajdhani', sans-serif;
    font-weight: 600; font-size: 14px; letter-spacing: 3px; 
    cursor: pointer; transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1); display: flex; align-items: center; justify-content: center; gap: 10px; overflow: hidden;
}
.fav-btn:hover { background: var(--primary); color: #000; box-shadow: 0 0 25px var(--primary); gap: 16px; }
.fav-btn.active { background: transparent; border-color: #fff; color: #fff; }
.fav-btn.active .fav-icon { color: var(--primary); transform: scale(1.2); text-shadow: 0 0 10px var(--primary); }
.fav-icon { font-size: 14px; transition: transform 0.4s ease; margin-bottom: 2px; }

.distillery-card { height: 160px; border: 1px solid var(--border-light); display: block; background: #080808; overflow: hidden; margin-bottom: 10px; position: relative; text-decoration: none; cursor: pointer; }
.distillery-img { width: 100%; height: 100%; object-fit: cover; opacity: 0.7; transition: 0.5s; }
.visit-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); display: flex; flex-direction: column; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s; color: var(--primary); font-family: 'Noto Serif SC'; font-weight: 600; backdrop-filter: blur(3px); }
.distillery-card:hover .visit-overlay { opacity: 1; }
.distillery-card:hover .distillery-img { transform: scale(1.05); opacity: 0.4; }
.distillery-card:hover { border-color: var(--primary); box-shadow: 0 0 15px rgba(212,175,55,0.2); }
.click-hint { text-align: center; font-size: 10px; color: var(--primary); letter-spacing: 1px; opacity: 0.8; margin-bottom: 20px; font-family: 'Rajdhani', sans-serif; }

.center-bottle { text-align: center; position: relative; z-index: 5; }
#bottle-img { max-height: 60vh; width: auto; filter: drop-shadow(0 0 40px rgba(0,0,0,0.8)); animation: floatBottle 6s ease-in-out infinite; }
.res-footer { display: flex; justify-content: center; gap: 60px; align-items: center; background: rgba(0,0,0,0.9); border-top: 1px solid var(--border-light); }
.stat-group { text-align: center; }
.stat-l { font-size: 9px; color: #666; letter-spacing: 1px; }
.stat-v { font-family: 'Rajdhani'; font-size: 18px; color: #fff; font-weight: 600; }

/* ================= 统一弹窗样式 ================= */
.overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.9); backdrop-filter: blur(20px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.5s;
}
.overlay.visible { opacity: 1; pointer-events: auto; }

.modal-box {
    width: 400px; padding: 50px 40px 40px; background: rgba(20, 20, 20, 0.95);
    border: 1px solid var(--primary); box-shadow: 0 0 50px rgba(0,0,0,0.8);
    text-align: center; position: relative; transform: translateY(20px); transition: transform 0.4s;
}
.overlay.visible .modal-box { transform: translateY(0); }

.close-btn { position: absolute; top: 15px; right: 20px; font-size: 24px; color: #666; cursor: pointer; transition: 0.3s; }
.close-btn:hover { color: #fff; transform: rotate(90deg); }
.modal-back-home { position: absolute; top: 15px; left: 15px; padding: 6px 12px; border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.05); font-family: 'Noto Serif SC'; font-size: 12px; color: #888; cursor: pointer; transition: 0.3s; }
.modal-back-home:hover { color: #fff; border-color: var(--primary); }

.auth-title { font-family: 'Noto Serif SC'; font-size: 24px; color: #fff; margin-bottom: 30px; letter-spacing: 2px; font-weight: 700; }
.input-group { margin-bottom: 20px; text-align: left; }
.input-label { font-size: 12px; color: var(--primary); font-family: 'Rajdhani'; letter-spacing: 1px; margin-bottom: 5px; display: block; font-weight: 600; }
.auth-input { width: 100%; padding: 12px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: #fff; font-family: 'Rajdhani'; font-size: 16px; box-sizing: border-box; transition: 0.3s; }
.auth-input:focus { border-color: var(--primary); outline: none; background: rgba(255,255,255,0.08); }
.auth-btn { width: 100%; padding: 12px; background: var(--primary); border: none; color: #000; font-family: 'Rajdhani'; font-weight: 700; font-size: 16px; letter-spacing: 4px; cursor: pointer; margin-top: 10px; transition: 0.3s; position: relative; overflow: hidden; }
.auth-btn:hover { box-shadow: 0 0 30px var(--primary); transform: translateY(-2px); }
.switch-area { margin-top: 30px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.15); font-size: 13px; color: #888; cursor: pointer; display: flex; justify-content: center; gap: 8px; transition: 0.3s; }
.switch-highlight { color: var(--primary); font-weight: 700; font-family: 'Rajdhani'; transition: 0.3s; position: relative; }
.switch-area:hover .switch-highlight { color: var(--primary-light); text-shadow: 0 0 10px rgba(212,175,55,0.6); }
.hidden-panel { display: none !important; }

/* 头像上传样式 */
.avatar-upload { text-align: center; margin-bottom: 25px; }
.avatar-label { cursor: pointer; display: inline-block; transition: 0.3s; position: relative; }
.avatar-preview { width: 90px; height: 90px; border-radius: 50%; border: 2px dashed var(--primary); background: rgba(212, 175, 55, 0.05); margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.upload-hint { font-size: 12px; color: var(--primary); line-height: 1.4; }

/* ================= 成功 Toast ================= */
.toast-notification {
    position: fixed; top: 10%; left: 50%; transform: translate(-50%, -50px);
    background: rgba(198, 166, 100, 0.1); border: 1px solid var(--primary);
    color: #fff; padding: 15px 40px; border-radius: 4px;
    font-family: 'Noto Serif SC'; letter-spacing: 2px;
    box-shadow: 0 0 30px rgba(198, 166, 100, 0.3);
    z-index: 1000; opacity: 0; visibility: hidden; transition: 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    display: flex; align-items: center; gap: 10px; backdrop-filter: blur(5px);
}
.toast-notification.show { opacity: 1; transform: translate(-50%, 0); }
.check-icon { color: var(--primary); font-size: 1.2rem; }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes core-pulse { 0% { transform: scale(0.95); opacity: 0.8; } 100% { transform: scale(1.05); opacity: 1; } }
@keyframes gather { 0% { transform: translate(var(--tx), var(--ty)); opacity: 0; } 50% { opacity: 1; } 100% { transform: translate(0, 0); opacity: 0; } }
@keyframes blink { 0% { opacity: 0.4; } 100% { opacity: 1; } }
@keyframes arrow-bounce { 0%, 100% { transform: translateX(0); opacity: 0.5; } 50% { transform: translateX(5px); opacity: 1; } }
@keyframes floatBottle { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-8px) rotate(1deg); } }
