/* ==========================================================================
   时空档案馆 - Style.css (极致暗黑墨水 / 黄铜古铜金 / 玻璃拟态 / 豪华过渡动效)
   V2 版本 (支持卡片锁定、密码弹窗、移动端完美响应式)
   ========================================================================== */

:root {
    --bg-dark: #050508;
    --bg-deep: #0b0c10;
    --bg-card: rgba(15, 17, 23, 0.7);
    --gold-bright: #f0d59e;
    --gold-mid: #d4af37;
    --gold-dark: #aa7c11;
    --gold-dim: rgba(212, 175, 55, 0.25);
    --gold-glow: rgba(212, 175, 55, 0.15);
    --text-light: #e6e8eb;
    --text-muted: #8a909a;
    
    /* 渐变组合 */
    --brass-grad: linear-gradient(135deg, #f0d59e 0%, #d4af37 40%, #aa7c11 75%, #5e4300 100%);
    --gold-border-grad: linear-gradient(135deg, rgba(240, 213, 158, 0.3) 0%, rgba(212, 175, 55, 0.15) 50%, rgba(170, 124, 17, 0.4) 100%);
    --dark-ink-grad: linear-gradient(180deg, #101216 0%, #07070a 100%);
    --parchment-grad: radial-gradient(circle, #1a1d24 0%, #0f1015 100%);
    
    /* 字体 */
    --font-heading: 'Cinzel', 'Noto Serif SC', serif;
    --font-body: 'Inter', 'Noto Serif SC', sans-serif;
    
    /* 阴影 */
    --shadow-brass: 0 8px 32px rgba(170, 124, 17, 0.15);
    --shadow-inner-brass: inset 0 0 15px rgba(212, 175, 55, 0.2);
    
    --transition-smooth: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-fast: all 0.25s ease;
}

/* ==========================================================================
   基础重置与全局样式
   ========================================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* 隐藏滚动条但保留滚动功能 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--gold-dark);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gold-bright);
}

/* 背景画布 */
#space-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}

/* ==========================================================================
   核心控制与通用元素
   ========================================================================== */

/* 环境音效按钮 */
.ambient-control {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 17, 23, 0.6);
    border: 1px solid var(--gold-dim);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: var(--transition-fast);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}
.ambient-control:hover {
    border-color: var(--gold-mid);
    background: rgba(212, 175, 55, 0.1);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}
.ambient-control span {
    font-size: 11px;
    font-family: var(--font-heading);
    letter-spacing: 1px;
    color: var(--gold-bright);
}
.ambient-control i {
    color: var(--gold-mid);
    font-size: 14px;
}

/* 按钮通用重置 */
button {
    background: none;
    border: none;
    cursor: pointer;
    outline: none;
    color: inherit;
    font-family: inherit;
}

/* 下拉菜单与表单通用 */
select {
    appearance: none;
    background: none;
    border: none;
    outline: none;
    color: inherit;
    font-family: inherit;
    cursor: pointer;
}

/* ==========================================================================
   页面容器与布局
   ========================================================================== */

.app-container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 40px 60px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   主页：顶部 Header
   ========================================================================== */

.archive-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    padding-bottom: 24px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* 浑天仪/星盘微缩 Logo */
.astrolabe-logo {
    width: 50px;
    height: 50px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}
.astrolabe-logo .ring {
    border: 1.5px solid var(--gold-mid);
    border-radius: 50%;
    position: absolute;
    animation: rotateRing 15s linear infinite;
}
.astrolabe-logo .outer-ring {
    width: 50px;
    height: 50px;
    border-color: var(--gold-dark);
    border-style: dashed;
}
.astrolabe-logo .mid-ring {
    width: 38px;
    height: 38px;
    animation-duration: 10s;
    animation-direction: reverse;
    border-color: var(--gold-bright);
}
.astrolabe-logo .inner-ring {
    width: 26px;
    height: 26px;
    animation-duration: 6s;
    border-style: dotted;
}
.astrolabe-logo .center-dot {
    width: 6px;
    height: 6px;
    background: var(--gold-bright);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--gold-mid);
}

@keyframes rotateRing {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.title-group {
    display: flex;
    flex-direction: column;
}
.title-group .eng-title {
    font-family: var(--font-heading);
    font-size: 24px;
    letter-spacing: 3px;
    background: var(--brass-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}
.title-group .sub-title {
    font-family: var(--font-heading);
    font-size: 11px;
    letter-spacing: 6px;
    color: var(--text-muted);
    margin-top: 4px;
}

.archive-status {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.1);
    padding: 6px 16px;
    border-radius: 30px;
}
.archive-status .pulse-dot {
    width: 8px;
    height: 8px;
    background: #00ffcc;
    border-radius: 50%;
    box-shadow: 0 0 8px #00ffcc;
    animation: pulseGlow 2s infinite;
}
.archive-status .status-text {
    font-size: 12px;
    font-family: var(--font-heading);
    color: var(--gold-bright);
    letter-spacing: 1px;
}

@keyframes pulseGlow {
    0% { transform: scale(0.9); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 12px #00ffcc; }
    100% { transform: scale(0.9); opacity: 0.5; }
}

/* ==========================================================================
   主页：伟人卡片展区 (自适应多卡片)
   ========================================================================== */

.deck-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
    flex-grow: 1;
    align-items: center;
}

.hero-card {
    height: 520px;
    position: relative;
    border-radius: 16px;
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(212, 175, 55, 0.15);
    box-shadow: var(--shadow-brass);
    transition: var(--transition-smooth);
    overflow: hidden;
}

/* 卡片流光边框效果 */
.card-border-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    pointer-events: none;
    box-shadow: inset 0 0 20px rgba(212, 175, 55, 0);
    transition: var(--transition-smooth);
    z-index: 2;
}

.hero-card:not(.card-locked):hover {
    transform: translateY(-8px);
    border-color: rgba(240, 213, 158, 0.45);
    box-shadow: 0 15px 45px rgba(170, 124, 17, 0.25);
}
.hero-card:not(.card-locked):hover .card-border-glow {
    box-shadow: inset 0 0 30px rgba(212, 175, 55, 0.15);
}

.card-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px;
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   卡片未锚定/锁定状态 (Coming Soon)
   ========================================================================== */

.hero-card.card-locked {
    border-color: rgba(212, 175, 55, 0.05);
    box-shadow: none;
}

.hero-card.card-locked .portrait-img {
    filter: grayscale(90%) brightness(0.3) contrast(1.1);
}

.hero-card.card-locked .timeline-track,
.hero-card.card-locked .timeline-handle {
    pointer-events: none;
    opacity: 0.3;
}

/* 锁定金色半透明遮罩 */
.locked-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 12, 16, 0.72);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 20;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    transition: var(--transition-smooth);
}

