/* ================================================================
   Ethereal Prism Design System v8.0
   Style: Sophisticated Light, Depth, Iridescent Accents
   ================================================================ */

:root {
    --bg-base: #f6f9ff; /* 带有微弱蓝调的极浅灰 */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --brand-accent: #6366f1; /* 靛蓝色 */
    --primary: #6366f1; /* 与语言下拉等内联样式兼容 */
    --prism-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow-prism: 0 20px 40px -10px rgba(99, 102, 241, 0.08);
    --border-light: rgba(15, 23, 42, 0.1);
    --border-strong: rgba(15, 23, 42, 0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-font-smoothing: antialiased; }

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* 动态流光背景 */
.prism-bg {
    position: fixed; inset: 0; z-index: -1;
    background: 
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.03) 0%, transparent 60%);
}

.container { max-width: 1300px; margin: 0 auto; padding: 0 40px; }

/* 顶栏：空灵透明 */
.pm-header {
    position: fixed; top: 0; left: 0; right: 0; height: 80px;
    background: rgba(246, 249, 255, 0.7); backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px); z-index: 10000;
    border-bottom: 1px solid var(--glass-border);
}
.pm-header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.pm-logo {
    display: inline-flex;
    align-items: center;
    width: 180px;
    height: 46px;
    background: url('../images/logo-zh.svg?v=3') no-repeat left center;
    background-size: contain;
    text-decoration: none;
    font-size: 0;          /* 隐藏原始文字，改用 SVG 图片 */
    line-height: 0;
    color: transparent;
    -webkit-text-fill-color: transparent;
    overflow: hidden;
    flex-shrink: 0;
}
.pm-logo span { display: none; }

.pm-nav { display: flex; gap: 12px; }
.pm-nav a { 
    padding: 10px 20px; border-radius: 14px; text-decoration: none;
    color: var(--text-secondary); font-weight: 600; font-size: 14px; transition: 0.3s;
}
.pm-nav a:hover, .pm-nav a.active { color: var(--text-primary); background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.03); }

/* 按钮：棱镜质感 */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 14px 32px; border-radius: 18px; font-size: 15px; font-weight: 700;
    cursor: pointer; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none; text-decoration: none;
}
.btn-prism { 
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    color: #fff;
    box-shadow: 0 10px 24px -6px rgba(99, 102, 241, 0.45);
}
.btn-prism:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 20px 36px -10px rgba(99, 102, 241, 0.55); }

.btn-secondary { background: #fff; color: var(--text-primary); border: 1px solid var(--glass-border); }
.btn-secondary:hover { background: #f8fafc; box-shadow: var(--shadow-prism); }

/* 玻璃卡片 */
.prism-card {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: 32px; backdrop-filter: blur(16px);
    box-shadow: var(--shadow-prism); transition: 0.4s;
}
.prism-card:hover { transform: translateY(-8px); border-color: rgba(99, 102, 241, 0.3); }

/* 动画：入场浮现 */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.reveal { opacity: 0; animation: fadeInUp 0.8s forwards; }
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }

/* 装饰：极光流光线条 */
.iridescent-line { height: 2px; width: 100px; background: var(--prism-gradient); border-radius: 2px; margin-bottom: 24px; }

/* 布局：便当盒变体 */
.bento-wrap { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; }
.bento-card { border-radius: 24px; padding: 32px; background: #fff; border: 1px solid var(--glass-border); box-shadow: var(--shadow-prism); }

/* 业务 ID 兼容 */
.hidden { display: none !important; }
#authBtn.hidden { display: none !important; }
#userMenu:not(.hidden) { display: inline-flex !important; align-items: center; }
.pm-user-menu-wrap { position: relative; display: inline-flex; align-items: center; }
.pm-user-menu-trigger { background: #fff; padding: 8px 16px; border-radius: 14px; border: 1px solid #e2e8f0; cursor: pointer; display: flex; align-items: center; gap: 10px; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--text-primary); }
.pm-user-avatar { width: 32px; height: 32px; background: var(--prism-gradient); border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; flex-shrink: 0; }

/* 顶栏右侧：多语言 + 登录 */
.pm-header-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
/* 顶栏「多语言」与「用户菜单」触发器同高（与多语言按钮 8px 纵向内边距 + 13px 文案 + 边框一致） */
.pm-header-actions .pm-lang-toggle {
    background: #fff;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 0 12px;
    height: 39px;
    min-height: 39px;
    max-height: 39px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    box-sizing: border-box;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}
.pm-btn-primary {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 24px; border-radius: 14px; font-size: 14px; font-weight: 700;
    border: none; cursor: pointer; font-family: inherit;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 55%, #ec4899 100%);
    color: #fff;
    box-shadow: 0 8px 20px -5px rgba(99, 102, 241, 0.45);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.pm-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -6px rgba(99, 102, 241, 0.55); }

/* 顶栏「立即登录」与多语言按钮同高（与 padding:8px 12px + 13px 文案 + 边框 的实测约 39px 对齐） */
.pm-header-actions #authBtn.pm-btn-primary {
    height: 39px;
    min-height: 39px;
    max-height: 39px;
    padding: 0 20px;
    font-size: 13px;
    line-height: 1;
    border-radius: 12px;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}
.pm-header-actions #authBtn.pm-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px -6px rgba(99, 102, 241, 0.5);
}

.pm-header-actions .pm-user-menu-trigger {
    padding: 0 12px 0 6px;
    height: 39px;
    min-height: 39px;
    max-height: 39px;
    line-height: 1;
    border-radius: 12px;
    border-color: var(--border-light);
    max-width: 240px;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.pm-header-actions .pm-user-menu-trigger .pm-user-avatar {
    width: 28px;
    height: 28px;
    font-size: 11px;
}
.pm-header-actions .pm-user-menu-trigger:hover {
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.1);
}
.pm-user-display-name {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left;
}
.pm-user-chevron { flex-shrink: 0; font-size: 10px; opacity: 0.5; color: var(--text-secondary); }

.pm-user-dropdown {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 8px 0;
    background: #fff; border: 1px solid var(--border-light); border-radius: 14px;
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.12); z-index: 10002;
}
.pm-user-dropdown-meta { padding: 12px 16px 10px; border-bottom: 1px solid rgba(15, 23, 42, 0.06); margin-bottom: 4px; }
.pm-user-dropdown-name { font-size: 14px; font-weight: 800; color: #0f172a; word-break: break-all; }
.pm-user-dropdown-email { font-size: 12px; color: var(--text-muted); margin-top: 4px; word-break: break-all; }
.pm-user-dropdown-item {
    display: flex; width: 100%; align-items: center; padding: 10px 16px; border: none; background: transparent;
    font-size: 13px; font-weight: 600; color: var(--text-primary); cursor: pointer; text-align: left; font-family: inherit;
    transition: background 0.15s;
}
.pm-user-dropdown-item:hover { background: rgba(99, 102, 241, 0.06); }
.pm-user-dropdown-item-logout { color: #dc2626; }
.pm-user-dropdown-item-logout:hover { background: rgba(220, 38, 38, 0.08); color: #b91c1c; }

/* 购买页等与英文站一致的导航类名（浅色顶栏） */
.pm-nav-links { display: flex; align-items: center; gap: 28px; }
.pm-nav-link {
    font-size: 14px; font-weight: 600; color: var(--text-secondary); text-decoration: none; transition: color 0.2s;
}
.pm-nav-link:hover, .pm-nav-link.active { color: var(--brand-accent); }

.pm-hamburger-btn {
    display: none; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
    width: 40px; height: 40px; background: #fff; border: 1px solid var(--border-light); border-radius: 12px;
    cursor: pointer; padding: 8px; flex-shrink: 0; transition: border-color 0.2s;
}
.pm-hamburger-btn:hover { border-color: rgba(99, 102, 241, 0.35); }
.pm-hamburger-line { display: block; width: 18px; height: 2px; background: var(--text-secondary); border-radius: 2px; transition: all 0.3s; }
.pm-hamburger-btn.open .pm-hamburger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.pm-hamburger-btn.open .pm-hamburger-line:nth-child(2) { opacity: 0; transform: scaleX(0); }
.pm-hamburger-btn.open .pm-hamburger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.pm-mobile-menu {
    display: none; position: fixed; top: 80px; left: 0; right: 0; z-index: 9998;
    background: rgba(255, 255, 255, 0.97); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light); padding: 12px 16px 20px; flex-direction: column; gap: 4px;
}
.pm-mobile-menu.open { display: flex; }
.pm-mobile-nav-link {
    display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-radius: 14px;
    font-size: 16px; font-weight: 700; color: var(--text-secondary); text-decoration: none;
    transition: all 0.2s; border: 1px solid transparent;
}
.pm-mobile-nav-link:hover { background: rgba(99, 102, 241, 0.06); color: var(--text-primary); }
.pm-mobile-nav-link.active {
    background: rgba(99, 102, 241, 0.1); border-color: rgba(99, 102, 241, 0.2); color: var(--brand-accent);
}

/* Toast 通知：固定于视口，避免无样式时随文档流出现在页脚附近 */
.toast-container {
    position: fixed;
    top: 92px;
    right: 20px;
    z-index: 10050;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    min-width: 300px;
    max-width: 400px;
    background: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlideIn 0.3s ease-out;
    border-left: 4px solid #7c3aed;
}

.toast.success { border-left-color: #10b981; }
.toast.error { border-left-color: #ef4444; }
.toast.warning { border-left-color: #f59e0b; }

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}
.toast.success .toast-icon { color: #10b981; }
.toast.error .toast-icon { color: #ef4444; }
.toast.warning .toast-icon { color: #f59e0b; }

.toast-content {
    flex: 1;
    font-size: 14px;
    color: #1e293b;
    line-height: 1.5;
}

.toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.2s;
}
.toast-close:hover { color: #64748b; }

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toastSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}
.toast.hiding {
    animation: toastSlideOut 0.3s ease-in forwards;
}

/* ── Footer ── */
.pm-footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
    gap: clamp(32px, 4vw, 52px);
    align-items: start;
}

.pm-footer-brand .pm-logo {
    margin-bottom: 16px;
}

.pm-footer--home .pm-footer-brand .pm-logo {
    margin-bottom: 16px;
}

.pm-footer-desc {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
    max-width: 288px;
    margin: 0;
}

.pm-footer-brand-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pm-footer-pill {
    font-size: 12px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    border: 1px solid transparent;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.pm-footer-pill--accent {
    color: var(--brand-accent);
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.2);
}

.pm-footer-pill--accent:hover {
    background: rgba(99, 102, 241, 0.15);
}

.pm-footer-pill--muted {
    color: var(--text-secondary);
    background: var(--glass-bg);
    border-color: var(--glass-border);
}

.pm-footer-pill--muted:hover {
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--brand-accent);
}

.pm-footer-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.pm-footer-heading {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 14px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.3;
}

.pm-footer-link {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    line-height: 1.45;
    margin-bottom: 10px;
    transition: color 0.2s;
}

.pm-footer-link:hover {
    color: var(--brand-accent);
}

.pm-footer-link-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: none;
    border: none;
    padding: 0;
    margin-bottom: 10px;
    font-size: 14px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.pm-footer-link-btn:hover {
    color: var(--brand-accent);
}

.pm-footer-link-btn:last-child {
    margin-bottom: 0;
}

.pm-footer-regions {
    margin-top: 6px;
    padding-top: 16px;
    border-top: 1px solid rgba(99, 102, 241, 0.1);
    width: 100%;
}

.pm-footer-region-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}

.pm-footer-region-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
}

.pm-footer-region-grid a {
    font-size: 13px;
    line-height: 1.35;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.pm-footer-region-grid a:hover {
    color: var(--brand-accent);
}

.pm-footer-bottom {
    margin-top: 48px;
    padding-top: 28px;
    border-top: 1px solid var(--glass-border);
    text-align: center;
}

.pm-footer-copy {
    color: var(--text-muted);
    font-size: 12px;
}

@media (max-width: 900px) {
    .pm-nav-links { display: none !important; }
    .pm-nav { display: none !important; }
    .pm-hamburger-btn { display: flex !important; }
    .pm-header-actions { gap: 8px; }
    .container { padding: 0 24px; }
    .pm-footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
}
@media (max-width: 640px) {
    .container { padding: 0 16px; }
    .pm-footer-grid { grid-template-columns: 1fr; gap: 28px; }
    /* 语言按钮在极小屏只显示图标 */
    .pm-lang-btn-text { display: none; }
}
@media (max-width: 520px) {
    .pm-header-actions .pm-user-display-name { display: none; }
    .toast-container {
        left: 12px;
        right: 12px;
        top: 88px;
    }
    .toast {
        min-width: unset;
        max-width: 100%;
        width: 100%;
        padding: 14px 16px;
    }
}
