/* 变量定义 */
:root {
    --glass-bg: rgba(255, 255, 255, 0.45);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-blur: blur(16px);
}

/* 基础背景与布局 */
body {
    background: linear-gradient(rgba(255, 255, 255, 0.05), rgba(241, 245, 249, 0.1)), 
                url('../img/white.jpg') no-repeat center center fixed;
    background-size: cover; 
    background-color: #f8fafc; 
    color: #1e293b; 
    margin: 0; 
    overflow-x: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    
    /* 统一布局：居中 + 固定宽度手机视图 */
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding-top: 0;
}

/* 核心容器 - 统一所有设备宽度 */
.main-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 430px; /* 调整为更标准的手机宽度 */
    padding: 0.75rem;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 100px rgba(0,0,0,0.05);
}

/* 小屏设备优化（手机） */
@media (max-width: 480px) {
    .main-container {
        max-width: 100%;
        padding: 0.75rem;
    }
}

/* Logo 动画样式 - 比例等比缩小 */
.logo-img {
    width: 40px; /* 原 48px */
    border-radius: 0.6rem;
    border: 1px solid rgba(234, 179, 8, 0.5);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.logo-text {
    font-size: 1.5rem; /* 原 1.8rem */
    font-weight: 900; 
    letter-spacing: 1px;
    background: linear-gradient(to right, #b8860b, #d4af37, #8a6d3b, #d4af37);
    background-size: 200% auto; 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent;
    animation: shine 3s linear infinite; 
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.1));
}

@keyframes shine { to { background-position: 200% center; } }

/* 玻璃拟态面板 */
.glass-panel {
    background: var(--glass-bg); 
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur); 
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 公告栏 - 缩小字体 */
.notice-bar {
    border-radius: 0.75rem;
    padding: 0.5rem 1rem;
    width: 100%;
    display: flex;
    align-items: center;
}

.notice-tag {
    font-size: 10px; /* 原 11px */
    font-weight: 900;
    margin-right: 0.75rem;
    flex-shrink: 0;
    color: #ef4444;
    background-color: #fef2f2;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
}

.notice-text {
    font-size: 11px; /* 原 12px */
    font-weight: 700;
    color: #334155;
}

/* 交互元素 */
.interactive-element:hover { transform: translateY(-2px); box-shadow: 0 8px 16px rgba(0,0,0,0.08); }
.interactive-element:active { transform: scale(0.96); transition: transform 0.1s; }
.section-gap { margin-bottom: 0.7rem; }

/* 按钮样式 */
.entry-btn {
    padding: 0.75rem;
    border-radius: 0.8rem;
    text-align: center;
    font-weight: 900;
    font-size: 0.8rem;
    cursor: pointer;
}

/* 客服板块 */
.customer-panel {
    padding: 0.6rem 0.8rem;
    border-radius: 0.8rem;
    position: relative;
    overflow: hidden;
}

.customer-avatar {
    width: 2.2rem;
    height: 2.2rem;
    background-color: white;
    border-radius: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid #f1f5f9;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    overflow: hidden;
}

.customer-avatar img { width: 80%; }

