.hidden {
    display: none !important;
}
/* --- 1. CSS 变量 (主题配置) --- */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --font-family-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --border-radius: 5px;
    --box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    --transition: all 0.2s ease-in-out;
}
/* --- 2. 全局与基础布局 --- */
* {
    box-sizing: border-box;
}
body {
    font-family: var(--font-family-sans);
    line-height: 1.6;
    margin: 0;
    background-color: var(--light-color);
    color: var(--dark-color);
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
/* --- 3. Header & Footer --- */
header {
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo img {
    height: 40px;
}
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}
nav ul li {
    margin-left: 20px;
}
nav ul li a {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 500;
    transition: var(--transition);
}
nav ul li a:hover {
    color: var(--primary-color);
}
.header-actions .cart-link {
    color: var(--dark-color);
    text-decoration: none;
    font-size: 1.2rem;
    position: relative;
}
footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
    border-top: 1px solid #dee2e6;
    color: var(--secondary-color);
    background-color: #fff;
}
/* --- 4. 按钮和表单组件 --- */
.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    text-decoration: none;
    cursor: pointer;
    font-size: 16px;
    text-align: center;
    transition: var(--transition);
}
.btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}
.btn-primary { background-color: var(--primary-color); }
.btn-secondary { background-color: var(--secondary-color); }
.btn-success { background-color: var(--success-color); }
.styled-form .form-group {
    margin-bottom: 1rem;
}
.styled-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}
.styled-form input[type="text"],
.styled-form input[type="email"],
.styled-form input[type="number"],
.styled-form input[type="password"],
.styled-form select,
.styled-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius);
    font-size: 16px; /* 防止iOS缩放 */
}
/* --- 5. 首页商品网格 --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.product-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
}
.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.product-info {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.product-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}
.price {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--danger-color);
    margin: 0.5rem 0;
}
.short-desc {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin: 0;
}
/* --- 6. 其他页面样式 --- */
/* 订单确认 */
.confirmation-box { background: #fff; padding: 2rem; border-radius: var(--border-radius); text-align: center; }
.order-details { text-align: left; margin: 2rem 0; }
.detail-row { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid #eee; }
.detail-row.total { font-weight: bold; font-size: 1.2rem; color: var(--danger-color); }
.next-steps { margin-top: 2rem; }
.next-steps .btn { margin: 0 10px; }
/* 购物车 */
.cart-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.cart-table th, .cart-table td { padding: 12px; border: 1px solid #dee2e6; text-align: left; }
.cart-table th { background-color: var(--light-color); }
.cart-summary { margin-top: 1.5rem; text-align: right; }
.cart-summary h3 { font-size: 1.5rem; }
/* 评价 */
.reviews-section { margin-top: 2rem; }
.review { border-bottom: 1px solid #eee; padding: 1rem 0; }
.review:last-child { border-bottom: none; }
.rating { color: var(--warning-color); }
.date { color: var(--secondary-color); font-size: 0.9em; }
/* 提示框 */
.alert { padding: 1rem; margin: 1rem 0; border-radius: var(--border-radius); }
.alert-success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.error { color: var(--danger-color); font-weight: bold; }
/* 后台 */
.admin-dashboard .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin: 2rem 0; }
.stat-card { background: #fff; padding: 1.5rem; border-radius: var(--border-radius); text-align: center; box-shadow: var(--box-shadow); }
.stat-card h3 { font-size: 2.5rem; margin: 0; color: var(--primary-color); }
.stat-card p { margin: 0; color: var(--secondary-color); }
/* --- 分页样式 --- */
.pagination-container {
    margin: 2rem 0;
    text-align: center;
}
.pagination-info {
    margin-bottom: 1rem;
    color: var(--secondary-color);
    font-size: 0.9rem;
}
.pagination {
    display: inline-flex;
    padding-left: 0;
    list-style: none;
    border-radius: var(--border-radius);
    margin: 0;
}
.page-item {
    margin: 0 2px;
}
.page-link {
    position: relative;
    display: block;
    padding: 0.5rem 0.75rem;
    margin-left: -1px;
    line-height: 1.25;
    color: var(--primary-color);
    background-color: #fff;
    border: 1px solid #dee2e6;
    text-decoration: none;
    transition: all 0.2s ease;
}
.page-link:hover {
    z-index: 2;
    color: #0056b3;
    text-decoration: none;
    background-color: #e9ecef;
    border-color: #dee2e6;
}
.page-item.active .page-link {
    z-index: 3;
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: #fff;
    border-color: #dee2e6;
}
/* 添加结算页面样式 */
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}
.order-summary {
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}
.shipping-info {
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}
.checkout-item {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}
.checkout-item:last-child {
    border-bottom: none;
}
.item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-right: 1rem;
}
.item-details h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}
.item-detail {
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 5px;
}
.customer-info {
    margin-top: 1.5rem;
}
.customer-info h3 {
    margin-bottom: 1rem;
    color: #333;
}
.item-price {
    margin: 0.25rem 0;
    color: var(--secondary-color);
    font-size: 0.9rem;
}
.item-subtotal {
    margin: 0;
    font-weight: bold;
    color: var(--primary-color);
}
.summary-total {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #eee;
}
.btn-block {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}
/* --- 8. 指南页面样式 --- */
.guide-content {
    background: #fff;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-top: 2rem;
}
.guide-steps {
    padding-left: 20px;
}
.guide-steps li {
    margin-bottom: 1.5rem;
}
.guide-steps h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}
.guide-tip {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: var(--light-color);
    border-left: 5px solid var(--info-color);
    border-radius: var(--border-radius);
}
.guide-tip h4 {
    margin-top: 0;
    color: var(--info-color);
}
/* --- 补充指南页面样式 --- */
.shipping-section, .after-sales-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
}
.shipping-section h2, .after-sales-section h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}
.policy-item {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #fff;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--success-color);
}
.policy-item h3 {
    color: var(--success-color);
    margin-top: 0;
}
.faq-item {
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: #fff;
    border-radius: var(--border-radius);
}
.faq-item h4 {
    color: var(--info-color);
    margin: 0 0 0.5rem 0;
}
.faq-item p {
    margin: 0;
    color: var(--secondary-color);
}
.shipping-section ul, .after-sales-section ul {
    margin: 0;
    padding-left: 20px;
}
.shipping-section li, .after-sales-section li {
    margin-bottom: 0.5rem;
}
/* --- 订单跟踪页样式 --- */
.order-details-box {
    margin-top: 2rem;
    padding: 2rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}
.order-status {
    font-weight: bold;
    color: var(--info-color);
}
/* --- 9. 后台管理页面样式 --- */
.admin-dashboard {
    margin-top: 2rem;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}
.stat-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--box-shadow);
    border-left: 5px solid var(--primary-color);
}
.stat-card h3 {
    font-size: 2.5rem;
    margin: 0;
    color: var(--primary-color);
}
.stat-card p {
    margin: 0.5rem 0 0 0;
    color: var(--secondary-color);
    font-size: 1.1rem;
}
.recent-orders-section {
    background: #fff;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}
.admin-table th, .admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}
.admin-table th {
    background-color: var(--light-color);
    font-weight: 600;
}
.admin-table tbody tr:hover {
    background-color: #f1f3f5;
}
/* 增强所有状态徽章的可见性 */
.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold; /* 确保文字加粗 */
    color: #fff; /* 默认白色文字 */
    border: 1px solid rgba(0, 0, 0, 0.1); /* 添加边框增强可见性 */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); /* 添加阴影增强立体感 */
}
/* 根据不同的订单状态显示不同的颜色 */
.status-未处理 {
    background-color: var(--warning-color);
    color: #000; /* 添加黑色文字增强对比度 */
    font-weight: bold; /* 加粗字体 */
}
.status-已处理 {
    background-color: var(--info-color);
    color: #fff; /* 保持白色文字 */
    font-weight: bold;
}
.status-已回复 {
    background-color: var(--success-color);
    color: #fff; /* 保持白色文字 */
    font-weight: bold;
}
.status-处理中 { background-color: var(--warning-color); }
.status-已发货 { background-color: var(--info-color); }
.status-已完成 { background-color: var(--success-color); }
.no-data {
    text-align: center;
    color: var(--secondary-color);
    padding: 2rem;
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    margin-top: 1rem;
}
/* --- 10. 全局JavaScript功能样式 --- */
/* 购物车数量徽章 */
.cart-count {
    display: none;
    background-color: var(--danger-color);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 5px;
    min-width: 18px;
    text-align: center;
    position: absolute;
    top: -8px;
    right: -8px;
}
/* 通知消息样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    color: white;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.notification.show {
    transform: translateX(0);
}
.notification-success {
    background-color: var(--success-color);
}
.notification-error {
    background-color: var(--danger-color);
}
.notification-info {
    background-color: var(--info-color);
}
/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
.back-to-top:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
/* 为导航栏中的购物车链接添加相对定位 */
.nav-item a {
    position: relative;
}
.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #6c757d;
}
.text-muted {
    color: var(--secondary-color) !important;
}
/* 输入验证状态 */
input:invalid {
    border-color: var(--danger-color);
}
input:valid {
    border-color: var(--success-color);
}
/* 错误提示增强 */
.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}
/*.alert-error {
    padding: 1rem;
    margin-top: 2rem;
    border-radius: var(--border-radius);
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
*/
.alert-error i {
    margin-right: 0.5rem;
}
/* 订单跟踪页面样式 */
.query-section {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}
.query-section h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary-color);
}
.advanced-search {
    margin-bottom: 1.5rem;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
}
.advanced-search summary {
    font-weight: 500;
    padding: 0.5rem 0;
    cursor: pointer;
    color: var(--secondary-color);
}
.advanced-search[open] summary {
    color: var(--primary-color);
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 1rem;
}
.advanced-search .form-group {
    margin-top: 1rem;
}
.btn-loading {
    display: inline-flex;
    align-items: center;
}
.btn-loading::after {
    content: "";
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* 验证码样式 */
.captcha-container {
    display: flex;
    align-items: center;
    gap: 10px;
}
.captcha-container input {
    flex: 1;
    max-width: 200px;
}
.captcha-container img {
    height: 40px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}
.captcha-container img:hover {
    border-color: var(--primary-color);
}
.captcha-container button {
    white-space: nowrap;
}
.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius);
    font-size: 16px; /* 防止iOS缩放 */
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.form-control:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}
.form-control::placeholder {
    color: #6c757d;
    opacity: 1;
}
/* 进度条样式 */
.progress {
    height: 20px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background-color: var(--success-color);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}
.table-responsive {
    overflow-x: auto;
}
.d-grid {
    display: grid;
    gap: 0.5rem;
}
.d-md-flex {
    display: flex;
}
.justify-content-md-start {
    justify-content: flex-start;
}
.gap-2 {
    gap: 0.5rem;
}
@media (max-width: 768px) {
    .captcha-container {
        flex-wrap: wrap;
    }
    .captcha-container input {
        max-width: 100%;
    }
}
/* 文件名变更提示样式 */
.filename-change-notice {
  background-color: #e7f3ff;
  border: 1px solid #b3d9ff;
  border-radius: 4px;
  padding: 10px;
  margin: 5px 0;
}
.filename-change-notice code {
  background-color: #f0f0f0;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: monospace;
}
.filename-change-notice .highlight {
  background-color: #fff3cd;
  border: 1px solid #ffeaa7;
  color: #856404;
}
.alipay-qrcode {
    width: 300px;
    height: 300px;
    border: 2px solid #ddd;
    border-radius: 8px;
    display: block;
    margin: 0 auto 20px auto;
}
/* --- 7. 响应式设计 --- */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    nav ul li {
        margin: 5px 10px;
    }
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }
    .order-layout, .detail-container {
        grid-template-columns: 1fr;
    }
    .detail-row {
        flex-direction: column;
    }
    .detail-row span {
        margin-bottom: 0.5rem;
    }
    .next-steps .btn {
        display: block;
        width: 100%;
        margin: 10px 0;
    }
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    .page-item {
        margin: 2px;
    }
    .page-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.875rem;
    }
    .pagination-info {
        font-size: 0.8rem;
    }
    .checkout-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .query-section {
        padding: 1rem;
    }
    .advanced-search {
        padding: 0.5rem;
    }
}
@media (max-width: 480px) {
    .page-link {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
    }
    .page-item:first-child .page-link,
    .page-item:last-child .page-link {
        display: none; /* 隐藏首页/尾页按钮 */
    }
}