.locked-overlay .lock-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--bg-deep);
    border: 2px solid var(--gold-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--gold-bright);
    font-size: 20px;
    box-shadow: 0 0 15px rgba(170, 124, 17, 0.3);
    transition: var(--transition-fast);
}

.hero-card.card-locked:hover .lock-icon {
    transform: scale(1.1);
    border-color: var(--gold-bright);
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.5);
    color: #fff;
}

/* 斜角“未锚定”条幅 */
.ribbon-soon {
    position: absolute;
    top: 24px;
    right: -32px;
    width: 130px;
    background: linear-gradient(135deg, #aa7c11 0%, #d4af37 50%, #aa7c11 100%);
    border: 1px solid var(--gold-bright);
    color: #050508;
    text-align: center;
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 900;
    padding: 4px 0;
    transform: rotate(45deg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    letter-spacing: 2px;
}

/* ==========================================================================
   肖像显示区与 PNG 载体
   ========================================================================== */

.portrait-section {
    width: 100%;
    height: 210px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-deep);
    border: 1px solid rgba(212, 175, 55, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-inner-brass);
}

.img-holder {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition-smooth);
}
.hero-card:not(.card-locked):hover .img-holder {
    transform: scale(1.05);
}

.portrait-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
    transition: var(--transition-smooth);
}
.hero-card:not(.card-locked):hover .portrait-img {
    opacity: 1;
}

/* 人物粒子漂移效果 */
.ambient-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

/* 时间标签 */
.time-stamp {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(11, 12, 16, 0.85);
    border: 1px solid var(--gold-dark);
    padding: 4px 12px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    z-index: 3;
}
.time-stamp .era-label {
    font-family: var(--font-heading);
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--gold-bright);
    font-weight: bold;
    transition: var(--transition-fast);
}

/* 介绍文字区 */
.info-section {
    margin: 16px 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.hero-name {
    margin-bottom: 12px;
}
.hero-name .eng-name {
    font-family: var(--font-heading);
    font-size: 18px;
    letter-spacing: 1px;
    color: var(--gold-bright);
    font-weight: 700;
}
.hero-name .chn-name {
    font-family: var(--font-heading);
    font-size: 12px;
    letter-spacing: 3px;
    color: var(--text-muted);
    margin-top: 2px;
}

.bio-frame {
    border-left: 2px solid var(--gold-dark);
    padding-left: 12px;
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 4px;
}
.bio-frame .node-title {
    font-family: var(--font-heading);
    font-size: 14px;
    color: var(--gold-mid);
    margin-bottom: 8px;
    letter-spacing: 1px;
    transition: var(--transition-fast);
}
.bio-frame .node-desc {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-light);
    opacity: 0.85;
    text-align: justify;
    transition: var(--transition-fast);
}

/* ==========================================================================
   人生进度条 (Life Timeline)
   ========================================================================== */

.timeline-wrapper {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(212, 175, 55, 0.1);
}

.timeline-track {
    height: 4px;
    background: rgba(212, 175, 55, 0.15);
    border-radius: 2px;
    position: relative;
    margin: 15px 0 10px 0;
    cursor: pointer;
}

.timeline-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--brass-grad);
    border-radius: 2px;
    pointer-events: none;
    transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.timeline-node {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-deep);
    border: 2px solid var(--gold-dark);
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    transition: var(--transition-fast);
}
.timeline-node:hover {
    transform: translate(-50%, -50%) scale(1.3);
    border-color: var(--gold-bright);
    box-shadow: 0 0 10px var(--gold-mid);
}
.timeline-node.active {
    border-color: var(--gold-bright);
    background: var(--gold-bright);
    box-shadow: 0 0 12px var(--gold-mid);
}

/* 进度条滑块手柄 */
.timeline-handle {
    width: 24px;
    height: 24px;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    cursor: grab;
    transition: left 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.timeline-handle:active {
    cursor: grabbing;
}
.timeline-handle .handle-gear {
    width: 100%;
    height: 100%;
    background: var(--bg-deep);
    border: 1.5px solid var(--gold-mid);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 8px rgba(212,175,55,0.4);
    color: var(--gold-bright);
    font-size: 11px;
}
.timeline-handle .handle-gear i {
    animation: slowSpin 10s linear infinite;
}

@keyframes slowSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.timeline-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 2px;
}
.timeline-labels span {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
    transition: var(--transition-fast);
}
.timeline-labels span.active-label {
    color: var(--gold-bright);
    font-weight: bold;
    text-shadow: 0 0 8px rgba(240, 213, 158, 0.4);
}

/* ==========================================================================
   主页：底部时空隧道接入控制台
   ========================================================================== */

.portal-console {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    height: 120px;
    margin-top: 20px;
}

.console-decor {
    flex-grow: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0) 0%, rgba(212, 175, 55, 0.25) 50%, rgba(212, 175, 55, 0) 100%);
    position: relative;
}
.console-decor::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border: 1px solid var(--gold-dark);
    background: var(--bg-dark);
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}
.decor-left::after { right: 40px; }
.decor-right::after { left: 40px; }

.portal-trigger-wrapper {
    position: relative;
    padding: 0 40px;
}

/* 浑天仪/星盘风格的启动按钮 */
.portal-btn {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: var(--bg-deep);
    border: 2px solid var(--gold-dark);
    box-shadow: 0 0 30px rgba(170, 124, 17, 0.25), inset 0 0 20px rgba(212, 175, 55, 0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: var(--transition-smooth);
    z-index: 5;
    margin-top: -30px;
}

.portal-btn-ring {
    position: absolute;
    border: 1px dashed var(--gold-mid);
    border-radius: 50%;
    pointer-events: none;
    transition: var(--transition-smooth);
}
.portal-btn-ring.ring-1 {
    width: 124px;
    height: 124px;
    animation: rotateRing 20s linear infinite;
    opacity: 0.6;
}
.portal-btn-ring.ring-2 {
    width: 108px;
    height: 108px;
    animation: rotateRing 12s linear infinite reverse;
    opacity: 0.4;
    border-style: dotted;
}

.portal-btn-gear {
    font-size: 24px;
    color: var(--gold-bright);
    margin-bottom: 6px;
    transition: var(--transition-smooth);
    text-shadow: 0 0 8px var(--gold-mid);
}

.portal-btn-text {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    color: var(--gold-bright);
    letter-spacing: 2px;
}
.portal-btn-sub {
    font-size: 8px;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-top: 4px;
}

/* 悬停动画 */
.portal-btn:hover {
    border-color: var(--gold-bright);
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.5), inset 0 0 30px rgba(212, 175, 55, 0.2);
    transform: scale(1.05);
}
.portal-btn:hover .portal-btn-ring.ring-1 {
    animation-duration: 5s;
    opacity: 0.9;
}
.portal-btn:hover .portal-btn-ring.ring-2 {
    animation-duration: 3s;
    opacity: 0.8;
}
.portal-btn:hover .portal-btn-gear {
    transform: rotate(180deg);
    color: #fff;
    text-shadow: 0 0 15px var(--gold-bright);
}

/* ==========================================================================
   时空共振密码验证弹窗 (.password-box)
   ========================================================================== */

.password-box {
    background: radial-gradient(circle, #181b22 0%, #0c0d12 100%);
    border: 2px solid var(--gold-dark);
    border-radius: 12px;
    padding: 36px;
    width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 30px rgba(170, 124, 17, 0.25);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: zoomFadeIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pwd-gear-decor {
    font-size: 32px;
    color: var(--gold-mid);
    margin-bottom: 12px;
    animation: slowSpin 20s linear infinite;
    text-shadow: 0 0 10px rgba(212,175,55,0.4);
}

.pwd-desc {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.pwd-input-wrapper {
    width: 100%;
    position: relative;
    margin-bottom: 8px;
}

.pwd-input-wrapper input {
    width: 100%;
    background: #050508;
    border: 1.5px solid var(--gold-dark);
    border-radius: 4px;
    padding: 12px 16px;
    color: var(--gold-bright);
    font-family: var(--font-heading);
    font-size: 16px;
    letter-spacing: 3px;
    text-align: center;
    outline: none;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.8);
    transition: var(--transition-fast);
}

.pwd-input-wrapper input:focus {
    border-color: var(--gold-bright);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.8), 0 0 15px rgba(212, 175, 55, 0.35);
}

.pwd-error-hint {
    color: #ff5555;
    font-size: 11px;
    min-height: 16px;
    margin-bottom: 15px;
    font-weight: bold;
}

.pwd-buttons {
    display: flex;
    width: 100%;
    gap: 15px;
    margin-bottom: 15px;
}

.pwd-btn {
    flex: 1;
    padding: 10px;
    border-radius: 4px;
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    transition: var(--transition-fast);
}

.pwd-btn.cancel {
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--text-muted);
}
.pwd-btn.cancel:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-light);
}

