:root {
    --bg-deep: #0A0118;
    --bg-card: rgba(255, 255, 255, 0.03);
    --primary-gold: #D4AF37;
    --accent-purple: #A855F7;
    --accent-teal: #06B6D4;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

#app {
    height: 100%;
    width: 100%;
    position: relative;
}

/* Splash Screen */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0A0118 0%, #1a0b3e 50%, #0A0118 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.splash-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.splash-content {
    text-align: center;
}

.splash-logo {
    font-size: 64px;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

.splash-title {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    background: linear-gradient(to bottom, #fff, var(--primary-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.splash-subtitle {
    font-size: 14px;
    color: var(--accent-purple);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 40px;
}

.splash-loader {
    width: 40px;
    height: 40px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--primary-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* Page Container */
.page-container {
    height: 100%;
    width: 100%;
    padding-top: var(--safe-area-top);
    padding-bottom: calc(84px + var(--safe-area-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.page {
    display: none;
    flex-direction: column;
    min-height: 100%;
    padding: 20px 24px;
    animation: pageIn 0.3s ease;
}

.page.active {
    display: flex;
}

@keyframes pageIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Typography */
h1 {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    background: linear-gradient(180deg, #FFF, var(--primary-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
}

/* Components */
.btn-gold {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #D4AF37, #F59E0B);
    border: none;
    border-radius: 100px;
    color: #000;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
    transition: 0.3s;
    font-family: inherit;
}

.btn-gold:active {
    transform: scale(0.98);
}

.btn-gold:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-outline {
    width: 100%;
    padding: 15px;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    color: var(--text-main);
    font-size: 15px;
    cursor: pointer;
    margin-top: 12px;
    font-family: inherit;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
}

.glass-card {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 20px;
    margin-top: 20px;
}

.input-group {
    margin-top: 20px;
}

.input-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: block;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
select {
    width: 100%;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 16px;
    border-radius: 12px;
    color: var(--text-main);
    margin-bottom: 12px;
    outline: none;
    font-family: inherit;
    font-size: 16px;
    -webkit-appearance: none;
}

input:focus {
    border-color: var(--primary-gold);
}

/* Tab Bar */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(84px + var(--safe-area-bottom));
    padding-bottom: var(--safe-area-bottom);
    background: rgba(10, 1, 24, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding-top: 12px;
    z-index: 100;
}

.tab-item {
    color: var(--text-muted);
    font-size: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

.tab-item.active {
    color: var(--primary-gold);
}

.tab-icon {
    font-size: 24px;
}

/* Avatar */
.avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-gold), var(--accent-purple));
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 14px;
}

/* Badge */
.badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}

.badge-vip {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
}

.badge-free {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

/* Notification */
.notify-bell {
    position: relative;
    font-size: 20px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notify-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    border-radius: 100px;
    background: #EF4444;
    color: #fff;
    font-size: 10px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.notify-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 12px;
}

.notify-unread {
    border-color: rgba(212, 175, 55, 0.5);
    background: rgba(212, 175, 55, 0.06);
}

.notify-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.notify-content {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: 8px;
}

.notify-time {
    margin-top: 10px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
}

.notify-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
}

.notify-status.unread {
    color: #F59E0B;
    background: rgba(245, 158, 11, 0.15);
}

.notify-status.read {
    color: #94A3B8;
    background: rgba(148, 163, 184, 0.15);
}

/* Scan Circle */
.scan-circle {
    width: 240px;
    height: 320px;
    border-radius: 20px;
    margin: 40px auto;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-gold), transparent);
    box-shadow: 0 0 20px var(--primary-gold);
    animation: scanMove 3s ease-in-out infinite;
}

@keyframes scanMove {
    0%, 100% { top: 10%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 90%; opacity: 0; }
}

/* AI Log */
.ai-log-container {
    position: absolute;
    top: 20px;
    left: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.ai-log-item {
    font-size: 9px;
    color: var(--primary-gold);
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 8px;
    border-radius: 4px;
    border-left: 2px solid var(--primary-gold);
    animation: logIn 0.3s ease;
}

@keyframes logIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Payment Item */
.payment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: 0.3s;
}

.payment-item:active {
    background: rgba(212, 175, 55, 0.1);
    transform: scale(0.98);
}

.payment-item.selected {
    border-color: var(--primary-gold);
    background: rgba(212, 175, 55, 0.1);
}

/* Report Card */
.report-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: 0.3s;
}

.report-card:active {
    transform: scale(0.98);
}

.report-icon {
    width: 48px;
    height: 48px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 1, 24, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.loading-text {
    margin-top: 20px;
    color: var(--primary-gold);
    font-size: 14px;
}

/* Header */
.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
}

/* Profile */
.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
}

.profile-name {
    font-size: 20px;
    font-weight: 600;
}

.menu-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.menu-item:active {
    background: var(--glass);
    margin: 0 -24px;
    padding: 16px 24px;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin: 12px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-gold), var(--accent-purple));
    transition: width 0.3s ease;
}

/* Capture Button */
.capture-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 4px solid #fff;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: none;
    padding: 0;
}

.capture-btn-inner {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fff;
}

/* Status Text */
.status-text {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}

/* Hidden */
.hidden {
    display: none !important;
}

/* Utility */
.text-center { text-align: center; }
.text-gold { color: var(--primary-gold); }
.mt-auto { margin-top: auto; }
.mb-20 { margin-bottom: 20px; }
.pb-safe { padding-bottom: calc(20px + var(--safe-area-bottom)); }

/* ============================================
   Scroll Indicator - iOS 风格滚动指示器 v5
   顶部显示在右上角，底部显示在右下角
   ============================================ */
.scroll-indicator {
    position: fixed;
    right: 3%;
    top: 180px;  /* 顶部状态：距离顶部 180px（导航栏下方） */
    width: 50px;
    height: 80px;
    
    /* iOS 磨砂玻璃 */
    background: rgba(10, 1, 24, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    
    /* 边框 */
    border: 1.5px solid rgba(212, 175, 55, 0.5);
    border-radius: 25px;
    
    /* 阴影 */
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.5);
    
    /* 布局 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 10px;
    
    /* 动画 */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    cursor: pointer;
    
    /* 初始隐藏 */
    opacity: 0;
    pointer-events: none;
}

/* 显示状态 */
.scroll-indicator.visible,
.scroll-indicator[style*="opacity: 1"] {
    opacity: 1;
    pointer-events: auto;
}

/* 底部状态 - 移动到底部 */
.scroll-indicator.at-bottom {
    top: auto !important;
    bottom: 100px !important;  /* 底部状态：距离底部 100px（页脚上方） */
    transform: none !important;
}

/* 悬停效果 */
.scroll-indicator:hover {
    background: rgba(10, 1, 24, 0.95);
    border-color: rgba(212, 175, 55, 0.8);
}

/* 箭头 */
.scroll-indicator .arrow {
    font-size: 28px;
    color: #D4AF37;
    font-weight: bold;
    line-height: 1;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* 文字 - 只在底部显示 */
.scroll-indicator .text {
    font-size: 11px;
    color: #F8FAFC;
    font-weight: 500;
    letter-spacing: 1px;
    text-align: center;
    line-height: 1;
    white-space: nowrap;
}

.scroll-indicator.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.scroll-indicator:hover {
    background: rgba(10, 1, 24, 0.8);
    border-color: rgba(212, 175, 55, 0.5);
}

.scroll-indicator:active {
    transform: scale(0.95);
}

/* 箭头图标 */
.scroll-indicator .arrow-icon {
    font-size: 28px;  /* 加大箭头 */
    color: rgba(212, 175, 55, 1);  /* 纯金色 */
    animation: bounce 2s infinite;
    line-height: 1;
    font-weight: bold;
    flex-shrink: 0;  /* 防止压缩 */
}

@keyframes bounce {
    0%, 100% { 
        transform: translateY(0); 
    }
    50% { 
        transform: translateY(10px);  /* 增加浮动幅度 */
    }
}

/* 指示文字 */
.scroll-indicator .indicator-text {
    font-size: 12px;  /* 加大文字 */
    color: rgba(248, 250, 252, 1);  /* 纯白色 */
    font-weight: 500;
    letter-spacing: 3px;  /* 大幅增加字间距 */
    text-align: center;
    line-height: 1.6;
    white-space: nowrap;
    padding: 4px 8px;  /* 文字周围留白 */
    flex-shrink: 0;  /* 防止压缩 */
}

/* 移动端适配 */
@media (max-width: 768px) {
    .scroll-indicator {
        right: 15px;
        width: 45px;
        height: 70px;
        border-radius: 22px;
        padding: 12px 8px;
        top: 150px;  /* 移动端顶部位置 */
    }
    
    .scroll-indicator .arrow {
        font-size: 24px;
    }
    
    .scroll-indicator .text {
        font-size: 10px;
    }
    
    .scroll-indicator.at-bottom {
        bottom: 80px !important;  /* 移动端底部位置 */
    }
}

/* 桌面端适配 */
@media (min-width: 769px) {
    .scroll-indicator {
        right: 3%;
        width: 50px;
        height: 80px;
        top: 180px;  /* 桌面端顶部位置 */
    }
    
    .scroll-indicator.at-bottom {
        bottom: 100px !important;  /* 桌面端底部位置 */
    }
}
