/* ============================================
   奢侈品电商平台 - 全局样式
   风格参考：Jimmy Choo 官网
   配色：黑白金 | 字体：Playfair Display + Helvetica Neue
   ============================================ */

/* ---------------------
   1. CSS 变量定义
   --------------------- */
:root {
    /* 颜色 */
    --color-primary: #000000;
    --color-secondary: #FFFFFF;
    --color-accent: #C9A96E;
    --color-background: #FAFAFA;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-border: #E5E5E5;
    --color-error: #C41E3A;
    --color-success: #2D5016;

    /* 字体 */
    --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;

    /* 间距 */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 40px;
    --spacing-xl: 64px;
    --spacing-2xl: 96px;

    /* 布局 */
    --max-width: 1400px;
    --nav-height: 100px;

    /* 过渡 */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;

    /* 圆角 */
    --radius-sm: 2px;
    --radius-md: 4px;

    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ---------------------
   2. CSS Reset / 基础样式
   --------------------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-background);
    /* 为固定导航栏留出空间 */
    padding-top: var(--nav-height);
    min-height: 100vh;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-accent);
}

ul, ol {
    list-style: none;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}


/* ---------------------
   3. 排版系统
   --------------------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    line-height: 1.2;
    color: var(--color-primary);
    letter-spacing: 0.02em;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
}

h2 {
    font-size: 2rem;
    margin-bottom: var(--spacing-md);
}

h3 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
}

h4 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
}

h5 {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-xs);
}

h6 {
    font-size: 1rem;
    margin-bottom: var(--spacing-xs);
}

p {
    margin-bottom: var(--spacing-sm);
    line-height: 1.8;
}

/* 小号文字 */
small, .text-small {
    font-size: 0.875rem;
}

/* 大号文字 */
.text-large {
    font-size: 1.125rem;
}

/* 文字颜色工具类 */
.text-accent {
    color: var(--color-accent);
}

.text-light {
    color: var(--color-text-light);
}

.text-error {
    color: var(--color-error);
}

.text-success {
    color: var(--color-success);
}

.text-center {
    text-align: center;
}

.text-uppercase {
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

/* ---------------------
   4. 布局容器
   --------------------- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--spacing-sm);
    padding-right: var(--spacing-sm);
}

.section {
    padding-top: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
}

.section-sm {
    padding-top: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
}

.main-content {
    min-height: calc(100vh - var(--nav-height));
}

/* ---------------------
   5. 响应式工具类
   --------------------- */

/* 仅移动端显示 */
.show-mobile {
    display: block;
}

.hide-mobile {
    display: none;
}

/* 平板断点 768px */
@media (min-width: 768px) {
    .container {
        padding-left: var(--spacing-md);
        padding-right: var(--spacing-md);
    }

    h1 { font-size: 3rem; }
    h2 { font-size: 2.25rem; }

    .show-mobile {
        display: none;
    }

    .hide-mobile {
        display: block;
    }

    .show-tablet {
        display: block;
    }

    .hide-tablet {
        display: none;
    }
}

/* 桌面断点 1024px */
@media (min-width: 1024px) {
    .container {
        padding-left: var(--spacing-lg);
        padding-right: var(--spacing-lg);
    }

    h1 { font-size: 3.5rem; }
    h2 { font-size: 2.5rem; }

    .section {
        padding-top: var(--spacing-2xl);
        padding-bottom: var(--spacing-2xl);
    }

    .show-desktop {
        display: block;
    }

    .hide-desktop {
        display: none;
    }
}

/* ---------------------
   6. 消息提示样式
   --------------------- */
.messages-container {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-sm);
    pointer-events: none;
}

.message {
    position: relative;
    width: 100%;
    max-width: 480px;
    padding: 14px 40px 14px 16px;
    margin-bottom: var(--spacing-xs);
    font-size: 0.875rem;
    text-align: center;
    letter-spacing: 0.02em;
    pointer-events: auto;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    animation: messageSlideIn 0.35s ease-out;
}

/* 消息关闭按钮 */
.message__close {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    opacity: 0.5;
    transition: opacity 0.2s;
    color: inherit;
}
.message__close:hover {
    opacity: 1;
}

/* 成功消息 */
.message-success {
    background-color: #f0f7ec;
    color: var(--color-success);
    border: 1px solid #b8d4a3;
}

/* 错误消息 */
.message-error {
    background-color: #fdf2f4;
    color: var(--color-error);
    border: 1px solid #e8a0ad;
}

/* 警告消息 */
.message-warning {
    background-color: #fdf8ef;
    color: #8a6914;
    border: 1px solid #e0c97a;
}

/* 信息消息 */
.message-info {
    background-color: var(--color-secondary);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

/* 消息滑入动画 */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------------------
   7. 可访问性辅助
   --------------------- */

/* 仅屏幕阅读器可见 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 焦点可见样式 */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}


/* ============================================
   8. 公告栏样式
   ============================================ */
.announcement-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    background-color: var(--color-primary);
    color: var(--color-secondary);
    height: 36px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.announcement-bar__track {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    animation: announcementScroll 20s linear infinite;
    font-size: 0.8125rem;
    letter-spacing: 0.05em;
    padding-left: 100%;
}

.announcement-bar__item {
    display: inline;
}

.announcement-bar__separator {
    display: inline;
    opacity: 0.5;
}

@keyframes announcementScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* 减少动画偏好时停止滚动 */
@media (prefers-reduced-motion: reduce) {
    .announcement-bar__track {
        animation: none;
        padding-left: 0;
        justify-content: center;
        width: 100%;
    }
}

/* ============================================
   9. 导航栏样式
   ============================================ */
.nav-bar {
    position: fixed;
    top: 36px;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--color-secondary);
    height: 64px;
    border-bottom: 1px solid var(--color-border);
    transition: box-shadow var(--transition-normal);
}

.nav-bar--scrolled {
    box-shadow: var(--shadow-md);
}

.nav-bar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

.nav-bar__left,
.nav-bar__right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 80px;
}

.nav-bar__right {
    justify-content: flex-end;
}

.nav-bar__center {
    flex: 1;
    text-align: center;
}

.nav-bar__logo {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--color-primary);
    text-decoration: none;
}

.nav-bar__logo:hover {
    color: var(--color-primary);
}

.nav-bar__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-primary);
    transition: opacity var(--transition-fast);
    position: relative;
}

.nav-bar__btn:hover {
    opacity: 0.6;
}

.nav-bar__btn--icon {
    text-decoration: none;
}

/* 未读消息角标 */
.nav-bar__badge {
    position: absolute;
    top: 4px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background-color: var(--color-error);
    color: var(--color-secondary);
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
}

/* ============================================
   10. 侧滑菜单样式
   ============================================ */

/* 遮罩层 */
.side-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1099;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.side-menu-overlay--visible {
    opacity: 1;
    visibility: visible;
}

/* 侧滑菜单面板 */
.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background-color: var(--color-secondary);
    z-index: 1100;
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.side-menu--open {
    transform: translateX(0);
}

.side-menu__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
    min-height: 64px;
}

.side-menu__title {
    font-size: 1.125rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.side-menu__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-primary);
    transition: opacity var(--transition-fast);
}

.side-menu__close:hover {
    opacity: 0.6;
}

/* 菜单导航列表 */
.side-menu__nav {
    flex: 1;
    padding: var(--spacing-sm) 0;
}

.side-menu__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.side-menu__item {
    border-bottom: 1px solid var(--color-border);
}

.side-menu__link {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.9375rem;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.side-menu__link:hover {
    background-color: var(--color-background);
    color: var(--color-accent);
}

/* 菜单底部 */
.side-menu__footer {
    padding: var(--spacing-md);
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.side-menu__auth-btn {
    display: block;
    width: 100%;
    padding: 12px;
    text-align: center;
    font-size: 0.875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid var(--color-primary);
    background-color: var(--color-primary);
    color: var(--color-secondary);
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.side-menu__auth-btn:hover {
    background-color: var(--color-text);
    color: var(--color-secondary);
}

.side-menu__auth-btn--outline {
    background-color: transparent;
    color: var(--color-primary);
}

.side-menu__auth-btn--outline:hover {
    background-color: var(--color-primary);
    color: var(--color-secondary);
}

/* ============================================
   11. Footer 样式
   ============================================ */

.site-footer {
    background-color: #1a1a1a;
    color: #FFFFFF;
    margin-top: var(--spacing-xl);
}

/* 主要内容区域 */
.footer-main {
    padding: var(--spacing-xl) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

/* 网格布局 */
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xl);
    }
}

@media (min-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 80px;
    }
}

/* 列样式 */
.footer-column__title {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #FFFFFF !important;
    margin-bottom: var(--spacing-md);
}

.footer-column__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-column__list li {
    margin-bottom: var(--spacing-sm);
}

.footer-column__list a {
    color: #E0E0E0 !important;
    font-size: 0.875rem;
    text-decoration: none;
    transition: color var(--transition-fast);
    display: inline-block;
}

.footer-column__list a:hover {
    color: #C9A96E !important;
}

/* 版权信息 */
.footer-copyright {
    padding: var(--spacing-md) 0;
    text-align: center;
}

.footer-copyright p {
    font-size: 0.75rem;
    color: #AAAAAA !important;
    margin: 0;
    letter-spacing: 0.05em;
}

/* ============================================
   12. 客服浮动按钮与聊天小窗口样式
   ============================================ */
.cs-widget {
    position: fixed;
    bottom: 90px;
    right: 24px;
    z-index: 1100;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: var(--color-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.cs-widget:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    color: var(--color-secondary);
}

/* 客服按钮提示标签 */
.cs-widget__tooltip {
    position: absolute;
    right: 68px;
    background-color: var(--color-primary);
    color: var(--color-secondary);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateX(10px);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 提示标签箭头 */
.cs-widget__tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid var(--color-primary);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

/* 悬停时显示提示 */
.cs-widget:hover .cs-widget__tooltip {
    opacity: 1;
    transform: translateX(0);
}

/* 客服按钮未读消息角标 */
.cs-widget__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background-color: #ef4444;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.4);
    z-index: 1;
}

/* 聊天小窗口面板 */
.cs-chat-panel {
    position: fixed;
    bottom: 92px;
    right: 24px;
    z-index: 1099;
    width: 360px;
    height: 480px;
    background-color: var(--color-secondary);
    border: 1px solid var(--color-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 窗口头部 */
.cs-chat-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background-color: var(--color-primary);
    color: var(--color-secondary);
    flex-shrink: 0;
}

.cs-chat-panel__title {
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.cs-chat-panel__close {
    background: none;
    border: none;
    color: var(--color-secondary);
    cursor: pointer;
    padding: 4px;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.cs-chat-panel__close:hover {
    opacity: 1;
}

/* 消息列表区域 */
.cs-chat-panel__messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 空消息提示 */
.cs-chat-panel__empty {
    text-align: center;
    color: var(--color-text-light);
    padding: 40px 16px;
    font-size: 0.8125rem;
}

/* 消息气泡 */
.cs-chat-bubble {
    max-width: 80%;
    padding: 8px 12px;
    font-size: 0.8125rem;
    line-height: 1.5;
    word-break: break-word;
}

.cs-chat-bubble--user {
    align-self: flex-end;
    background-color: var(--color-primary);
    color: var(--color-secondary);
}

.cs-chat-bubble--staff {
    align-self: flex-start;
    background: #334155;
    color: #f1f5f9;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 18px 18px 18px 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.cs-chat-bubble__time {
    display: block;
    font-size: 0.625rem;
    margin-top: 3px;
    opacity: 0.6;
}

.cs-chat-bubble__sender {
    display: block;
    font-size: 0.625rem;
    margin-bottom: 2px;
    opacity: 0.7;
}

/* 输入区域 */
.cs-chat-panel__input-area {
    display: flex;
    align-items: center;
    border-top: 1px solid var(--color-border);
    flex-shrink: 0;
}

.cs-chat-panel__image-btn {
    padding: 10px 8px 10px 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
}

.cs-chat-panel__image-btn:hover {
    color: var(--color-accent);
}

.cs-chat-panel__input {
    flex: 1;
    padding: 10px 12px;
    border: none;
    outline: none;
    font-size: 0.8125rem;
    font-family: var(--font-body);
    background-color: var(--color-secondary);
    color: var(--color-text);
    min-height: 40px;
}

.cs-chat-panel__input::placeholder {
    color: #AAAAAA;
}

.cs-chat-panel__send {
    padding: 10px 14px;
    background-color: var(--color-primary);
    color: var(--color-secondary);
    border: none;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cs-chat-panel__send:hover {
    background-color: var(--color-text);
}

/* 移动端适配：小窗口全宽 */
@media (max-width: 480px) {
    .cs-chat-panel {
        width: calc(100vw - 16px);
        right: 8px;
        bottom: 88px;
        height: 400px;
    }

    .cs-widget {
        bottom: 80px;
        right: 16px;
    }
}

/* 客服聊天全屏页：浮动关闭按钮不遮挡输入区，并适配安全区 */
@media (max-width: 768px) {
    .chat-fullscreen-body .cs-widget {
        /* bottom: max(16px, env(safe-area-inset-bottom)); */
        right: max(16px, env(safe-area-inset-right));
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
    }

    .chat-fullscreen-body .cs-widget svg {
        width: 24px;
        height: 24px;
    }
}

/* ============================================
   13. 认证表单容器
   ============================================ */
.auth-form-wrapper {
    max-width: 480px;
    margin: 0 auto;
    padding: var(--spacing-lg) var(--spacing-md);
}