.pwd-btn.confirm {
    background: var(--brass-grad);
    color: #050508;
    border: 1px solid var(--gold-bright);
    box-shadow: 0 4px 12px rgba(170,124,17,0.3);
}
.pwd-btn.confirm:hover {
    box-shadow: 0 4px 18px rgba(212,175,55,0.5);
    filter: brightness(1.08);
}

.resonance-tip {
    font-size: 9px;
    color: var(--text-muted);
}

/* 密码错误抖动动画 */
.shake-anim {
    animation: shakeEffect 0.4s ease-in-out;
}

@keyframes shakeEffect {
    0%, 100% { transform: translateX(0); }
    15%, 45%, 75% { transform: translateX(-8px); }
    30%, 60%, 90% { transform: translateX(8px); }
}

@keyframes zoomFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   写信沙盘页面 Header
   ========================================================================== */

.sandbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    padding-bottom: 20px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 17, 23, 0.6);
    border: 1px solid var(--gold-dark);
    padding: 8px 18px;
    border-radius: 4px;
    color: var(--gold-bright);
    font-family: var(--font-heading);
    font-size: 11px;
    letter-spacing: 1.5px;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-brass);
}
.back-btn:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--gold-bright);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}
.back-btn i {
    font-size: 14px;
    transition: var(--transition-fast);
}
.back-btn:hover i {
    transform: translateX(-4px);
}

.sandbox-title {
    text-align: center;
}
.sandbox-title h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    letter-spacing: 2px;
    background: var(--brass-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.sandbox-title p {
    font-size: 9px;
    color: var(--text-muted);
    letter-spacing: 2px;
    margin-top: 4px;
}

.mailbox-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.15);
    padding: 8px 16px;
    border-radius: 4px;
    font-family: var(--font-heading);
    font-size: 12px;
    color: var(--gold-bright);
}
.mailbox-indicator i {
    color: var(--gold-mid);
}

/* ==========================================================================
   沙盘工作台布局
   ========================================================================== */

.sandbox-workspace {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 40px;
    margin-bottom: 40px;
    align-items: stretch;
}

.panel-heading {
    font-family: var(--font-heading);
    font-size: 14px;
    letter-spacing: 1.5px;
    color: var(--gold-bright);
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    padding-bottom: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 左侧：时空传动舱 (Chamber) */
.chamber-card {
    background: var(--bg-card);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-brass);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* 机械表盘倒计时 */
.astrolabe-clock {
    width: 160px;
    height: 160px;
    margin: 0 auto 20px auto;
    border: 3px solid var(--gold-dark);
    border-radius: 50%;
    position: relative;
    background: var(--bg-deep);
    box-shadow: inset 0 0 15px rgba(0,0,0,0.8), 0 0 15px rgba(212,175,55,0.15);
}
.clock-face {
    width: 100%;
    height: 100%;
    position: relative;
}
.clock-face::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--gold-bright);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

/* 指针 */
.clock-face .hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    background: var(--gold-mid);
    border-radius: 2px;
}
.clock-face .hour-hand {
    width: 3.5px;
    height: 40px;
    margin-left: -1.75px;
    background: var(--gold-dark);
    transform: rotate(120deg);
}
.clock-face .minute-hand {
    width: 2.5px;
    height: 55px;
    margin-left: -1.25px;
    transform: rotate(45deg);
}
.clock-face .second-hand {
    width: 1px;
    height: 65px;
    margin-left: -0.5px;
    background: #ff5555;
    transform: rotate(270deg);
}

/* 数字倒计时显示 */
.digital-countdown {
    position: absolute;
    width: 100%;
    text-align: center;
    bottom: 24px;
    left: 0;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: bold;
    color: var(--gold-bright);
    text-shadow: 0 0 8px rgba(240, 213, 158, 0.6);
    letter-spacing: 1px;
}

/* 邮寄状态说明 */
.post-status-box {
    background: rgba(11, 12, 16, 0.6);
    border: 1px solid rgba(212,175,55,0.1);
    border-radius: 6px;
    padding: 12px;
    text-align: center;
    margin-bottom: 20px;
}
.status-badge {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 10px;
    letter-spacing: 1px;
    padding: 3px 10px;
    border-radius: 3px;
    font-weight: bold;
    margin-bottom: 6px;
}
.status-badge.idle {
    background: rgba(0, 255, 204, 0.1);
    border: 1.5px solid #00ffcc;
    color: #00ffcc;
}
.status-badge.transit {
    background: rgba(255, 170, 0, 0.1);
    border: 1.5px solid #ffaa00;
    color: #ffaa00;
    animation: pulseTransit 1.5s infinite;
}
.status-badge.ready {
    background: rgba(212, 175, 55, 0.1);
    border: 1.5px solid var(--gold-mid);
    color: var(--gold-bright);
    box-shadow: 0 0 10px rgba(212,175,55,0.3);
}

@keyframes pulseTransit {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

.post-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* 时空加速器面板 */
.accelerator-panel {
    background: rgba(11, 12, 16, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.1);
    border-radius: 6px;
    padding: 14px;
    margin-bottom: 20px;
}
.accel-header {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.accel-val {
    color: var(--gold-bright);
    font-weight: bold;
}

/* 旋纽 */
.dial-container {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
}
.rotary-switch {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-deep);
    border: 3px solid var(--gold-dark);
    position: relative;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.rotary-switch::before {
    content: '';
    position: absolute;
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border-radius: 50%;
    border: 1px dashed rgba(212,175,55,0.4);
}
.switch-pointer {
    position: absolute;
    width: 4px;
    height: 20px;
    background: var(--gold-bright);
    top: 4px;
    left: 50%;
    margin-left: -2px;
    border-radius: 2px;
    transform-origin: bottom center;
    transition: var(--transition-smooth);
}
.switch-labels {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.switch-labels span {
    font-size: 10px;
    font-family: var(--font-heading);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}
.switch-labels span.active {
    color: var(--gold-bright);
    font-weight: bold;
    text-shadow: 0 0 6px var(--gold-mid);
}

.accel-tip {
    font-size: 9px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* 邮槽 Chute */
.mailbox-slot-wrapper {
    margin-bottom: 20px;
}
.mailbox-slot {
    height: 48px;
    border-radius: 6px;
    background: #0f1015;
    border: 2px solid var(--gold-dark);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.9);
    transition: var(--transition-fast);
}
.slot-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #aa7c11 0%, #3e2b00 100%);
    border-bottom: 1.5px solid var(--gold-bright);
    transform-origin: top center;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 2;
}
.slot-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(212,175,55,0.4) 0%, rgba(212,175,55,0) 80%);
    opacity: 0;
    transition: var(--transition-fast);
    z-index: 1;
}
.slot-label {
    position: absolute;
    width: 100%;
    text-align: center;
    font-family: var(--font-heading);
    font-size: 10px;
    letter-spacing: 3px;
    color: rgba(255,255,255,0.5);
    line-height: 44px;
    z-index: 3;
    pointer-events: none;
}

/* 邮槽交互激活 */
.mailbox-slot.hover-ready {
    border-color: var(--gold-bright);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.9), 0 0 15px rgba(212,175,55,0.3);
}
.mailbox-slot.hover-ready .slot-glow {
    opacity: 1;
}
.mailbox-slot.open-active .slot-flap {
    transform: rotateX(-75deg);
}

.slot-helper-text {
    display: block;
    text-align: center;
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* 收信槽 */
.inbox-drawer {
    height: 50px;
    border-radius: 6px;
    background: rgba(11, 12, 16, 0.8);
    border: 1px solid rgba(212,175,55,0.2);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 15px;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.inbox-drawer .drawer-handle {
    width: 24px;
    height: 24px;
    border: 1.5px solid var(--gold-dark);
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--gold-mid);
    background: var(--bg-deep);
    transition: var(--transition-fast);
}
.inbox-drawer .drawer-text {
    font-family: var(--font-heading);
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

/* 有待收信件的状态 */
.inbox-drawer.mail-waiting {
    border-color: var(--gold-bright);
    background: rgba(212,175,55,0.12);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
    animation: pulseWaiting 2s infinite;
}
.inbox-drawer.mail-waiting .drawer-handle {
    background: var(--gold-mid);
    color: var(--bg-deep);
    border-color: var(--gold-bright);
    box-shadow: 0 0 8px var(--gold-bright);
}
.inbox-drawer.mail-waiting .drawer-text {
    color: var(--gold-bright);
    font-weight: bold;
}

@keyframes pulseWaiting {
    0% { box-shadow: 0 0 10px rgba(212, 175, 55, 0.2); }
    50% { box-shadow: 0 0 20px rgba(212, 175, 55, 0.5); }
    100% { box-shadow: 0 0 10px rgba(212, 175, 55, 0.2); }
}

/* ==========================================================================
   右侧：写信与读信面板
   ========================================================================== */

.correspondence-desk {
    position: relative;
}

.desk-card {
    background: var(--bg-card);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-brass);
    min-height: 520px;
    display: flex;
    flex-direction: column;
}

.recipient-selector-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 24px;
}
.recipient-selector-bar label {
    font-family: var(--font-heading);
    font-size: 12px;
    color: var(--gold-bright);
    letter-spacing: 1px;
}

