/* ===== 天府购 - Complete Stylesheet ===== */

/* CSS Variables */
:root {
    --primary-start: #a8c0d4;
    --primary-end: #7b68ee;
    --bg: #f5f0eb;
    --card-bg: #fff;
    --text-color: #333;
    --text-light: #666;
    --text-muted: #999;
    --price-color: #e74c3c;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --border-color: #e8e0d8;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.1);
    --radius: 10px;
    --radius-sm: 6px;
    --radius-pill: 50px;
    --nav-height: 56px;
    --transition: 0.2s ease;
}

/* ===== Reset & Normalize ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: var(--nav-height);
}

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

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

ul, ol {
    list-style: none;
}

input, button, textarea, select {
    font-family: inherit;
    font-size: inherit;
    outline: none;
    border: none;
}

button {
    cursor: pointer;
}

/* ===== Container ===== */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--nav-height);
    background: var(--card-bg);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.nav-container {
    display: flex;
    align-items: center;
    height: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 12px;
    position: relative;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex-shrink: 0;
    margin-right: 8px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
    display: none;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    font-size: 0.85rem;
    color: var(--text-light);
    white-space: nowrap;
    border-radius: var(--radius-pill);
    transition: all var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--text-color);
    background: rgba(0,0,0,0.03);
}

.nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    font-weight: 500;
}

.cart-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.7rem;
    color: #fff;
    background: var(--price-color);
    border-radius: var(--radius-pill);
    font-weight: 600;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
    font-size: 0.85rem;
}

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

.logout-link {
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.logout-link:hover {
    border-color: var(--price-color);
    color: var(--price-color);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-color);
    border-radius: 2px;
    transition: all var(--transition);
}

/* ===== Flash Messages ===== */
.flash-container {
    position: fixed;
    top: calc(var(--nav-height) + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: calc(100% - 32px);
    max-width: 440px;
    pointer-events: none;
}

.flash-message {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    text-align: center;
    box-shadow: var(--shadow);
    pointer-events: auto;
    animation: flashIn 0.3s ease, flashOut 0.3s ease 2.7s forwards;
}

.flash-message.flash-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-message.flash-danger,
.flash-message.flash-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flash-message.flash-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.flash-message.flash-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

@keyframes flashIn {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes flashOut {
    from { opacity: 1; }
    to { opacity: 0; transform: translateY(-8px); }
}

/* ===== Main Content ===== */
.main-content {
    min-height: calc(100vh - var(--nav-height) - 60px);
    padding: 16px 0;
}

/* ===== Footer ===== */
.footer {
    padding: 20px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
    margin-top: 24px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 24px;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    color: #fff;
    box-shadow: 0 2px 8px rgba(123, 104, 238, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(123, 104, 238, 0.35);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-danger {
    background: var(--danger-color);
    color: #fff;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-outline {
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--primary-end);
    color: var(--primary-end);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ===== Product Cards ===== */
.product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.product-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all var(--transition);
    cursor: pointer;
}

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

.product-card-image {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #e8e0d8, #ddd6cc);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    overflow: hidden;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card-body {
    padding: 10px 12px 12px;
}

.product-card-name {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    min-height: 2.5em;
}

.product-card-price-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.product-card-price {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--price-color);
}

.product-card-price::before {
    content: "\FFE5";
    font-size: 0.85rem;
}

.product-card-market-price {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.product-card-sales {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== Section Headers ===== */
.section-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 18px;
    background: linear-gradient(180deg, var(--primary-start), var(--primary-end));
    border-radius: 2px;
}

.section-more {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--primary-end);
    font-weight: 400;
}

/* ===== Hero Banner ===== */
.hero-banner {
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    border-radius: var(--radius);
    padding: 36px 24px;
    text-align: center;
    margin-bottom: 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.hero-banner::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}

.hero-banner::after {
    content: "";
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 150px;
    height: 150px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}

.hero-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.hero-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
    font-weight: 300;
}

/* ===== Category Grid (Home) ===== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 4px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all var(--transition);
    cursor: pointer;
}

.category-item:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.category-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
}

.category-name {
    font-size: 0.78rem;
    color: var(--text-light);
    text-align: center;
}

/* ===== Category Filter Tabs ===== */
.category-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 4px;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    flex-shrink: 0;
    padding: 7px 18px;
    font-size: 0.85rem;
    color: var(--text-light);
    background: var(--card-bg);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow);
    transition: all var(--transition);
    cursor: pointer;
    border: 1px solid transparent;
}

.category-tab:hover {
    color: var(--text-color);
    border-color: var(--primary-start);
}

.category-tab.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    border-color: transparent;
    font-weight: 500;
}

/* ===== Search Box ===== */
.search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    transition: border-color var(--transition);
}

.search-input:focus {
    border-color: var(--primary-end);
}

.search-btn {
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    color: #fff;
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

/* ===== Product Detail ===== */
.product-detail-image {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #e8e0d8, #ddd6cc);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 16px;
    overflow: hidden;
}

.product-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-detail-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
}

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

.product-detail-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--price-color);
}

.product-detail-price::before {
    content: "\FFE5";
    font-size: 1.2rem;
}

.product-detail-market-price {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.product-detail-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.product-detail-desc {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 16px;
}

/* Quantity Selector */
.quantity-selector {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 20px;
}

.qty-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    font-size: 1.1rem;
    color: var(--text-color);
    transition: background var(--transition);
    border: none;
}

.qty-btn:hover {
    background: #e8e0d8;
}

.qty-input {
    width: 50px;
    height: 38px;
    text-align: center;
    font-size: 0.95rem;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    background: var(--card-bg);
    -moz-appearance: textfield;
}

.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ===== Cart ===== */
.cart-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-item {
    display: flex;
    gap: 12px;
    background: var(--card-bg);
    padding: 12px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    align-items: center;
}

.cart-item-image {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #e8e0d8, #ddd6cc);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    overflow: hidden;
}

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

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

.cart-item-name {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--price-color);
    margin-bottom: 6px;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cart-item-subtotal {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--price-color);
    white-space: nowrap;
}

.cart-remove-btn {
    padding: 4px 8px;
    font-size: 0.72rem;
    color: var(--text-muted);
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-left: 8px;
}

.cart-remove-btn:hover {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

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

.cart-empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    display: block;
    opacity: 0.3;
}

.cart-empty-text {
    font-size: 1rem;
    margin-bottom: 16px;
}

.cart-footer {
    position: sticky;
    bottom: 0;
    background: var(--card-bg);
    padding: 12px 16px;
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 16px -16px -16px;
}

.cart-total {
    font-size: 1rem;
}

.cart-total-amount {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--price-color);
    margin-left: 4px;
}

/* ===== Checkout ===== */
.checkout-section {
    margin-bottom: 16px;
}

.checkout-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.checkout-address {
    background: var(--card-bg);
    padding: 14px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.checkout-address-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.checkout-address-detail {
    font-size: 0.85rem;
    color: var(--text-light);
}

.checkout-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkout-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--card-bg);
    padding: 10px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

.checkout-item-image {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #e8e0d8, #ddd6cc);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: var(--text-muted);
    overflow: hidden;
}

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

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

.checkout-item-name {
    font-size: 0.85rem;
    font-weight: 500;
}

.checkout-item-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.checkout-item-total {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--price-color);
}

.checkout-summary {
    background: var(--card-bg);
    padding: 14px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.checkout-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.checkout-summary-row.total {
    font-size: 1.1rem;
    font-weight: 700;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    margin-top: 6px;
}

.checkout-summary-row.total .checkout-summary-value {
    color: var(--price-color);
}

/* ===== Auth Forms ===== */
.auth-page {
    display: flex;
    justify-content: center;
    padding-top: 40px;
}

.auth-form-wrap {
    width: 100%;
    max-width: 360px;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-light);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: border-color var(--transition);
}

.form-input:focus {
    border-color: var(--primary-end);
    box-shadow: 0 0 0 3px rgba(123, 104, 238, 0.1);
}

.form-input::placeholder {
    color: #bbb;
}

.form-submit {
    width: 100%;
    padding: 13px;
    margin-top: 8px;
    font-size: 1rem;
}

.form-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-footer a {
    color: var(--primary-end);
    font-weight: 500;
}

.form-footer a:hover {
    text-decoration: underline;
}

.form-error {
    color: var(--danger-color);
    font-size: 0.8rem;
    margin-top: 4px;
}

/* ===== Member Page ===== */
.member-card {
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    border-radius: var(--radius);
    padding: 20px;
    color: #fff;
    margin-bottom: 20px;
}

.member-card-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.member-card-stats {
    display: flex;
    gap: 20px;
}

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

.member-stat-value {
    font-size: 1.4rem;
    font-weight: 700;
}

.member-stat-label {
    font-size: 0.78rem;
    opacity: 0.85;
    margin-top: 2px;
}

.member-level {
    display: inline-block;
    font-size: 0.78rem;
    padding: 2px 10px;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-pill);
    margin-top: 2px;
}

/* Member Tabs */
.member-tabs {
    display: flex;
    gap: 0;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.member-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
    cursor: pointer;
    transition: all var(--transition);
    border-bottom: 2px solid transparent;
}

.member-tab:hover {
    color: var(--text-color);
}

.member-tab.active {
    color: var(--primary-end);
    border-bottom-color: var(--primary-end);
    font-weight: 500;
}

.member-section {
    display: none;
}

.member-section.active {
    display: block;
}

/* Orders */
.order-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 12px;
    overflow: hidden;
}

.order-header {
    display: flex;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.82rem;
}

.order-no {
    color: var(--text-muted);
}

.order-status {
    font-weight: 500;
}

.order-status.pending {
    color: var(--warning-color);
}

.order-status.shipped,
.order-status.completed {
    color: var(--success-color);
}

.order-status.cancelled {
    color: var(--text-muted);
}

.order-body {
    padding: 12px 14px;
}

.order-item-summary {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.order-item-img {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #e8e0d8, #ddd6cc);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: var(--text-muted);
    overflow: hidden;
}

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

.order-item-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-item-qty {
    color: var(--text-muted);
}

.order-total-money {
    text-align: right;
    font-size: 0.88rem;
    color: var(--text-color);
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--border-color);
}

.order-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid var(--border-color);
}

.order-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    padding: 0 14px 10px;
}

/* Address Management */
.address-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.address-info {
    flex: 1;
}

.address-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.address-phone {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 4px;
}

.address-detail {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.address-default-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 1px 6px;
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    color: #fff;
    border-radius: 3px;
    margin-left: 6px;
}

.address-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    margin-left: 10px;
}

/* Address Form Toggle */
.address-form-wrap {
    margin-bottom: 16px;
}

.address-toggle-btn {
    width: 100%;
    padding: 12px;
    background: var(--card-bg);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.address-toggle-btn:hover {
    border-color: var(--primary-end);
    color: var(--primary-end);
}

.address-form {
    display: none;
    background: var(--card-bg);
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.address-form.show {
    display: block;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    font-size: 0.85rem;
    color: var(--text-color);
    transition: all var(--transition);
}

.page-link:hover {
    box-shadow: var(--shadow-hover);
}

.page-link.active {
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    color: #fff;
}

.page-link.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
    opacity: 0.3;
}

.empty-state-text {
    font-size: 1rem;
    margin-bottom: 16px;
}

/* ===== Loading Spinner ===== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ===== Desktop Responsive ===== */
@media (min-width: 768px) {
    .container {
        max-width: 960px;
    }

    .nav-container {
        max-width: 960px;
    }

    .nav-links {
        gap: 8px;
    }

    .nav-link {
        padding: 8px 16px;
        font-size: 0.95rem;
    }

    .product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }

    .category-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .hero-banner {
        padding: 60px 40px;
    }

    .hero-title {
        font-size: 2.4rem;
    }

    .hero-subtitle {
        font-size: 1.15rem;
    }

    .product-detail-image {
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    .cart-item {
        padding: 16px 20px;
    }

    .cart-item-image {
        width: 90px;
        height: 90px;
    }

    .auth-form-wrap {
        padding: 40px;
        background: var(--card-bg);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
    }

    .checkout-content {
        display: grid;
        grid-template-columns: 1fr 320px;
        gap: 20px;
    }

    .member-content {
        display: grid;
        grid-template-columns: 300px 1fr;
        gap: 20px;
    }

    .flash-container {
        max-width: 600px;
    }
}

/* ===== Mobile Nav Toggle ===== */
@media (max-width: 767px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--card-bg);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        padding: 8px 0;
        gap: 0;
        overflow: visible;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-link {
        padding: 12px 16px;
        border-radius: 0;
        width: 100%;
    }

    .nav-link.active {
        border-radius: 0;
    }

    .nav-user {
        display: none;
    }

    .nav-user.open {
        display: flex;
        padding: 8px 16px;
        border-top: 1px solid var(--border-color);
        position: absolute;
        top: calc(var(--nav-height) + 200px);
        left: 0;
        right: 0;
        background: var(--card-bg);
    }
}

/* ===== AI导购浮动气泡 ===== */
.ai-chat-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #4361ee, #7b68ee);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(67, 97, 238, 0.35);
    z-index: 1000;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ai-chat-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(67, 97, 238, 0.45);
}
.ai-chat-icon {
    font-size: 26px;
    line-height: 1;
}

/* ===== AI导购聊天面板 ===== */
.ai-chat-panel {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 360px;
    height: 500px;
    max-height: calc(100vh - 140px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: aiChatSlideUp 0.3s ease;
}
@keyframes aiChatSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.ai-chat-panel.open {
    display: flex;
}

/* Header */
.ai-chat-header {
    background: linear-gradient(135deg, #4361ee, #7b68ee);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.ai-chat-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
}
.ai-chat-header-icon {
    font-size: 20px;
}
.ai-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0.8;
}
.ai-chat-close:hover {
    opacity: 1;
    background: rgba(255,255,255,0.15);
}

/* Messages Area */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8f9fc;
}
.ai-chat-message {
    display: flex;
    max-width: 85%;
}
.ai-message {
    align-self: flex-start;
}
.user-message {
    align-self: flex-end;
}

/* Message Bubbles */
.ai-message-bubble,
.user-message-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}
.ai-message-bubble {
    background: #eef2ff;
    color: #333;
    border-bottom-left-radius: 4px;
}
.user-message-bubble {
    background: #4361ee;
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Input Area */
.ai-chat-input-area {
    display: flex;
    padding: 10px 12px;
    gap: 8px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
    flex-shrink: 0;
}
.ai-chat-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.ai-chat-input:focus {
    border-color: #4361ee;
}
.ai-chat-send {
    background: #4361ee;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 18px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}
.ai-chat-send:hover {
    background: #3451d1;
}
.ai-chat-send:disabled {
    background: #a0afd6;
    cursor: not-allowed;
}

/* Typing Indicator */
.ai-typing .ai-message-bubble {
    display: flex;
    gap: 4px;
    align-items: center;
}
.ai-typing .ai-message-bubble::after {
    content: "...";
    animation: aiTypingDot 1.2s infinite;
}
@keyframes aiTypingDot {
    0%, 20% { opacity: 0.3; }
    50% { opacity: 1; }
    80%, 100% { opacity: 0.3; }
}

/* Mobile */
@media (max-width: 480px) {
    .ai-chat-panel {
        width: calc(100vw - 32px);
        right: 16px;
        bottom: 80px;
        height: 60vh;
    }
    .ai-chat-bubble {
        bottom: 16px;
        right: 16px;
        width: 50px;
        height: 50px;
    }
}