/* ========================================
   旧物新缘 - 二手好物集市
   风格：温暖复古 + 工业感
======================================== */

:root {
    /* 主色调 */
    --color-bg: #f5f0e8;
    --color-bg-warm: #ebe4d8;
    --color-paper: #faf7f2;
    --color-cream: #fff8ed;
    
    /* 文字色 */
    --color-text: #3d3632;
    --color-text-light: #6b5f56;
    --color-text-muted: #9a8d82;
    
    /* 强调色 */
    --color-copper: #b87333;
    --color-copper-light: #d4956a;
    --color-copper-dark: #8a5624;
    --color-rust: #a0522d;
    --color-amber: #c9973b;
    
    /* 功能色 */
    --color-success: #5a8f5a;
    --color-warning: #c9973b;
    --color-error: #c45c5c;
    
    /* 成色标签色 */
    --color-new: #4a7c59;
    --color-excellent: #5a8f5a;
    --color-good: #c9973b;
    --color-fair: #b87333;
    
    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(61, 54, 50, 0.08);
    --shadow-md: 0 4px 12px rgba(61, 54, 50, 0.1);
    --shadow-lg: 0 8px 30px rgba(61, 54, 50, 0.15);
    --shadow-card: 0 2px 8px rgba(61, 54, 50, 0.06), 0 8px 24px rgba(61, 54, 50, 0.08);
    
    /* 边框 */
    --border-light: 1px solid rgba(61, 54, 50, 0.08);
    --border-medium: 1px solid rgba(61, 54, 50, 0.15);
    
    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* 字体 */
    --font-serif: 'Noto Serif SC', 'Songti SC', serif;
    --font-sans: 'Noto Sans SC', -apple-system, sans-serif;
    
    /* 过渡 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
    
    /* 层级 */
    --z-dropdown: 100;
    --z-modal: 200;
    --z-overlay: 150;
}

/* ========================================
   基础样式
======================================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 背景纹理 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(184, 115, 51, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(201, 151, 59, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

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

/* ========================================
   头部导航
======================================== */

.header {
    position: sticky;
    top: 0;
    background: rgba(245, 240, 232, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: var(--border-light);
    z-index: var(--z-dropdown);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 28px;
    color: var(--color-copper);
}

.logo-text {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: 0.02em;
}

.nav {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-light);
    padding: 8px 0;
    position: relative;
    transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-copper);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--color-copper);
    border-radius: 1px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-btn,
.cart-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-light);
    transition: all var(--transition-fast);
}

.search-btn:hover,
.cart-btn:hover {
    background: var(--color-bg-warm);
    color: var(--color-copper);
}

.cart-btn {
    position: relative;
}

.cart-count {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    background: var(--color-copper);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    opacity: 0;
    transform: scale(0.8);
    transition: all var(--transition-fast);
}

.cart-count.visible {
    opacity: 1;
    transform: scale(1);
}

/* 搜索栏 */
.search-bar {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--color-paper);
    border-bottom: var(--border-light);
    padding: 16px 24px;
    display: none;
    gap: 12px;
}

.search-bar.active {
    display: flex;
}

.search-bar input {
    flex: 1;
    height: 44px;
    padding: 0 16px;
    border: var(--border-medium);
    border-radius: var(--radius-md);
    font-size: 15px;
    background: var(--color-cream);
    transition: all var(--transition-fast);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--color-copper);
    box-shadow: 0 0 0 3px rgba(184, 115, 51, 0.1);
}

.search-close {
    width: 44px;
    height: 44px;
    font-size: 24px;
    color: var(--color-text-muted);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.search-close:hover {
    background: var(--color-bg-warm);
    color: var(--color-text);
}

/* ========================================
   主内容区
======================================== */

.main {
    min-height: calc(100vh - 64px - 100px);
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   Hero 区域
======================================== */

.hero {
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 24px 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 500px;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(36px, 6vw, 56px);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text);
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--color-text-light);
    margin-bottom: 32px;
    line-height: 1.7;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--color-copper);
    color: white;
    font-size: 15px;
    font-weight: 500;
    border-radius: var(--radius-xl);
    transition: all var(--transition-normal);
    box-shadow: 0 4px 16px rgba(184, 115, 51, 0.3);
}

.hero-btn:hover {
    background: var(--color-copper-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(184, 115, 51, 0.4);
}

.hero-decoration {
    position: absolute;
    right: 100px;
    top: 50%;
    transform: translateY(-50%);
    width: 400px;
    height: 400px;
}

.deco-circle {
    position: absolute;
    width: 300px;
    height: 300px;
    border: 2px solid var(--color-copper-light);
    border-radius: 50%;
    opacity: 0.3;
    animation: rotate 30s linear infinite;
}

.deco-circle::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    width: 40px;
    height: 40px;
    background: var(--color-copper-light);
    border-radius: 50%;
    opacity: 0.5;
}

.deco-pattern {
    position: absolute;
    top: 50px;
    left: 50px;
    width: 200px;
    height: 200px;
    background: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(184, 115, 51, 0.05) 10px,
            rgba(184, 115, 51, 0.05) 20px
        );
    border-radius: 50%;
    animation: rotate 20s linear infinite reverse;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========================================
   筛选栏
======================================== */

.filters {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 14px;
    color: var(--color-text-muted);
    font-weight: 500;
}

.filter-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tag {
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-light);
    background: var(--color-paper);
    border: var(--border-light);
    border-radius: var(--radius-xl);
    transition: all var(--transition-fast);
}

.filter-tag:hover {
    border-color: var(--color-copper-light);
    color: var(--color-copper);
}

.filter-tag.active {
    background: var(--color-copper);
    color: white;
    border-color: var(--color-copper);
}

/* ========================================
   商品列表
======================================== */

.products-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

.section-header {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 32px;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 28px;
    font-weight: 600;
}

.product-count {
    font-size: 14px;
    color: var(--color-text-muted);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* ========================================
   商品卡片
======================================== */

.product-card {
    background: var(--color-paper);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.product-image {
    position: relative;
    aspect-ratio: 4/3;
    background: var(--color-bg-warm);
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-new {
    background: var(--color-new);
    color: white;
}

.badge-excellent {
    background: var(--color-excellent);
    color: white;
}

.badge-good {
    background: var(--color-good);
    color: white;
}

.badge-fair {
    background: var(--color-fair);
    color: white;
}

.product-body {
    padding: 16px;
}

.product-category-tag {
    font-size: 11px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.product-name {
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}

.product-price {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-copper);
}

.product-original-price {
    font-size: 13px;
    color: var(--color-text-muted);
    text-decoration: line-through;
}

.product-sneak {
    font-size: 13px;
    color: var(--color-text-light);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    margin-top: 12px;
    border-top: var(--border-light);
}

.product-time {
    font-size: 12px;
    color: var(--color-text-muted);
}

.product-quick-add {
    width: 32px;
    height: 32px;
    background: var(--color-bg-warm);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-copper);
    font-size: 20px;
    transition: all var(--transition-fast);
}

.product-quick-add:hover {
    background: var(--color-copper);
    color: white;
}

/* ========================================
   分类页
======================================== */

.page-header {
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 24px 40px;
    text-align: center;
}

.page-header h2 {
    font-family: var(--font-serif);
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 12px;
}

.page-header p {
    font-size: 16px;
    color: var(--color-text-light);
}

.category-grid {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px 80px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.category-card {
    background: var(--color-paper);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-copper-light);
}

.category-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.category-card h3 {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.category-card p {
    font-size: 14px;
    color: var(--color-text-light);
}

/* ========================================
   关于页
======================================== */

.about-content {
    max-width: 700px;
    margin: 0 auto;
    padding: 60px 24px 80px;
}

.about-content h2 {
    font-family: var(--font-serif);
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 32px;
    text-align: center;
}

.about-text {
    background: var(--color-paper);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-card);
}

.about-text p {
    margin-bottom: 16px;
    line-height: 1.8;
}

.about-text h3 {
    font-family: var(--font-serif);
    font-size: 20px;
    margin: 32px 0 16px;
    color: var(--color-copper);
}

.about-text ol {
    margin-left: 24px;
    line-height: 2;
}

.about-text li {
    margin-bottom: 8px;
}

/* ========================================
   模态框
======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    padding: 24px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--color-paper);
    border-radius: var(--radius-lg);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    font-size: 28px;
    color: var(--color-text-muted);
    background: var(--color-bg-warm);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--color-text);
    color: white;
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

/* 商品详情 - 图片区 */
.product-gallery {
    padding: 24px;
    background: var(--color-bg-warm);
}

.gallery-main {
    aspect-ratio: 4/3;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-cream);
    margin-bottom: 12px;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumbs {
    display: flex;
    gap: 8px;
}

.gallery-thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.6;
    transition: all var(--transition-fast);
}

.gallery-thumb:hover,
.gallery-thumb.active {
    opacity: 1;
    border-color: var(--color-copper);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 商品详情 - 信息区 */
.product-info {
    padding: 32px 32px 32px 0;
}

.product-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.product-category,
.product-condition {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-sm);
}

.product-category {
    background: var(--color-bg-warm);
    color: var(--color-text-light);
}

.product-title {
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 16px;
    line-height: 1.3;
}

.product-price {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-copper);
    margin-bottom: 4px;
}

.product-original-price {
    font-size: 15px;
    color: var(--color-text-muted);
    text-decoration: line-through;
    margin-bottom: 20px;
}

.product-desc {
    font-size: 15px;
    line-height: 1.7;
    color: var(--color-text-light);
    margin-bottom: 20px;
}

.product-seller-note {
    background: var(--color-bg-warm);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
}

.product-seller-note h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-copper);
    margin-bottom: 8px;
}

.product-seller-note p {
    font-size: 14px;
    color: var(--color-text-light);
    line-height: 1.6;
}

.product-time {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 24px;
}

.product-actions {
    display: flex;
    gap: 12px;
}

.btn-primary {
    padding: 14px 32px;
    background: var(--color-copper);
    color: white;
    font-size: 15px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.btn-primary:hover {
    background: var(--color-copper-dark);
}

.btn-secondary {
    padding: 14px 32px;
    background: var(--color-bg-warm);
    color: var(--color-text);
    font-size: 15px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--color-text-muted);
    color: white;
}

/* ========================================
   购物车侧边栏
======================================== */

.cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    max-width: 100%;
    height: 100vh;
    background: var(--color-paper);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
    z-index: var(--z-modal);
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.cart-sidebar.active {
    transform: translateX(0);
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: var(--border-light);
}

.cart-header h3 {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 600;
}

.cart-close {
    width: 36px;
    height: 36px;
    font-size: 28px;
    color: var(--color-text-muted);
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.cart-close:hover {
    background: var(--color-bg-warm);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.cart-empty {
    text-align: center;
    padding: 60px 24px;
    color: var(--color-text-muted);
}

.cart-empty-hint {
    font-size: 14px;
    margin-top: 8px;
}

.cart-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: var(--border-light);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-bg-warm);
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-weight: 500;
    margin-bottom: 4px;
    line-height: 1.4;
}

.cart-item-price {
    font-size: 14px;
    color: var(--color-copper);
    font-weight: 600;
}

.cart-item-remove {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 8px;
    transition: color var(--transition-fast);
}

.cart-item-remove:hover {
    color: var(--color-error);
}

.cart-footer {
    padding: 20px 24px;
    border-top: var(--border-medium);
    background: var(--color-cream);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
    font-size: 15px;
}

.total-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-copper);
}

.btn-checkout {
    width: 100%;
    padding: 16px;
    background: var(--color-copper);
    color: white;
    font-size: 16px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.btn-checkout:hover {
    background: var(--color-copper-dark);
}

/* ========================================
   订单表单
======================================== */

.order-form {
    max-width: 500px;
    padding: 32px;
}

.order-form h2 {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--color-text);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: var(--border-medium);
    border-radius: var(--radius-md);
    background: var(--color-cream);
    transition: all var(--transition-fast);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-copper);
    box-shadow: 0 0 0 3px rgba(184, 115, 51, 0.1);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.order-summary {
    background: var(--color-bg-warm);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 24px;
}

.order-summary h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-text);
}

.order-summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 6px 0;
    color: var(--color-text-light);
}

.order-summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 600;
    padding-top: 12px;
    margin-top: 8px;
    border-top: var(--border-light);
}

.form-actions {
    display: flex;
    gap: 12px;
}

.form-actions .btn-primary,
.form-actions .btn-secondary {
    flex: 1;
}

/* ========================================
   成功弹窗
======================================== */

.success-content {
    max-width: 400px;
    padding: 48px 32px;
    text-align: center;
}

.success-icon {
    width: 72px;
    height: 72px;
    background: var(--color-success);
    color: white;
    font-size: 36px;
    font-weight: 300;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.success-content h2 {
    font-family: var(--font-serif);
    font-size: 24px;
    margin-bottom: 12px;
}

.success-content p {
    color: var(--color-text-light);
    margin-bottom: 8px;
}

.success-hint {
    font-size: 14px;
    color: var(--color-copper);
}

.success-content .btn-primary {
    margin-top: 24px;
}

/* ========================================
   遮罩层
======================================== */

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(61, 54, 50, 0.4);
    backdrop-filter: blur(4px);
    z-index: var(--z-overlay);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   页脚
======================================== */

.footer {
    background: var(--color-bg-warm);
    border-top: var(--border-light);
    padding: 32px 24px;
    text-align: center;
}

.footer-inner p {
    font-size: 14px;
    color: var(--color-text-light);
    margin-bottom: 8px;
}

.footer-note {
    font-size: 13px;
    color: var(--color-text-muted);
}

/* ========================================
   用户区域
======================================== */

.user-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-login {
    padding: 8px 20px;
    background: var(--color-copper);
    color: white;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-xl);
    transition: all var(--transition-fast);
}

.btn-login:hover {
    background: var(--color-copper-dark);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: var(--color-copper);
    color: white;
    font-size: 14px;
    font-weight: 600;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    font-size: 12px;
    color: var(--color-text-muted);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.btn-logout:hover {
    color: var(--color-error);
    background: rgba(196, 92, 92, 0.08);
}

/* ========================================
   登录/注册弹窗
======================================== */

.auth-form {
    max-width: 420px;
    padding: 36px 32px;
}

.auth-tabs {
    display: flex;
    margin-bottom: 28px;
    background: var(--color-bg-warm);
    border-radius: var(--radius-md);
    padding: 4px;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-muted);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    text-align: center;
}

.auth-tab.active {
    background: var(--color-paper);
    color: var(--color-copper);
    box-shadow: var(--shadow-sm);
}

.auth-panel {
    display: none;
}

.auth-panel.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

.btn-full {
    width: 100%;
    margin-top: 8px;
}

.auth-hint {
    text-align: center;
    font-size: 13px;
    color: var(--color-text-muted);
    margin-top: 16px;
}

.auth-hint a {
    color: var(--color-copper);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.auth-hint a:hover {
    color: var(--color-copper-dark);
    text-decoration: underline;
}

.form-checkbox {
    display: flex;
    align-items: center;
}

.form-checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--color-text-light);
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-copper);
    cursor: pointer;
}

.form-checkbox a {
    color: var(--color-copper);
    text-decoration: underline;
}

.auth-error {
    background: rgba(196, 92, 92, 0.08);
    color: var(--color-error);
    font-size: 13px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    border-left: 3px solid var(--color-error);
    animation: shake 0.3s ease;
}

.auth-success {
    background: rgba(90, 143, 90, 0.08);
    color: var(--color-success);
    font-size: 13px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    border-left: 3px solid var(--color-success);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ========================================
   管理员按钮
======================================== */

.btn-admin {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-copper);
    background: rgba(184, 115, 51, 0.1);
    transition: all var(--transition-fast);
}

.btn-admin:hover {
    background: var(--color-copper);
    color: white;
}

/* ========================================
   管理员面板
======================================== */

.admin-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 600px;
    max-width: 100%;
    height: 100vh;
    background: var(--color-paper);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    z-index: var(--z-modal);
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.admin-panel.active {
    transform: translateX(0);
}

.admin-panel-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: var(--border-light);
}

.admin-header h2 {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 600;
}

.admin-close {
    width: 36px;
    height: 36px;
    font-size: 28px;
    color: var(--color-text-muted);
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.admin-close:hover {
    background: var(--color-bg-warm);
}

.admin-tabs {
    display: flex;
    padding: 0 24px;
    gap: 0;
    border-bottom: var(--border-light);
    overflow-x: auto;
}

.admin-tab {
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
}

.admin-tab:hover {
    color: var(--color-copper);
}

.admin-tab.active {
    color: var(--color-copper);
    border-bottom-color: var(--color-copper);
}

.admin-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

.admin-section-header h3 {
    font-family: var(--font-serif);
    font-size: 18px;
    margin-bottom: 16px;
}

.admin-empty {
    text-align: center;
    padding: 60px 24px;
    color: var(--color-text-muted);
    font-size: 15px;
}

/* 订单卡片 */
.admin-order-card {
    background: var(--color-cream);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
    border: var(--border-light);
}

.admin-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.order-id {
    font-size: 13px;
    color: var(--color-text-muted);
    font-family: monospace;
}

.order-status {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-xl);
}

.status-pending { background: #fff3cd; color: #856404; }
.status-confirmed { background: #d4edda; color: #155724; }
.status-shipped { background: #cce5ff; color: #004085; }
.status-completed { background: #d4edda; color: #155724; }
.status-cancelled { background: #f8d7da; color: #721c24; }

.admin-order-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.admin-order-info p {
    font-size: 13px;
    line-height: 1.6;
    color: var(--color-text-light);
}

.admin-order-item {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 4px 0;
    color: var(--color-text-light);
}

.admin-order-total {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px dashed rgba(61, 54, 50, 0.15);
    color: var(--color-copper);
}

.admin-order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: var(--border-light);
}

.order-time {
    font-size: 12px;
    color: var(--color-text-muted);
}

.status-select {
    padding: 6px 12px;
    font-size: 13px;
    border: var(--border-medium);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--color-text);
    cursor: pointer;
}

.status-select:focus {
    outline: none;
    border-color: var(--color-copper);
}

/* 商品管理 */
.admin-product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--color-text-muted);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.admin-product-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--color-cream);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 14px;
}

.admin-product-name {
    flex: 1;
    font-weight: 500;
}

.admin-product-price {
    color: var(--color-copper);
    font-weight: 600;
    min-width: 80px;
    text-align: right;
}

.admin-product-category,
.admin-product-condition {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: var(--color-bg-warm);
    color: var(--color-text-muted);
}

/* 用户管理 */
.admin-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--color-cream);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.admin-user-avatar {
    width: 36px;
    height: 36px;
    background: var(--color-copper);
    color: white;
    font-size: 14px;
    font-weight: 600;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-user-info {
    flex: 1;
}

.admin-user-name {
    display: block;
    font-size: 14px;
    font-weight: 500;
}

.admin-user-phone {
    font-size: 12px;
    color: var(--color-text-muted);
}

.admin-user-role {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: var(--radius-xl);
    font-weight: 500;
}

.role-admin {
    background: rgba(184, 115, 51, 0.12);
    color: var(--color-copper);
}

.role-user {
    background: var(--color-bg-warm);
    color: var(--color-text-muted);
}

/* 收款设置 */
.payment-section h4 {
    font-size: 15px;
    margin-bottom: 12px;
    color: var(--color-text);
}

.payment-hint {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 20px;
}

.payment-section small {
    display: block;
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

.payment-preview-box {
    background: var(--color-cream);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
}

.payment-qr-item {
    display: inline-block;
    margin: 8px;
    text-align: center;
}

.payment-qr-item img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    border-radius: var(--radius-md);
    border: 1px solid rgba(61, 54, 50, 0.1);
    background: white;
    padding: 8px;
}

.payment-qr-item p {
    font-size: 13px;
    color: var(--color-text-light);
    margin-top: 6px;
}

.no-qr {
    color: var(--color-text-muted);
    font-size: 13px;
    padding: 20px;
}

.payment-bank-info,
.payment-note-info {
    margin-top: 12px;
    font-size: 13px;
    color: var(--color-text-light);
}

/* ========================================
   订单成功 - 收款信息
======================================== */

.success-content .payment-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: var(--border-light);
    text-align: center;
}

.success-content .payment-section h3 {
    font-family: var(--font-serif);
    font-size: 18px;
    margin-bottom: 8px;
}

.payment-tip {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 16px;
}

.payment-qrcodes {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.payment-bank,
.payment-note-box {
    margin-top: 16px;
    font-size: 13px;
    color: var(--color-text-light);
    text-align: center;
}

/* ========================================
   响应式设计
======================================== */

@media (max-width: 900px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 60px 24px 40px;
    }
    
    .hero-content {
        margin-bottom: 40px;
    }
    
    .hero-decoration {
        position: relative;
        right: auto;
        transform: none;
        width: 250px;
        height: 250px;
        margin: 0 auto;
    }
    
    .modal-body {
        grid-template-columns: 1fr;
    }
    
    .product-info {
        padding: 0 24px 24px;
    }
    
    .product-gallery {
        padding: 16px;
    }
}

@media (max-width: 600px) {
    .header-inner {
        padding: 0 16px;
    }
    
    .nav {
        display: none;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .filters {
        padding: 0 16px 20px;
    }
    
    .filter-label {
        width: 100%;
    }
    
    .products-section {
        padding: 0 16px 60px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
    
    .product-body {
        padding: 12px;
    }
    
    .product-name {
        font-size: 15px;
    }
    
    .product-price {
        font-size: 17px;
    }
    
    .product-card-footer {
        display: none;
    }
    
    .cart-sidebar {
        width: 100%;
    }
    
    .admin-panel {
        width: 100%;
    }
    
    .admin-order-body {
        grid-template-columns: 1fr;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
        padding: 0 16px 60px;
    }
    
    .about-content {
        padding: 40px 16px 60px;
    }
    
    .about-text {
        padding: 24px;
    }
}

/* ========================================
   打印样式
======================================== */

@media print {
    .header,
    .cart-sidebar,
    .overlay,
    .footer {
        display: none;
    }
    
    .main {
        min-height: auto;
    }
}