.customer-name { font-size: 11px; font-weight: 900; color: #1e293b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100px; }
.official-tag { background-color: #2563eb; color: white; font-size: 8px; padding: 0.1rem 0.3rem; border-radius: 9999px; transform: scale(0.85); }
.customer-id { font-size: 12px; font-weight: 900; color: #1e3a8a; margin-top: 0.2rem; line-height: 1; }

.btn-action { background-color: #0f172a; color: white; font-size: 10px; padding: 0.4rem 0.6rem; border-radius: 0.5rem; font-weight: 700; }
.btn-action:active { transform: scale(0.9); }
.btn-blue { background-color: #2563eb; }

/* 导航标签 */
.nav-tab { flex: 1; padding: 10px 2px; border-radius: 12px; transition: all 0.3s; font-size: 12px; font-weight: 900; }
.nav-tab.active { background: #0f172a !important; color: white !important; box-shadow: 0 6px 15px rgba(15,23,42,0.3); }

/* --- 核心修复：卡片竖向排版（电脑端 2 列布局） --- */
.link-card { 
    padding: 10px; 
    min-height: auto; 
    display: flex; 
    flex-direction: column; /* 改为竖向排列 */
    align-items: center; 
    justify-content: flex-start; 
    cursor: pointer; 
    gap: 8px;
    text-align: center;
}

/* 文字容器 */
.link-card div:first-child {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    width: 100%;
}

.link-card h3 { 
    font-size: 12px !important; 
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
}

.link-card p { 
    font-size: 9px !important; 
    margin-top: 4px;
    opacity: 0.8;
}

/* 圖片等比縮小並固定 */
.link-card img { 
    width: 50px !important; 
    height: 50px !important; 
    object-fit: contain;
    flex-shrink: 0;
}

/* AI 標籤微調 */
.link-card .bg-blue-600 {
    font-size: 8px !important;
    padding: 1px 3px !important;
    border-radius: 3px;
    flex-shrink: 0;
}

/* 手机端恢复横向布局 */
@media (max-width: 480px) {
    .link-card {
        flex-direction: row;
        min-height: 70px;
        align-items: center;
        justify-content: space-between;
        text-align: left;
        padding: 12px;
        gap: 12px;
    }
    
    .link-card div:first-child {
        text-align: left;
    }
    
    .link-card h3 {
        font-size: 14px !important;
        justify-content: flex-start;
    }
    
    .link-card p {
        font-size: 10px !important;
    }
    
    .link-card img {
        width: 44px !important;
        height: 44px !important;
    }
}

/* 活动图 */
.promo-container {
    width: 100%;
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.8);
    position: relative;
    cursor: zoom-in;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.promo-image { width: 100%; height: auto; display: block; object-fit: contain; }

/* 装饰女孩 - 统一位置（适配所有屏幕） */
.decorative-girl {
    position: fixed; 
    right: -20px; /* 固定在右侧，不分屏幕大小 */
    bottom: 0; 
    width: 160px; 
    z-index: 5;
    pointer-events: none; 
    opacity: 0.95; 
    filter: drop-shadow(-10px 0 20px rgba(0,0,0,0.1));
}

/* 真正的手机端优化 */
@media (max-width: 480px) {
    #gridContainer {
        grid-template-columns: 1fr !important;
    }
    .decorative-girl {
        width: 140px;
        right: -10px;
    }
    .main-container {
        max-width: 100%;
        padding: 0.75rem;
    }
}

/* 画布与 Toast */
#cursor-canvas { position:fixed; inset:0; z-index:1; pointer-events:none; opacity:0.5; }
#toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.85); color: white; padding: 10px 24px; border-radius: 30px; z-index: 10001; display: none; font-size: 12px; font-weight: bold; }

/* 预览器 */
#image-viewer { display: none; position: fixed; inset: 0; z-index: 30000; background: rgba(0,0,0,0.9); backdrop-filter: blur(15px); align-items: center; justify-content: center; cursor: zoom-out; }
#image-viewer img { max-width: 95%; max-height: 90%; border-radius: 8px; transform: scale(0.9); animation: zoomIn 0.3s forwards; }

/* AI 加载层 */
#loading-overlay {
    display: none; position: fixed; inset: 0; z-index: 20000; 
    background: rgba(15,23,42,0.9); align-items: center; justify-content: center; 
    flex-direction: column; color: white;
}
.loader-spinner { width: 2.5rem; height: 2.5rem; border-width: 3px; border-color: #3b82f6; border-top-color: transparent; border-radius: 9999px; animation: spin 1s linear infinite; margin-bottom: 1rem; }
.loader-text { font-weight: 900; animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; }

/* 模态框 - 适配所有屏幕 */
#modal-overlay { 
    display: none; 
    position: fixed; 
    inset: 0; 
    z-index: 10000; 
    background: rgba(0,0,0,0.5); 
    backdrop-filter: blur(10px); 
    align-items: center; 
    justify-content: center; 
    padding: 20px;
    overflow-y: auto;
}
.modal-content { 
    padding: 1.25rem; 
    border-radius: 1.5rem; 
    max-width: 320px; 
    width: 100%; 
    background-color: rgba(255,255,255,0.95);
    max-height: 85vh; 
    overflow-y: auto;
}

@media (max-width: 480px) {
    .modal-content { 
        max-width: 90vw;
        max-height: 80vh;
    }
}
#modal-title { font-size: 1.1rem; font-weight: 900; margin-bottom: 0.6rem; color: #0f172a; }
#modal-desc { font-size: 0.8rem; font-weight: 700; color: #475569; margin-bottom: 1rem; max-height: 12rem; overflow-y: auto; text-align: justify; line-height: 1.5; }
.modal-contact-box { background-color: #f8fafc; padding: 0.8rem; border-radius: 0.6rem; border: 2px dashed #e2e8f0; margin-bottom: 1rem; display: flex; justify-content: space-between; align-items: center; }
#modal-contact { font-size: 0.8rem; font-weight: 900; color: #1e3a8a; }
.btn-copy { background-color: #0f172a; color: white; font-size: 10px; padding: 0.4rem 0.8rem; border-radius: 0.5rem; font-weight: 700; }
.btn-confirm { width: 100%; padding: 0.85rem; border-radius: 0.6rem; background-color: #0f172a; color: white; font-weight: 900; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
@keyframes zoomIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }