/**
 * 黑金极简办公风格样式
 * 设计理念：专业、简洁、现代、移动优先
 * 主色调：黑色背景 + 金色强调
 */

/* ========== CSS变量 ========== */
:root {
    /* 黑金配色 */
    --bg-primary: #0a0a0a;           /* 主背景 - 深黑 */
    --bg-secondary: #1a1a1a;         /* 次背景 - 深灰 */
    --bg-card: #1f1f1f;              /* 卡片背景 - 深灰 */
    --bg-hover: #2a2a2a;             /* 悬停背景 */
    
    /* 金色系 */
    --gold-primary: #d4af37;         /* 主金色 */
    --gold-light: #f4d03f;           /* 浅金色 */
    --gold-dark: #b8941f;            /* 深金色 */
    --gold-glow: rgba(212, 175, 55, 0.3); /* 金色光晕 */
    
    /* 文字颜色 */
    --text-primary: #ffffff;         /* 主文字 - 白色 */
    --text-secondary: #b0b0b0;       /* 次文字 - 浅灰 */
    --text-muted: #707070;           /* 弱文字 - 中灰 */
    --text-gold: #d4af37;            /* 金色文字 */
    
    /* 边框 */
    --border-color: #2a2a2a;         /* 边框颜色 */
    --border-gold: rgba(212, 175, 55, 0.3); /* 金色边框 */
    
    /* 功能色 */
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --info: #2196f3;
    
    /* 间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* 阴影 */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-gold: 0 0 20px var(--gold-glow);
}

/* ========== 基础重置 ========== */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ========== 布局容器 ========== */
.page-wrapper {
    min-height: 100vh;
    background: var(--bg-primary);
    padding-bottom: 80px; /* 为底部导航留空间 */
    position: relative;
}

.container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ========== 顶部导航 ========== */
.home-header {
    background: var(--bg-secondary);
    padding: var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.home-logo {
    height: 28px;
    filter: brightness(1.2);
}

.home-header a {
    color: var(--text-gold);
    display: flex;
    align-items: center;
    transition: opacity 0.2s;
}

.home-header a:active {
    opacity: 0.7;
}

/* ========== 余额卡片 - 黑金风格 ========== */
.balance-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, #2a2a2a 100%);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin: var(--spacing-md);
    box-shadow: var(--shadow-md), var(--shadow-gold);
    position: relative;
    overflow: hidden;
}

.balance-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.balance-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.balance-item {
    flex: 1;
    text-align: center;
}

.balance-item:first-child {
    border-right: 1px solid var(--border-color);
    padding-right: var(--spacing-md);
}

.balance-item:last-child {
    padding-left: var(--spacing-md);
}

.balance-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.balance-amount {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-gold);
    margin-bottom: var(--spacing-md);
    text-shadow: 0 0 10px var(--gold-glow);
    font-family: 'Arial', sans-serif;
}

.balance-amount.income-amount {
    color: #22c55e;
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

.balance-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
}

.balance-btn {
    height: 44px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    color: var(--text-gold);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.balance-btn:hover {
    background: var(--bg-hover);
    border-color: var(--gold-primary);
    box-shadow: 0 0 15px var(--gold-glow);
}

.balance-btn:active {
    transform: scale(0.98);
    background: var(--bg-card);
}

/* ========== 轮播图 ========== */
.banner-container {
    padding: var(--spacing-md);
}

.swiper-container {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.swiper-slide img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.swiper-pagination-bullet {
    background: var(--text-muted);
    opacity: 0.5;
}

.swiper-pagination-bullet-active {
    background: var(--gold-primary);
    opacity: 1;
}

/* ========== 公告栏 ========== */
.notice-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--gold-primary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin: 0 var(--spacing-md) var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    box-shadow: var(--shadow-sm);
}

.notice-icon {
    color: var(--gold-primary);
    font-size: 20px;
    flex-shrink: 0;
}

.notice-content {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
    overflow: hidden;
    height: 20px;
    line-height: 20px;
}

/* ========== 区块标题 ========== */
.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0 var(--spacing-md);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.section-title::before {
    content: '';
    width: 3px;
    height: 16px;
    background: var(--gold-primary);
    border-radius: 2px;
}

/* ========== 服务网格 ========== */
.service-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    padding: 0 var(--spacing-md) var(--spacing-md);
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg) var(--spacing-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
}

.service-card:hover {
    border-color: var(--border-gold);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 10px var(--gold-glow);
}

.service-card:active {
    transform: translateY(0);
}

.service-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: var(--bg-secondary);
    color: var(--gold-primary);
    border: 1px solid var(--border-gold);
}

.service-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
}

/* ========== 合作伙伴 ========== */
.partner-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-sm);
    padding: 0 var(--spacing-md) var(--spacing-xl);
}

.partner-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.partner-item:hover {
    border-color: var(--border-gold);
    transform: scale(1.05);
}

.partner-item img {
    width: 100%;
    height: auto;
    max-height: 40px;
    object-fit: contain;
    filter: brightness(0.9);
    transition: filter 0.3s;
}

.partner-item:hover img {
    filter: brightness(1.1);
}

.partner-item span {
    color: var(--text-gold);
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    word-break: break-word;
}

/* ========== 底部导航 ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    padding: var(--spacing-sm) 0;
    padding-bottom: calc(var(--spacing-sm) + env(safe-area-inset-bottom));
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xs) var(--spacing-xs);
    color: var(--text-muted);
    font-size: 11px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 40px;
    height: 2px;
    background: var(--gold-primary);
    border-radius: 0 0 2px 2px;
    transition: transform 0.3s;
}

.nav-item i {
    font-size: 22px;
    margin-bottom: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
}

.nav-item span {
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.2;
    transition: all 0.3s;
}

.nav-item.active {
    color: var(--text-gold);
}

.nav-item.active::before {
    transform: translateX(-50%) scaleX(1);
}

.nav-item.active i {
    transform: scale(1.15);
    text-shadow: 0 0 12px var(--gold-glow);
    filter: drop-shadow(0 0 4px var(--gold-glow));
}

.nav-item:active {
    transform: scale(0.95);
    opacity: 0.8;
}

.nav-item:hover:not(.active) {
    color: var(--text-secondary);
}

.nav-item:hover:not(.active) i {
    transform: scale(1.05);
}

/* ========== 响应式设计 ========== */
/* 平板设备 */
@media (min-width: 481px) and (max-width: 768px) {
    .container {
        max-width: 600px;
        margin: 0 auto;
    }
    
    .service-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .partner-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* 移动设备 */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .balance-amount {
        font-size: 32px;
    }
    
    .service-grid {
        gap: var(--spacing-sm);
    }
    
    .service-card {
        padding: var(--spacing-md);
    }
    
    .partner-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-xs);
    }
    
    .nav-item {
        font-size: 10px;
        padding: var(--spacing-xs) 2px;
    }
    
    .nav-item i {
        font-size: 20px;
    }
    
    .nav-item span {
        font-size: 9px;
    }
}

/* 小屏手机 */
@media (max-width: 360px) {
    html {
        font-size: 13px;
    }
    
    .balance-card {
        padding: var(--spacing-md);
    }
    
    .balance-amount {
        font-size: 28px;
    }
    
    .service-grid {
        gap: var(--spacing-xs);
    }
    
    .service-card {
        padding: var(--spacing-sm) var(--spacing-xs);
    }
    
    .service-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .service-label {
        font-size: 12px;
    }
    
    .partner-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-xs);
    }
    
    .nav-item {
        font-size: 9px;
        padding: 4px 1px;
    }
    
    .nav-item i {
        font-size: 18px;
    }
    
    .nav-item span {
        font-size: 8px;
    }
}

/* 横屏适配 */
@media (orientation: landscape) and (max-height: 500px) {
    .balance-card {
        padding: var(--spacing-md);
    }
    
    .balance-amount {
        font-size: 28px;
    }
    
    .banner-container {
        padding: var(--spacing-sm);
    }
    
    .swiper-slide img {
        height: 120px;
    }
}

/* 高DPI屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .home-logo,
    .partner-item img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ========== 安全区域适配 ========== */
@supports (padding: max(0px)) {
    .page-wrapper {
        padding-bottom: max(80px, calc(80px + env(safe-area-inset-bottom)));
    }
    
    .bottom-nav {
        padding-bottom: max(var(--spacing-sm), calc(var(--spacing-sm) + env(safe-area-inset-bottom)));
    }
}

/* ========== 动画效果 ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.animate-fade-in {
    animation: fadeIn 0.4s ease-out;
}

.animate-slide-in {
    animation: slideIn 0.4s ease-out;
}

/* ========== 工具类 ========== */
.text-gold { color: var(--text-gold); }
.text-center { text-align: center; }
.text-right { text-align: right; }

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }

.p-1 { padding: var(--spacing-sm); }
.p-2 { padding: var(--spacing-md); }
