/* 组件样式：按钮、卡片组件、徽章标签、GEO对比组件 */

/* ========== 按钮组件 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
    gap: 6px;
}
.btn-ghost { color: var(--gray-600); background: transparent; }
.btn-ghost:hover { color: var(--primary); background: var(--primary-light); }
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99,102,241,0.4);
}
.btn-lg { padding: 14px 32px; font-size: 16px; border-radius: var(--radius-md); }
.btn-secondary {
    background: white;
    color: var(--secondary);
    border: 1.5px solid var(--secondary);
}
.btn-secondary:hover {
    background: var(--secondary-light);
    transform: translateY(-1px);
}
.btn-outline {
    background: transparent;
    color: white;
    border: 1.5px solid rgba(255,255,255,0.5);
}
.btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: white;
}
.btn-white {
    background: white;
    color: var(--secondary);
}
.btn-white:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* ========== 购物车角标（全局导航，所有页面共用） ========== */
.nav-cart {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: var(--gray-600);
    transition: background .2s, color .2s;
}
.nav-cart:hover { background: var(--gray-50); color: var(--primary); }
.nav-cart svg { width: 22px; height: 22px; }
.cart-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    align-items: center;
    justify-content: center;
}

/* 移动端专属菜单项（桌面端隐藏，移动端显示） */
.mobile-only { display: none; }
@media (max-width: 960px) {
    .mobile-only { display: block; }
    .mobile-only a { display: flex; align-items: center; padding: 14px 20px; }
    .mobile-only .btn { display: block; }
}

/* ==================== 登录/注册弹窗（全局，所有页面共用） ==================== */
.auth-mask {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(15, 23, 42, 0.5);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
    padding: 20px;
}
.auth-mask.show { opacity: 1; visibility: visible; }
.auth-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%; max-width: 420px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 32px;
    position: relative;
    transform: translateY(20px);
    transition: transform .25s ease;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
}
.auth-mask.show .auth-modal { transform: translateY(0); }
.auth-close {
    position: absolute; top: 16px; right: 16px;
    background: none; border: none; color: var(--gray-400);
    font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.auth-close:hover { color: var(--gray-600); background: var(--gray-50); }
.auth-header { text-align: center; margin-bottom: 24px; }
.auth-header h2 { font-size: 22px; font-weight: 700; color: var(--gray-800); margin: 0 0 6px; }
.auth-subtitle { font-size: 13px; color: var(--gray-400); margin: 0; }
.auth-tabs {
    display: flex; background: var(--gray-50); border-radius: 10px;
    padding: 4px; margin-bottom: 20px;
}
.auth-tab {
    flex: 1; border: none; background: transparent;
    padding: 10px; border-radius: 8px; cursor: pointer;
    font-size: 14px; color: var(--gray-500); font-weight: 500;
    transition: all .15s ease;
}
.auth-tab.active { background: #fff; color: var(--primary); box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label { font-size: 13px; color: var(--gray-600); font-weight: 500; }
.auth-field input {
    padding: 11px 14px; border: 1px solid var(--gray-200);
    border-radius: 8px; font-size: 14px; transition: border-color .15s;
}
.auth-field input:focus { outline: none; border-color: var(--primary); }
.auth-code-row { display: flex; gap: 8px; }
.auth-code-row input { flex: 1; }
/* 弹窗内「获取验证码」按钮：白底主色描边（.btn-outline 默认是深色背景用的白字，在弹窗里会隐形） */
.auth-code-row .btn {
    flex: none;
    padding: 0 14px;
    white-space: nowrap;
    border-radius: 8px;
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
    font-size: 13px;
}
.auth-code-row .btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.auth-error {
    background: #fef2f2; color: #dc2626;
    padding: 8px 12px; border-radius: 8px; font-size: 13px;
}
.auth-tip { font-size: 12px; color: var(--gray-400); text-align: center; margin: 0; }
.auth-tip a { color: var(--primary); }
/* 保持 7 天登录 */
.auth-remember {
    display: flex; align-items: center; gap: 8px;
    margin: 4px 2px;
    font-size: 13px; color: var(--gray-600);
    cursor: pointer; user-select: none;
}
.auth-remember input[type="checkbox"] {
    width: 16px; height: 16px; margin: 0;
    accent-color: var(--primary);
    cursor: pointer; flex-shrink: 0;
}

/* 快捷登录：三个表单区 */
.auth-pane { display: flex; flex-direction: column; gap: 16px; }
/* 图形验证码行（图片 + 输入框） */
.auth-captcha-row { display: flex; gap: 8px; align-items: center; }
.auth-captcha-row img { flex: none; }
.auth-captcha-row input { flex: 1; min-width: 0; }
.auth-captcha-img {
    width: 108px; height: 40px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--gray-50);
    object-fit: contain;
    cursor: pointer;
}
.auth-captcha-img.is-loading { opacity: .5; cursor: default; }
/* 发送验证码按钮禁用态 */
.auth-code-row .btn:disabled,
.auth-code-row button:disabled {
    opacity: .6;
    cursor: not-allowed;
}
/* 测试模式提示（绿色，区别于红色错误条） */
.auth-hint { font-size: 12px; color: #059669; margin: 0; }
/* 扫码登录：微信/支付宝入口 */
.auth-oauth-list { display: flex; flex-direction: column; gap: 12px; }
.auth-oauth-btn {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: #fff;
    color: var(--gray-700);
    font-size: 14px;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}
.auth-oauth-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
.auth-oauth-empty { font-size: 13px; color: var(--gray-400); text-align: center; margin: 0; padding: 8px 0; }
/* 扫码登录：按钮下方内嵌授权页二维码 */
.auth-oauth-qr { display: flex; flex-direction: column; gap: 10px; }
.auth-oauth-frame {
    width: 100%;
    height: 320px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: #fff;
}
.auth-oauth-qr-tip { font-size: 12px; color: var(--gray-500); text-align: center; margin: 0; }
.auth-oauth-qr-actions { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.auth-link-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--primary);
    font-size: 12px;
    cursor: pointer;
}
.auth-link-btn:hover { text-decoration: underline; }
/* 新账号提示条：固定在页面顶部，层级高于弹窗遮罩 */
.auth-notice {
    position: fixed; top: 12px; left: 12px; right: 12px;
    z-index: 300;
    display: flex; align-items: center; gap: 10px;
    box-sizing: border-box;
    padding: 10px 14px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
    font-size: 13px; color: var(--gray-700);
}
.auth-notice a { color: var(--primary); font-weight: 600; text-decoration: none; }
.auth-notice .auth-notice-close {
    margin-left: auto; flex: none;
    background: none; border: none; padding: 2px 4px;
    color: var(--gray-400); font-size: 16px; line-height: 1;
    cursor: pointer;
}
.auth-notice .auth-notice-close:hover { color: var(--gray-600); }
@media (max-width: 480px) {
    .auth-notice { top: 8px; left: 8px; right: 8px; font-size: 12px; padding: 8px 10px; }
    .auth-tab { font-size: 13px; padding: 9px 4px; }
    .auth-captcha-img { width: 96px; height: 38px; }
}

/* ==================== 顶部导航用户菜单（登录后展示） ==================== */
.user-menu {
    position: relative;
}
.user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-700);
    text-decoration: none;
    transition: all .2s;
}
.user-trigger:hover { border-color: var(--primary); color: var(--primary); }
.user-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}
.user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 160px;
    background: #fff;
    border: 1px solid var(--gray-100);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all .2s ease;
    z-index: 50;
}
.user-menu.open .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.user-dropdown a {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--gray-700);
    font-size: 14px;
    text-decoration: none;
    transition: background .15s;
}
.user-dropdown a:hover { background: var(--gray-50); color: var(--primary); }
.user-dropdown .logout-link { color: #dc2626; }
.user-dropdown .logout-link:hover { background: #fef2f2; color: #dc2626; }
.user-dropdown-divider {
    height: 1px;
    background: var(--gray-100);
    margin: 4px 0;
}

/* ========== 卡片组件 ========== */
.adv-card {
    background: white;
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    transition: all 0.3s ease;
}
.adv-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.product-card {
    background: white;
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}
.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}
.product-card.featured {
    border: 2px solid var(--secondary);
    position: relative;
    background: linear-gradient(180deg, #f5f3ff 0%, white 30%);
}
.product-card.featured::before {
    content: 'AI友好升级';
    position: absolute;
    top: -1px; right: 20px;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: white;
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 0 0 6px 6px;
    font-weight: 600;
}

.template-item {
    display: block;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--gray-100);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.template-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.process-step {
    background: white;
    border-radius: var(--radius-lg);
    padding: 28px 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    position: relative;
}
.process-step:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* ========== 徽章/标签组件 ========== */
.step-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--secondary-light);
    color: var(--secondary);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.template-geo-tag {
    font-size: 10px;
    background: var(--secondary-light);
    color: var(--secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* ========== GEO对比组件 ========== */
.geo-compare {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-100);
    overflow: hidden;
}
.geo-compare-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid var(--gray-100);
}
.geo-compare-tab {
    padding: 14px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
}
.geo-compare-tab.old {
    background: var(--gray-50);
    color: var(--gray-500);
    border-right: 1px solid var(--gray-100);
}
.geo-compare-tab.new {
    background: linear-gradient(135deg, var(--secondary-light), var(--primary-light));
    color: var(--secondary);
}
.geo-compare-body {
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.geo-col {
    padding: 14px;
    border-radius: var(--radius-md);
}
.geo-col.old {
    background: var(--gray-50);
}
.geo-col.new {
    background: linear-gradient(135deg, var(--secondary-light), var(--primary-light));
}
.geo-col h5 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--gray-700);
}
.geo-col.new h5 { color: var(--secondary); }
.geo-col ul {
    list-style: none;
    font-size: 12px;
}
.geo-col li {
    padding: 5px 0;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 6px;
}
.geo-col.old li::before {
    content: '✕';
    color: var(--gray-300);
    font-size: 11px;
}
.geo-col.new li::before {
    content: '✓';
    color: var(--success);
    font-size: 11px;
    font-weight: 700;
}

/* ========== 返回顶部浮动按钮 ========== */
.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 80px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(99,102,241,0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: all 0.3s ease;
    z-index: 999;
    border: none;
    text-decoration: none;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(99,102,241,0.5);
}
.back-to-top svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}
@media (max-width: 768px) {
    .back-to-top {
        right: 16px;
        bottom: 24px;
        width: 42px;
        height: 42px;
    }
    .back-to-top svg {
        width: 20px;
        height: 20px;
    }
}

/* 右上角语言切换下拉（自动翻译） */
.nav-lang {
    position: relative;
}
.nav-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--gray-600);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: background .2s, color .2s;
}
.nav-lang-btn:hover { background: var(--gray-50); color: var(--primary); }
.nav-lang-btn > svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}
.nav-lang-arrow svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .2s;
}
.nav-lang.open .nav-lang-arrow svg { transform: rotate(180deg); }
.nav-lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 140px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #fff;
    border: 1px solid var(--gray-100, #f1f5f9);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .2s, transform .2s, visibility .2s;
    z-index: 1100;
}
.nav-lang.open .nav-lang-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-lang-menu li {
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--gray-600);
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.nav-lang-menu li:hover { background: var(--gray-50); color: var(--primary); }
.nav-lang-menu li.active {
    background: rgba(14, 165, 233, .1);
    color: var(--primary);
    font-weight: 600;
}

/* 中窄屏：压缩导航间距，保留会员登录按钮，保证功能按钮区完整可见 */
@media (max-width: 1180px) {
    .nav-menu { gap: 12px; }
    .nav-actions { gap: 6px; }
    .nav-actions .btn { padding: 8px 12px; font-size: 13px; }
    .nav-lang-btn { padding: 0 4px; }
}

/* 移动菜单内语言切换行（简/繁/En） */
@media (max-width: 960px) {
    .mobile-lang { display: flex; align-items: center; gap: 12px; padding: 12px 20px; }
    .mobile-lang-label { font-size: 14px; color: var(--gray-600); }
    .mobile-lang-opts { display: flex; gap: 8px; }
    .mobile-lang-opts button {
        min-width: 44px;
        height: 32px;
        padding: 0 12px;
        border: 1px solid var(--gray-200, #e2e8f0);
        border-radius: 8px;
        background: transparent;
        color: var(--gray-600);
        font-size: 13px;
        font-family: inherit;
        cursor: pointer;
        transition: background .15s, color .15s, border-color .15s;
    }
    .mobile-lang-opts button.active {
        background: var(--primary);
        border-color: var(--primary);
        color: #fff;
    }
}

/* 移动菜单：登录态用户名展开子菜单（用户中心/我的订单） */
.mobile-user-submenu {
    display: none;
    margin: 4px 16px 8px 32px;
    padding: 4px 0;
    border-left: 2px solid var(--gray-100, #f1f5f9);
}
.mobile-user-submenu.open { display: block; }
.mobile-user-submenu a {
    display: block;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--gray-600);
    border-radius: 8px;
    transition: background .15s, color .15s;
}
.mobile-user-submenu a:hover {
    background: var(--gray-50);
    color: var(--primary);
}
.mobile-user-trigger::after {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-left: 8px;
    border-right: 1.8px solid currentColor;
    border-bottom: 1.8px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform .2s;
}
.mobile-user-trigger.open::after {
    transform: rotate(-135deg) translateY(-2px);
}

/* ========== FAQ 折叠卡（全站共享，交互约定 .active） ========== */
.faq-list { max-width: 860px; margin: 0 auto; }
.faq-item {
    background: #fff;
    border: 1px solid var(--gray-100, #f1f5f9);
    border-radius: var(--radius-md, 12px);
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.25s ease;
}
.faq-item:hover { border-color: var(--primary-light, #7dd3fc); }
.faq-item.active { border-color: var(--primary-light, #7dd3fc); box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.06)); }
.faq-question {
    width: 100%;
    text-align: left;
    padding: 20px 24px;
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800, #1e293b);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: inherit;
}
.faq-question::after {
    content: '+';
    font-size: 22px;
    color: var(--primary, #0ea5e9);
    font-weight: 400;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: 16px;
}
.faq-item.active .faq-question::after { content: '−'; }
.faq-answer {
    padding: 0 24px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    color: var(--gray-600, #475569);
    line-height: 1.75;
    font-size: 14px;
}
.faq-item.active .faq-answer {
    padding: 0 24px 20px;
    max-height: 400px;
}