.custom-select-wrapper {
    position: relative;
    flex-grow: 1;
}
.custom-select-wrapper select {
    width: 100%;
    background: var(--bg-deep);
    border: 1px solid var(--gold-dark);
    padding: 10px 16px;
    border-radius: 4px;
    color: var(--gold-bright);
    font-family: var(--font-heading);
    font-size: 12px;
    letter-spacing: 1px;
}
.custom-select-wrapper select option:disabled {
    color: rgba(255,255,255,0.2) !important;
    background: #050508;
}
.custom-select-wrapper::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold-mid);
    pointer-events: none;
}

/* ==========================================================================
   拟真复古信纸 (Parchment Paper)
   ========================================================================== */

.parchment-container {
    flex-grow: 1;
    position: relative;
    border-radius: 8px;
    padding: 2px;
    background: var(--gold-border-grad);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    display: flex;
}

.parchment-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    pointer-events: none;
    box-shadow: inset 0 0 30px rgba(212, 175, 55, 0.05);
    z-index: 2;
}

.parchment-paper {
    flex-grow: 1;
    background: var(--parchment-grad);
    border-radius: 6px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    height: 480px; /* 强制固定信纸卡片整体高度 */
}

.parchment-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed rgba(212, 175, 55, 0.2);
    padding-bottom: 12px;
    margin-bottom: 20px;
}
.parchment-logo {
    font-family: var(--font-heading);
    font-size: 11px;
    letter-spacing: 3px;
    color: var(--gold-bright);
    font-weight: bold;
}
.date-stamp {
    font-family: var(--font-heading);
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.parchment-input {
    flex: 1 1 auto; /* 允许在伸缩空间中填充 */
    overflow-y: auto; /* 文本框自适应滚动 */
    background: none;
    border: none;
    outline: none;
    resize: none;
    color: #e5c17d;
    font-family: 'Noto Serif SC', serif;
    font-size: 14px;
    line-height: 1.8;
    text-shadow: 0 0 3px rgba(229, 193, 125, 0.25);
    margin-bottom: 20px;
}
.parchment-input::placeholder {
    color: rgba(229, 193, 125, 0.35);
    text-shadow: none;
}

.parchment-input:disabled {
    color: rgba(229, 193, 125, 0.45);
}

.parchment-footer {
    flex: 0 0 auto; /* 禁止缩放变形 */
    height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed rgba(212, 175, 55, 0.15);
    padding-top: 15px;
}
.sender-sig {
    font-family: 'Noto Serif SC', serif;
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

/* ==========================================================================
   盖火漆章动效
   ========================================================================== */

.wax-seal-wrapper {
    position: relative;
    width: 130px;
    height: 42px;
}

.seal-stamp-btn {
    width: 100%;
    height: 100%;
    background: var(--bg-deep);
    border: 1.5px solid var(--gold-dark);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-fast);
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}
.seal-stamp-btn:hover {
    border-color: var(--gold-bright);
    background: rgba(212, 175, 55, 0.1);
    box-shadow: 0 0 12px rgba(212,175,55,0.3);
}
.seal-stamp-btn .seal-icon {
    font-size: 16px;
    color: var(--gold-mid);
}
.seal-stamp-btn .btn-text {
    font-family: var(--font-heading);
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--gold-bright);
    font-weight: 700;
}

/* 读信模式 */
.parchment-container.reply-mode .parchment-paper {
    background: radial-gradient(circle, #18191f 0%, #0d0e12 100%);
}
.parchment-content-read {
    flex: 1 1 auto; /* 占据中心伸缩空间 */
    overflow-y: auto; /* 强制生成正文区域的独立垂直滚动条 */
    font-family: 'Noto Serif SC', serif;
    font-size: 13.5px;
    line-height: 1.8;
    color: var(--text-light);
    text-shadow: 0 0 2px rgba(255,255,255,0.1);
    padding-right: 8px;
    margin-bottom: 20px;
    white-space: pre-wrap;
    text-align: justify;
}

/* 3D 弹出框信纸尺寸约束 */
.lightbox-parchment {
    height: 450px !important;
    display: flex;
    flex-direction: column;
}

.replied-wax-seal {
    width: 44px;
    height: 44px;
    background: radial-gradient(circle, #aa2c2c 0%, #660f0f 100%);
    border: 2px solid #ff7777;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffcccc;
    font-family: var(--font-heading);
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5), inset 0 0 5px rgba(255,255,255,0.4);
    transform: rotate(-15deg);
    position: relative;
    user-select: none;
}
.replied-wax-seal::after {
    content: '';
    position: absolute;
    top: 5%;
    left: 5%;
    width: 90%;
    height: 90%;
    border-radius: 50%;
    border: 1px dashed rgba(255,255,255,0.25);
}

.read-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.read-close-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg-deep);
    border: 1px solid rgba(212,175,55,0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    transition: var(--transition-fast);
}
.read-close-btn:hover {
    color: var(--gold-bright);
    border-color: var(--gold-bright);
    transform: rotate(90deg);
}

/* ==========================================================================
   历史信箱长廊 (Codex History Gallery)
   ========================================================================== */

.history-gallery {
    margin-top: 40px;
    background: var(--bg-card);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-brass);
}

.codex-gallery-viewport {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    padding: 10px 4px 20px 4px;
    min-height: 140px;
    align-items: center;
}

/* 占位提示 */
.codex-placeholder {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    padding: 30px 0;
    gap: 12px;
}
.codex-placeholder i {
    font-size: 28px;
    color: rgba(212, 175, 55, 0.25);
}
.codex-placeholder p {
    font-size: 12px;
    letter-spacing: 1px;
}

/* 历史信封小卡片 */
.codex-envelope {
    width: 180px;
    height: 110px;
    background: linear-gradient(135deg, #16181f 0%, #0d0f13 100%);
    border: 1.5px solid var(--gold-dark);
    border-radius: 6px;
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    transition: var(--transition-smooth);
    overflow: hidden;
}

.codex-envelope:hover {
    transform: translateY(-5px) scale(1.03);
    border-color: var(--gold-bright);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
}

.codex-envelope::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-top: 50px solid rgba(212, 175, 55, 0.15);
    border-right: 90px solid transparent;
    border-left: 90px solid transparent;
    z-index: 1;
    pointer-events: none;
}

.codex-env-header {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    position: relative;
    z-index: 2;
}
.codex-env-tag {
    font-family: var(--font-heading);
    font-size: 8px;
    background: rgba(212,175,55,0.15);
    color: var(--gold-bright);
    padding: 2px 6px;
    border-radius: 3px;
    border: 0.5px solid var(--gold-dark);
}
.codex-stamp {
    width: 20px;
    height: 24px;
    border: 1px dashed rgba(212,175,55,0.4);
    background: rgba(0,0,0,0.3);
    border-radius: 2px;
}

.codex-env-body {
    padding: 10px;
    margin-top: 6px;
}
.codex-env-title {
    font-size: 10px;
    font-weight: bold;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.codex-env-time {
    font-size: 8px;
    color: var(--text-muted);
    margin-top: 4px;
}

.codex-env-seal {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: radial-gradient(circle, #991f1f 0%, #550a0a 100%);
    border: 1px solid #ff5555;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffcccc;
    font-family: var(--font-heading);
    font-size: 8px;
    font-weight: bold;
    transform: rotate(-10deg);
}

/* ==========================================================================
   3D 翻转信件灯箱 (Lightbox)
   ========================================================================== */

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 3, 5, 0.85);
    z-index: 1000;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.lightbox-overlay.active {
    opacity: 1;
}

.lightbox-content {
    width: 650px;
    height: 480px;
    perspective: 1200px;
}

.letter-3d-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

.letter-card-3d {
    width: 100%;
    height: 100%;
    position: absolute;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 翻转激活状态 */
.letter-card-3d.flipped {
    transform: rotateY(180deg);
}

.letter-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.8);
}

/* 正面：信封外观 */
.envelope-front {
    background: linear-gradient(135deg, #1c1e26 0%, #0c0d12 100%);
    border: 3px solid var(--gold-dark);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px;
    position: relative;
}

.envelope-front::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-top: 180px solid rgba(212, 175, 55, 0.08);
    border-right: 282px solid transparent;
    border-left: 282px solid transparent;
    z-index: 1;
    pointer-events: none;
}

