/*
 * ============================================================
 *  主题：Neumorphism（纯正新拟态风格）
 *  版本：2.1 (严格遵循新拟态设计原则)
 *  适用：云主机分发平台
 * ============================================================
 *
 *  【主题优化说明】
 *  1. 统一元素与背景色，确保真正的“新拟态”视觉统一性。
 *  2. 采用双层盒阴影（外亮内暗/内亮外暗）模拟凹凸质感。
 *  3. 按钮、卡片、输入框严格使用 inset 阴影处理按压凹陷效果。
 *  4. 采用贴近背景色的柔和色彩作为阴影色，避免高对比。
 *  5. 引入 WCAG 对比度标准，适当增强文本清晰度。
 *  6. 通过 CSS 变量支持明暗主题一键切换（探测系统主题偏好）。
 *
 *  【其他要求同原文档】
 */

/* ============================================================
 *  CSS 变量（支持亮色/暗色双主题）
 * ============================================================ */
:root {
    /* 亮色主题配色 */
    --bg: #e9eef2;                    /* 柔和浅灰蓝背景 */
    --bg-alt: #e3e8ec;                /* 卡片背景微变 */
    --fg: #2c3e50;                    /* 深蓝灰主文字，保证对比度 */
    --muted: #607d8b;                 /* 辅助文字，蓝灰色调 */
    --accent: #5c6bc0;                /* 靛蓝强调色 */
    --accent-light: #7986cb;
    --accent-dark: #3f51b5;
    --shadow-light: #ffffff;          /* 亮部阴影，纯白有轻微提亮效果 */
    --shadow-dark: #cbd6e2;           /* 暗部阴影，贴近背景的蓝灰 */
    --radius: 16px;
    --radius-sm: 12px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --gradient-accent: linear-gradient(135deg, #5c6bc0 0%, #7e57c2 100%);
}

/* 暗色主题（根据系统偏好自动切换） */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #2c303a;
        --bg-alt: #262a33;
        --fg: #eceff4;
        --muted: #929bac;
        --accent: #a78bfa;
        --accent-light: #c4b5fd;
        --accent-dark: #8b5cf6;
        --shadow-light: #3d4353;       /* 暗色模式下亮阴影变暗 */
        --shadow-dark: #1e2129;        /* 暗色模式下暗阴影更深 */
        --gradient-accent: linear-gradient(135deg, #a78bfa 0%, #c084fc 100%);
    }
}

/* ============================================================
 *  全局重置与基础
 * ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--fg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    scroll-behavior: smooth;
}

a { color: var(--accent); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.85; }

/* 滚动条美化 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--shadow-dark); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

.app { min-height: 100vh; display: flex; flex-direction: column; }

/* ============================================================
 *  布局组件
 * ============================================================ */

/* ---- 顶部导航栏 (凸起效果) ---- */
.header {
    background: var(--bg);
    box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
    position: sticky; top: 0; z-index: 100;
}
.header-inner {
    max-width: 1200px; margin: 0 auto;
    padding: 0 24px; height: 68px;
    display: flex; align-items: center; justify-content: space-between;
}
.logo { 
    font-size: 1.4rem; font-weight: 800; 
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

/* 导航链接 */
.nav { display: flex; gap: 10px; align-items: center; }
.nav a {
    padding: 10px 18px; border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--muted); font-weight: 600; font-size: 0.92rem;
    box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
    transition: all var(--transition);
}
.nav a:hover { 
    color: var(--accent); 
    box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
}
.nav a:active {
    box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
}

/* ---- 主内容区域 ---- */
.main { flex: 1; max-width: 1200px; width: 100%; margin: 0 auto; padding: 40px 24px; }

/* ---- 页脚 ---- */
.footer { 
    background: var(--bg); 
    box-shadow: inset 0 1px 4px var(--shadow-dark);
    padding: 28px; text-align: center;
}
.footer-inner { max-width: 1200px; margin: 0 auto; color: var(--muted); font-size: 0.88rem; }

/* ---- 公告栏（保持渐变强调色） ---- */
.announcement-bar { 
    background: var(--gradient-accent); color: #fff; 
    padding: 12px 24px; text-align: center; font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.announcement-inner { max-width: 1200px; margin: 0 auto; }

/* ============================================================
 *  按钮系统（核心新拟态交互）
 * ============================================================ */

/* 主按钮：渐变色 + 外投影 */
.btn-primary {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 14px 32px; border: none; border-radius: var(--radius);
    background: var(--gradient-accent); color: #fff;
    font-size: 0.98rem; font-weight: 700; cursor: pointer;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15), 0 2px 4px rgba(0,0,0,0.1);
    transition: all var(--transition);
    letter-spacing: 0.5px;
}
.btn-primary:hover { 
    transform: translateY(-1px); 
    box-shadow: 0 8px 16px rgba(0,0,0,0.2), 0 3px 6px rgba(0,0,0,0.1);
}
.btn-primary:active { 
    transform: translateY(0); 
    box-shadow: inset 0 4px 8px rgba(0,0,0,0.3);
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* 次要按钮：新拟态凸起/凹陷 */
.btn-secondary {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 14px 32px; border: none; border-radius: var(--radius);
    background: var(--bg);
    color: var(--fg); font-size: 0.98rem; font-weight: 700; cursor: pointer;
    box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
    transition: all var(--transition);
    letter-spacing: 0.5px;
}
.btn-secondary:hover { 
    box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
}
.btn-secondary:active {
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}

.btn-sm { padding: 8px 18px; font-size: 0.85rem; border-radius: var(--radius-sm); }

/* ============================================================
 *  消息提示
 * ============================================================ */
.msg { 
    padding: 16px 24px; border-radius: var(--radius); margin-bottom: 20px; 
    font-size: 0.92rem; font-weight: 500;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.05);
}
.msg-error { background: #fdecea; color: #b71c1c; }
.msg-success { background: #e8f5e9; color: #1b5e20; }
.msg-warn { background: #fff3e0; color: #e65100; }

/* ============================================================
 *  首页 Hero
 * ============================================================ */
.hero {
    display: flex; align-items: center; justify-content: center;
    min-height: 70vh; text-align: center; padding: 60px 24px;
}
.hero-title { 
    font-size: 3.2rem; font-weight: 900; color: var(--fg); margin-bottom: 16px; letter-spacing: -1px; 
}
.hero-title span {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-desc { font-size: 1.2rem; color: var(--muted); max-width: 580px; margin: 0 auto 40px; line-height: 1.8; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
 *  特性卡片区域
 * ============================================================ */
.features { padding: 80px 0; }
.section-title { text-align: center; margin-bottom: 56px; }
.section-title h2 { font-size: 2.2rem; font-weight: 800; color: var(--fg); margin-bottom: 12px; }
.section-title p { color: var(--muted); font-size: 1.1rem; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px; }
.feature-card {
    background: var(--bg); border-radius: var(--radius-lg); padding: 36px 28px; text-align: center;
    box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
    transition: all var(--transition);
}
.feature-card:hover { 
    transform: translateY(-6px); 
    box-shadow: 10px 10px 20px var(--shadow-dark), -10px -10px 20px var(--shadow-light); 
}
.feature-icon { font-size: 2.8rem; margin-bottom: 18px; }
.feature-card h3 { font-size: 1.2rem; margin-bottom: 10px; color: var(--fg); }
.feature-card p { color: var(--muted); font-size: 0.92rem; line-height: 1.7; }

/* ============================================================
 *  步骤流程
 * ============================================================ */
.how-it-works { padding: 80px 0; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 28px; }
.step { 
    text-align: center; padding: 32px 20px; background: var(--bg); 
    border-radius: var(--radius-lg); 
    box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
    transition: all var(--transition);
}
.step:hover { transform: translateY(-4px); }
.step-num { 
    width: 52px; height: 52px; border-radius: 50%; 
    background: var(--bg);
    color: var(--accent);
    display: inline-flex; align-items: center; justify-content: center; 
    font-size: 1.4rem; font-weight: 800; margin-bottom: 16px;
    box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
}
.step h3 { font-size: 1.1rem; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 0.88rem; }

/* ============================================================
 *  认证页面
 * ============================================================ */
.auth-container { display: flex; align-items: center; justify-content: center; min-height: 70vh; padding: 40px 24px; }
.auth-card {
    background: var(--bg); border-radius: var(--radius-xl); padding: 44px;
    max-width: 440px; width: 100%;
    box-shadow: 12px 12px 24px var(--shadow-dark), -12px -12px 24px var(--shadow-light);
}
.auth-tabs { 
    display: flex; margin-bottom: 32px; border-radius: var(--radius); 
    overflow: hidden; 
    background: var(--bg);
    box-shadow: inset 2px 2px 5px var(--shadow-dark), inset -2px -2px 5px var(--shadow-light);
    padding: 4px;
}
.auth-tab { 
    flex: 1; padding: 14px; text-align: center; 
    color: var(--muted); font-weight: 600; font-size: 1rem; 
    transition: all var(--transition); border-radius: var(--radius-sm);
}
.auth-tab.active { 
    color: #fff; 
    background: var(--gradient-accent);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.auth-form .form-group { margin-bottom: 20px; }
.auth-form label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; }
.auth-form input[type="text"], .auth-form input[type="email"], .auth-form input[type="password"] {
    width: 100%; padding: 14px 18px; border: none; border-radius: var(--radius-sm);
    background: var(--bg);
    box-shadow: inset 6px 6px 12px var(--shadow-dark), inset -6px -6px 12px var(--shadow-light);
    font-size: 1rem; outline: none; color: var(--fg); transition: all var(--transition);
}
.auth-form input:focus { 
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}
.captcha-row, .code-row { display: flex; gap: 12px; align-items: center; }
.captcha-row input, .code-row input { flex: 1; }
.captcha-img { height: 48px; border-radius: var(--radius-sm); cursor: pointer; flex-shrink: 0; }
.btn-send-code {
    padding: 12px 18px; border: none; border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--accent); font-size: 0.85rem; font-weight: 600;
    cursor: pointer; white-space: nowrap; flex-shrink: 0;
    box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
    transition: all var(--transition);
}
.btn-send-code:hover { box-shadow: 2px 2px 4px var(--shadow-dark), -2px -2px 4px var(--shadow-light); }
.btn-send-code:active { box-shadow: inset 2px 2px 4px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light); }
.btn-send-code:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-switch { text-align: center; margin-top: 24px; color: var(--muted); font-size: 0.9rem; }

/* ============================================================
 *  购物/产品页面
 * ============================================================ */
.page-header { text-align: center; margin-bottom: 40px; }
.page-header h1 { font-size: 2.2rem; font-weight: 800; margin-bottom: 10px; }
.page-header p { color: var(--muted); font-size: 1.05rem; }
.user-points-bar { 
    display: flex; align-items: center; justify-content: space-between; padding: 18px 28px; 
    border-radius: var(--radius); margin-bottom: 32px; background: var(--bg); 
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; }
.product-card {
    background: var(--bg); border-radius: var(--radius-lg); padding: 32px 28px; text-align: center;
    box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
    transition: all var(--transition); display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-6px); }
.product-name { font-size: 1.3rem; font-weight: 700; margin-bottom: 10px; }
.product-price { font-size: 2.4rem; font-weight: 900; color: var(--accent); margin-bottom: 24px; }
.product-features { list-style: none; text-align: left; margin-bottom: 28px; flex: 1; }
.product-features li { padding: 10px 0; border-bottom: 1px solid var(--shadow-dark); font-size: 0.92rem; }
.empty-state { text-align: center; padding: 80px 20px; color: var(--muted); grid-column: 1/-1; }

/* ============================================================
 *  个人中心面板
 * ============================================================ */
.panel-grid { display: grid; grid-template-columns: 280px 1fr; gap: 28px; }
.panel-sidebar { position: sticky; top: 92px; align-self: start; }
.user-card {
    background: var(--bg); border-radius: var(--radius-lg); padding: 32px; text-align: center;
    box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light); margin-bottom: 16px;
}
.user-avatar { 
    width: 72px; height: 72px; border-radius: 50%; 
    background: var(--bg);
    color: var(--accent); display: inline-flex; align-items: center; justify-content: center; 
    font-size: 1.6rem; font-weight: 800; margin-bottom: 14px; 
    box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
}
.user-name { font-size: 1.15rem; font-weight: 700; margin-bottom: 6px; }
.user-email { color: var(--muted); font-size: 0.85rem; margin-bottom: 10px; }
.user-points { font-size: 1.1rem; font-weight: 700; color: var(--accent); }

.panel-nav { display: flex; flex-direction: column; gap: 8px; }
.panel-nav-item {
    display: block; padding: 14px 22px; border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--muted); font-weight: 600; font-size: 0.92rem;
    box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
    transition: all var(--transition);
}
.panel-nav-item:hover, .panel-nav-item.active { 
    color: var(--accent);
    box-shadow: 2px 2px 4px var(--shadow-dark), -2px -2px 4px var(--shadow-light);
}

.section-card {
    background: var(--bg); border-radius: var(--radius-lg); padding: 32px; margin-bottom: 24px;
    box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
}
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; }
.form-group input, .form-group select {
    width: 100%; padding: 12px 16px; border: none; border-radius: var(--radius-sm);
    background: var(--bg);
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
    font-size: 0.95rem; outline: none; color: var(--fg);
    transition: all var(--transition);
}

.info-row { 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 12px 0; border-bottom: 1px solid var(--shadow-dark); font-size: 0.9rem; 
}
.info-row span:first-child { color: var(--muted); }

.points-packages { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px; }
.pkg-card {
    text-align: center; padding: 24px 16px; border-radius: var(--radius);
    background: var(--bg);
    box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
    transition: all var(--transition);
}
.pkg-card:hover { transform: translateY(-4px); }
.pkg-points { font-size: 1.4rem; font-weight: 800; color: var(--accent); margin-bottom: 8px; }
.pkg-price { font-size: 1.05rem; color: var(--fg); font-weight: 600; margin-bottom: 16px; }

.vhost-list { display: flex; flex-direction: column; gap: 18px; }
.vhost-card {
    padding: 24px; border-radius: var(--radius);
    background: var(--bg);
    box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
}
.vhost-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.vhost-name { font-weight: 700; font-size: 1.05rem; }
.copyable { 
    cursor: pointer; font-family: monospace; transition: all 0.2s; 
    padding: 4px 10px; border-radius: 6px; 
    background: var(--bg);
    box-shadow: inset 2px 2px 4px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light);
}

.badge { display: inline-block; padding: 4px 12px; border-radius: 8px; font-size: 0.78rem; font-weight: 700; }
.badge-green { background: #c8e6c9; color: #2e7d32; }
.badge-red { background: #ffcdd2; color: #c62828; }
.badge-blue { background: #bbdefb; color: #1565c0; }
.text-muted { color: var(--muted); }

/* ============================================================
 *  响应式
 * ============================================================ */
@media (max-width: 768px) {
    .panel-grid { grid-template-columns: 1fr; }
    .panel-sidebar { position: static; }
    .panel-nav { flex-direction: row; flex-wrap: wrap; }
    .hero-title { font-size: 2.2rem; }
    .hero { min-height: 50vh; padding: 40px 16px; }
    .feature-grid { grid-template-columns: 1fr 1fr; }
    .steps { grid-template-columns: 1fr 1fr; }
    .product-grid { grid-template-columns: 1fr; }
    .points-packages { grid-template-columns: 1fr 1fr; }
    .nav a { padding: 8px 12px; font-size: 0.85rem; }
    .main { padding: 24px 16px; }
    .auth-card { padding: 28px; }
}
@media (max-width: 480px) {
    .feature-grid { grid-template-columns: 1fr; }
    .steps { grid-template-columns: 1fr; }
    .points-packages { grid-template-columns: 1fr; }
    .hero-title { font-size: 1.8rem; }
    .hero-desc { font-size: 1rem; }
    .auth-card { padding: 24px; }
    .captcha-row { flex-direction: column; }
    .captcha-img { width: 100%; height: auto; }
}

/* ============================================================
 *  模态弹窗
 * ============================================================ */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 9999; align-items: center; justify-content: center; }
.modal.hidden { display: none !important; }
.modal-content { 
    background: var(--bg); border-radius: var(--radius-xl); max-width: 500px; width: 90%; 
    max-height: 80vh; overflow: auto; 
    box-shadow: 16px 16px 32px var(--shadow-dark), -16px -16px 32px var(--shadow-light);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 24px 28px; border-bottom: 1px solid var(--shadow-dark); }
.modal-header h3 { margin: 0; font-size: 1.15rem; font-weight: 700; }
.modal-close { font-size: 1.5rem; color: var(--muted); cursor: pointer; line-height: 1; transition: color 0.2s; }
.modal-close:hover { color: #e53935; }
.modal-body { padding: 28px; line-height: 1.8; color: var(--fg); font-size: 0.95rem; }
.modal-footer { padding: 18px 28px; text-align: center; border-top: 1px solid var(--shadow-dark); }

/* ============================================================
 *  其他
 * ============================================================ */
.pay-type-label { 
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; margin-right: 10px; 
    background: var(--bg); border-radius: var(--radius); cursor: pointer; 
    box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light); 
    transition: all 0.2s; font-size: 0.92rem; color: var(--fg); 
}
.pay-type-label:hover { 
    box-shadow: 2px 2px 4px var(--shadow-dark), -2px -2px 4px var(--shadow-light); 
}
.pay-type-label input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }