/* ============================================================
   index.css - 所有样式集中管理
   修改样式只需编辑此文件
   ============================================================ */

/* ===== 全局重置 ===== */
* {
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

body {
    background: #0e1321;
    color: #dee2f6;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    padding-bottom: env(safe-area-inset-bottom);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== 颜色系统 ===== */
.bg-surface { background: #0e1321; }
.bg-surface-container { background: #1a1f2e; }
.bg-surface-container-lowest { background: #090e1c; }
.bg-surface-container-lowest\/30 { background: rgba(9, 14, 28, 0.3); }
.text-on-surface { color: #dee2f6; }
.text-on-surface-variant { color: #b9cacb; }
.text-primary { color: #e1fdff; }
.text-primary-container { color: #00f2ff; }
.text-tertiary-fixed-dim { color: #00e475; }
.border-primary-container\/20 { border-color: rgba(0, 242, 255, 0.2); }
.border-white\/5 { border-color: rgba(255, 255, 255, 0.05); }
.border-white\/10 { border-color: rgba(255, 255, 255, 0.1); }
.border-white\/20 { border-color: rgba(255, 255, 255, 0.2); }
.bg-primary-container { background: #00f2ff; }
.bg-primary-container\/10 { background: rgba(0, 242, 255, 0.1); }
.bg-tertiary-container { background: #37fa87; }
.text-on-primary-container { color: #006a71; }
.text-on-tertiary-container { color: #006f35; }
.bg-slate-950 { background: #020617; }
.bg-slate-950\/80 { background: rgba(2, 6, 23, 0.8); }
.bg-white\/5 { background: rgba(255, 255, 255, 0.05); }
.bg-white\/10 { background: rgba(255, 255, 255, 0.1); }
.bg-primary-fixed-dim\/10 { background: rgba(0, 219, 231, 0.1); }

/* ===== 玻璃卡片 ===== */
.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.active-glass {
    border: 1px solid rgba(0, 219, 231, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

/* ===== 发光效果 ===== */
.glow-blue {
    box-shadow: 0 0 20px rgba(0, 219, 231, 0.3);
}

/* ===== 脉冲动画 ===== */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 219, 231, 0.2);
        border-color: rgba(0, 219, 231, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 219, 231, 0.5);
        border-color: rgba(0, 219, 231, 0.7);
    }
}
.animate-pulse-glow {
    animation: pulse-glow 2.5s infinite ease-in-out;
}

/* ===== 加载遮罩 ===== */
#loadingMask {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: -webkit-fill-available;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loadingMask.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.tip-text {
    font-size: 16px;
    color: #ffdd00;
    letter-spacing: 2px;
    font-weight: 500;
    text-align: center;
    padding: 0 20px;
}

.circle-wrap {
    position: relative;
    width: 90px;
    height: 90px;
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.15);
    stroke-width: 5;
}

.circle-progress {
    fill: none;
    stroke: #ffdd00;
    stroke-width: 5;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dashoffset 0.15s linear;
}

.count-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 30px;
    color: #ffdd00;
    font-weight: 700;
    font-family: 'Space Grotesk', monospace;
}

/* ===== 导航栏 ===== */
.nav-blur {
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* ===== 底部安全区 ===== */
.safe-bottom {
    padding-bottom: env(safe-area-inset-bottom, 16px);
}

/* ===== 语言选择弹窗 ===== */
.lang-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lang-overlay.show {
    opacity: 1;
    visibility: visible;
}

.lang-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1f2e;
    border-radius: 24px 24px 0 0;
    padding: 20px 20px 30px;
    z-index: 99999;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 70vh;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom, 20px);
}

.lang-sheet.open {
    transform: translateY(0);
}

.lang-sheet-handle {
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    margin: 0 auto 16px;
}

.lang-sheet-title {
    font-size: 16px;
    font-weight: 600;
    color: #dee2f6;
    text-align: center;
    margin-bottom: 16px;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    transition: background 0.15s;
    cursor: pointer;
    color: #dee2f6;
    font-size: 15px;
}

.lang-option:active {
    background: rgba(255, 255, 255, 0.08);
}

.lang-option .fi {
    width: 24px !important;
    height: 24px !important;
    border-radius: 4px;
    flex-shrink: 0;
}

.lang-option .check {
    margin-left: auto;
    color: #00f2ff;
    opacity: 0;
}

.lang-option.active .check {
    opacity: 1;
}

/* ===== Toast ===== */
#toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    width: 85%;
    max-width: 340px;
}

#toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

#toast-inner {
    background: #00f2ff;
    color: #006a71;
    padding: 14px 20px;
    border-radius: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 0 50px rgba(0, 219, 231, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 15px;
}

/* ===== 触控反馈 ===== */
.tap-feedback {
    transition: transform 0.1s ease;
}

.tap-feedback:active {
    transform: scale(0.96);
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
    width: 3px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

/* ===== 工具类 ===== */
.touch-target {
    min-height: 44px;
    min-width: 44px;
}

.text-balance {
    text-wrap: balance;
}

/* ===== 移动端专属优化 ===== */
@supports (-webkit-touch-callout: none) {
    .min-h-screen {
        min-height: -webkit-fill-available;
    }
}