.postage-stamp {
    position: absolute;
    top: 30px;
    right: 40px;
    width: 60px;
    height: 75px;
    border: 2px dashed rgba(212,175,55,0.4);
    background: rgba(0,0,0,0.3);
    border-radius: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.postage-stamp::after {
    content: '\f0ac';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 24px;
    color: rgba(212,175,55,0.25);
}

.envelope-address {
    margin-top: 80px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 2;
}
.address-line {
    font-family: var(--font-heading);
    border-bottom: 1.5px solid rgba(212, 175, 55, 0.2);
    padding-bottom: 8px;
    letter-spacing: 1px;
}
.address-line.recipient {
    font-size: 16px;
    color: var(--gold-bright);
    font-weight: bold;
}
.address-line.sender {
    font-size: 12px;
    color: var(--text-muted);
}
.address-line.coord {
    font-size: 11px;
    color: var(--gold-dark);
    border-bottom: none;
}

.envelope-seal-point {
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 2;
}
.lightbox-wax-seal {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #bb2c2c 0%, #770f0f 100%);
    border: 3px solid #ff8888;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffcccc;
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: bold;
    transform: rotate(-10deg);
}

.envelope-flip-tip {
    position: absolute;
    width: 100%;
    text-align: center;
    bottom: 15px;
    left: 0;
    font-size: 10px;
    font-family: var(--font-heading);
    color: var(--text-muted);
    letter-spacing: 2px;
    animation: bounceTip 2s infinite;
}

@keyframes bounceTip {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* 背面：信件内容 */
.letter-back {
    transform: rotateY(180deg);
    background: var(--bg-deep);
    border: 2px solid var(--gold-dark);
}

.lightbox-parchment {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, #1e2129 0%, #0f1015 100%) !important;
    padding: 40px !important;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
    z-index: 10;
}
.lightbox-close:hover {
    color: var(--gold-bright);
    transform: rotate(90deg);
}

/* ==========================================================================
   时空跃迁特效蒙层 (Hyperdrive Warp)
   ========================================================================== */

.hyperdrive-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.warp-effect {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(212,175,55,0.2) 0%, rgba(0,0,0,1) 80%);
    z-index: 1;
}

.chronometer-indicator {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.warning-text {
    font-family: var(--font-heading);
    font-size: 16px;
    color: var(--gold-bright);
    letter-spacing: 5px;
    animation: flashAlert 1.5s infinite;
}

.time-coordinates {
    font-family: var(--font-heading);
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 2px;
}

.warp-progress-bar {
    width: 300px;
    height: 2px;
    background: rgba(212, 175, 55, 0.15);
    border-radius: 1px;
    overflow: hidden;
    margin-top: 10px;
}

.warp-progress-fill {
    width: 0%;
    height: 100%;
    background: var(--brass-grad);
    box-shadow: 0 0 10px var(--gold-bright);
    transition: width 2.5s cubic-bezier(0.1, 0.8, 0.3, 1);
}

@keyframes flashAlert {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; text-shadow: 0 0 15px var(--gold-mid); }
}

/* ==========================================================================
   移动手机版完美适配优化 (V2 重磅新增)
   ========================================================================== */

@media (max-width: 768px) {
    /* 通用容器缩进 */
    .app-container {
        padding: 20px 15px;
    }
    
    /* 档案馆卡片一律堆叠展示，并伴有弹性轻量交互感 */
    .deck-container {
        grid-template-columns: 1fr;
        gap: 25px;
        margin-bottom: 30px;
    }
    
    .hero-card {
        height: 490px; /* 轻量调整卡片高度 */
    }
    
    .hero-card:active:not(.card-locked) {
        transform: scale(0.98); /* 增加手机触摸弹性反馈 */
    }

    .portrait-section {
        height: 180px; /* 降低图片部分所占高度，留给字库 */
    }

    /* 顶部导航栏微缩化 */
    .archive-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
        padding-bottom: 16px;
        margin-bottom: 25px;
    }
    
    .archive-status {
        align-self: stretch;
        justify-content: center;
    }
    
    /* 密码验证盒子适配 */
    .password-box {
        width: 90%;
        padding: 24px;
    }
    
    /* 沙盘工作台大布局：左边传动舱与右侧信纸在手机端上下垂直排列 */
    .sandbox-workspace {
        grid-template-columns: 1fr;
        gap: 24px;
        margin-bottom: 25px;
    }
    
    /* 调整两块区域的阅读顺序 */
    .transmission-chamber {
        order: 2; /* 传动舱置于下层方便做加速操作和看回信 */
    }
    .correspondence-desk {
        order: 1; /* 信纸置顶让写信最先看到 */
    }
    
    .desk-card {
        padding: 20px;
        min-height: 420px;
    }
    
    /* 精巧缩减信纸边距、输入框与字体，防横向溢出 */
    .parchment-paper {
        padding: 20px 16px;
    }
    
    .parchment-header {
        margin-bottom: 12px;
    }
    
    .parchment-input {
        font-size: 13px; /* 缩小打字文字 */
        line-height: 1.6;
        min-height: 180px;
    }
    
    .parchment-content-read {
        font-size: 13px;
        line-height: 1.6;
    }

    .recipient-selector-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 16px;
    }
    
    .custom-select-wrapper {
        width: 100%;
    }

    /* 倒计时机械表盘微调 */
    .astrolabe-clock {
        width: 140px;
        height: 140px;
    }
    
    .digital-countdown {
        font-size: 13px;
        bottom: 18px;
    }
    
    /* 3D信件查看灯箱自适应 */
    .lightbox-content {
        width: 94%;
        height: 420px;
    }
    
    .envelope-front {
        padding: 25px 20px;
    }
    
    .postage-stamp {
        display: none; /* 手机端隐藏邮票占位防止重叠 */
    }
    
    .envelope-address {
        margin-top: 50px;
        gap: 8px;
    }
    
    .address-line.recipient {
        font-size: 14px;
    }
    
    .lightbox-parchment {
        padding: 25px 20px !important;
    }

    /* 历史长廊适配 */
    .history-gallery {
        padding: 16px;
    }
    
    .codex-gallery-viewport {
        gap: 15px;
    }
    
    .codex-envelope {
        width: 150px;
        height: 95px;
    }
    
    .codex-env-body {
        padding: 8px;
    }
    
    .codex-env-title {
        font-size: 9px;
    }
}
