:root {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    line-height: 1.5;
    font-weight: 400;

    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary: #8b5cf6;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --background: #ffffff;
    --background-secondary: #f9fafb;
    --border: #e5e7eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

.dark {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary: #a78bfa;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --background: #111827;
    --background-secondary: #1f2937;
    --border: #374151;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

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

body {
    background-color: var(--background);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

main {
    flex: 1;
    padding: 1rem 0;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* 工具类 */
.hidden {
    display: none !important;
}

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

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }

/* 按钮基础样式 */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    border: none;
    outline: none;
    text-decoration: none;
    font-size: 0.875rem;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

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

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

.btn-outline:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

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

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-success:hover {
    background-color: #0da271;
}

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 卡片基础样式 */
.card {
    background-color: var(--background);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

/* Header 样式 */
header {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: var(--background);
    transition: all 0.3s;
    border-bottom: 1px solid var(--border);
}

header.scrolled {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.dark header.scrolled {
    background-color: rgba(17, 24, 39, 0.9);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.logo i {
    margin-right: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    /* 新增：确保PC端始终显示，优先级高于内联样式 */
    display: flex !important;
}
.nav-links.mobile-hidden {
    display: none !important;
}

.nav-links.mobile-show {
    display: flex !important;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.3s;
    font-size: 0.875rem;
    /* 新增：确保文字不会被意外隐藏 */
    display: inline-block !important;
    opacity: 1 !important;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-actions button {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
}

.user-actions button:hover {
    background-color: var(--background-secondary);
}

/* 下拉菜单样式 */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    margin-top: 0.5rem;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.dropdown:hover .dropdown-menu,
.dropdown-menu:hover {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* 为下拉菜单添加延迟隐藏效果 */
.dropdown-menu {
    pointer-events: none;
}

.dropdown:hover .dropdown-menu,
.dropdown-menu:hover {
    pointer-events: auto;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: var(--background-secondary);
    color: var(--primary);
}

.dropdown-item i {
    width: 20px;
    margin-right: 0.75rem;
    text-align: center;
}

/* 语言选择器样式 */
.language-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--background);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.language-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.language-select option {
    background: var(--background);
    color: var(--text-primary);
    padding: 0.5rem;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.25rem;
    width: 2.5rem;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
}
/* 新增：移动端适配（768px以下） */
@media (max-width: 767px) {
    /* 移动端默认隐藏导航 */
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--background);
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        border-bottom: 1px solid var(--border);
        z-index: 100;
        gap: 1rem;
        /* 移动端默认隐藏 */
        display: none !important;
    }

    /* 移动端显示菜单按钮 */
    .mobile-menu-btn {
        display: flex;
    }

    /* 移动端展开菜单时的样式 */
    .nav-links.mobile-show {
        display: flex !important;
    }
}
/* Slider 样式 */
.slider {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
}

.slider-container {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.slider-slide {
    min-width: 100%;
    position: relative;
}

.slider-slide img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    transition: transform 0.7s;
}

.slider-slide:hover img {
    transform: scale(1.05);
}

.slider-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: white;
}

.slider-content h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.slider-content p {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.slider-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
    z-index: 10;
}

.slider-control {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border: none;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-control:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.slider-indicators {
    position: absolute;
    bottom: 1rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    z-index: 10;
}

.slider-indicator {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.slider-indicator.active {
    width: 2rem;
    background-color: white;
}

/* Section 样式 */
section {
    margin: 3rem 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: bold;
}

.view-more {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
}

.view-more:hover {
    text-decoration: underline;
}

/* Source Code Grid 样式 */
.source-code-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.source-code-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-image {
    position: relative;
    overflow: hidden;
    height: 180px;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

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

.card-badge {
    position: absolute;
    top: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: bold;
    z-index: 1;
}

.badge-recommended {
    left: 0.5rem;
    background-color: var(--primary);
    color: white;
}

.badge-discount {
    right: 0.5rem;
    background-color: var(--danger);
    color: white;
}

.badge-new {
    left: 0.5rem;
    background-color: var(--success);
    color: white;
}

.card-content {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-meta {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.card-meta span {
    display: flex;
    align-items: center;
    margin-right: 0.75rem;
}

.card-meta i {
    margin-right: 0.25rem;
}

.card-meta .rating {
    color: #f59e0b;
}

.card-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.card-title a {
    text-decoration: none;
    color: var(--text-primary);
    transition: color 0.3s;
}

.source-code-card:hover .card-title a {
    color: var(--primary);
}

.card-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.card-tag {
    padding: 0.125rem 0.625rem;
    background-color: var(--background-secondary);
    color: var(--text-secondary);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.card-price {
    display: flex;
    align-items: baseline;
}

.current-price {
    font-weight: bold;
    color: var(--primary);
    font-size: 1.125rem;
}

.original-price {
    margin-left: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: line-through;
}

.favorite-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
}

.favorite-btn:hover {
    background-color: var(--background-secondary);
}

.favorite-btn.active {
    color: var(--danger);
}

/* Footer 样式 */
footer {
    background-color: var(--background-secondary);
    border-top: 1px solid var(--border);
    padding: 3rem 0 1.5rem;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-column h3 {
    font-size: 1.125rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.footer-column ul {
    list-style: none;
}

.footer-column li {
    margin-bottom: 0.5rem;
}

.footer-column a {
    text-decoration: none;
    color: var(--text-secondary);
    transition: color 0.3s;
    font-size: 0.875rem;
}

.footer-column a:hover {
    color: var(--primary);
}

.subscribe-form {
    display: flex;
    margin-bottom: 1rem;
}

.subscribe-input {
    flex-grow: 1;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem 0 0 0.5rem;
    background-color: var(--background);
    color: var(--text-primary);
    outline: none;
    font-size: 0.875rem;
}

.subscribe-btn {
    border-radius: 0 0.5rem 0.5rem 0;
    padding: 0.5rem 1rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: var(--background);
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color 0.3s;
}

.social-link:hover {
    background-color: var(--background-secondary);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.copyright {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary);
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background-color: var(--background);
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s;
    font-size: 0.875rem;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background-color: var(--background);
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s;
    font-size: 0.875rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
}

.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background-color: var(--background);
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s;
    font-size: 0.875rem;
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.form-error {
    color: var(--danger);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: none;
}

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

/* 筛选栏样式 */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: var(--background-secondary);
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background-color: var(--background);
    color: var(--text-primary);
    outline: none;
    font-size: 0.875rem;
    cursor: pointer;
}

/* 详情页样式 */
.detail-page {
    padding: 1rem 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: color 0.3s;
    font-size: 0.875rem;
}

.back-link:hover {
    color: var(--primary);
}

.back-link i {
    margin-right: 0.5rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

.detail-images {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.main-image {
    overflow: hidden;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    height: 300px;
}

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

.gallery-images {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.gallery-image {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: opacity 0.3s;
}

.gallery-image:hover {
    opacity: 0.8;
}

.detail-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.detail-title {
    font-size: 1.875rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.detail-meta {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
    gap: 1rem;
}

.detail-meta span {
    display: flex;
    align-items: center;
}

.detail-meta i {
    margin-right: 0.25rem;
}

.detail-price {
    text-align: right;
}

.detail-current-price {
    font-size: 1.875rem;
    font-weight: bold;
    color: var(--primary);
}

.detail-original-price {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: line-through;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.detail-tag {
    padding: 0.125rem 0.625rem;
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.detail-description h3,
.detail-features h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.detail-description p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.detail-features ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    list-style: none;
}

.detail-features li {
    display: flex;
    align-items: flex-start;
}

.detail-features i {
    color: var(--success);
    margin-right: 0.5rem;
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.detail-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.detail-actions .btn {
    flex: 1;
}

.detail-actions .btn-outline:last-child {
    flex: 0 0 auto;
}

.detailed-description {
    margin-top: 2rem;
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
}

.detailed-description h3 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.detailed-description ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.detailed-description li {
    margin-bottom: 0.5rem;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    background-color: var(--background);
    color: var(--text-primary);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.875rem;
    min-width: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
    background-color: var(--background-secondary);
}

.pagination-btn.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--border);
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* 消息提示 */
.toast {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background-color: var(--background);
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    max-width: 300px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

/* 认证页面样式 */
/* 旧的全屏居中样式 - 保留以兼容旧页面 */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(to bottom right, var(--background), var(--background-secondary));
}

/* 新的标准布局下的认证卡片样式 */
main .auth-card {
    width: 100%;
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: var(--background);
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    background-color: var(--background);
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.875rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-secondary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

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

.social-login {
    margin-top: 2rem;
    text-align: center;
}

.social-login p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.social-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: var(--background-secondary);
    color: var(--text-primary);
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.social-button:hover {
    background-color: var(--border);
}

/* 搜索框样式 */
.search-box {
    position: relative;
    max-width: 400px;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background-color: var(--background);
    color: var(--text-primary);
    outline: none;
    font-size: 0.875rem;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-links,
    .user-actions .btn {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    /* 认证页面响应式调整 */
    main .auth-card {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .auth-header h1 {
        font-size: 1.5rem;
    }

    .slider-slide img {
        height: 300px;
    }

    .slider-content h2 {
        font-size: 1.5rem;
    }

    .slider-content p {
        font-size: 0.875rem;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-actions {
        flex-direction: column;
    }

    .detail-features ul {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .filter-group {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .slider-slide img {
        height: 200px;
    }
    
    /* 认证页面移动端优化 */
    main .auth-card {
        margin: 0.5rem;
        padding: 1rem;
        width: calc(100% - 1rem);
    }
    
    .auth-header h1 {
        font-size: 1.4rem;
    }
    
    .auth-header p {
        font-size: 0.9rem;
    }
    
    /* 表单优化 */
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        padding: 0.65rem 0.85rem;
        font-size: 16px;
    }
    
    .btn {
        padding: 0.85rem 1rem;
        font-size: 1rem;
    }
    
    /* 社交登录优化 */
    .social-login p {
        font-size: 0.9rem;
        margin-bottom: 0.8rem;
    }
    
    .social-buttons {
        gap: 0.5rem;
    }
    
    .social-button {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    /* 页脚优化 */
    .auth-footer {
        font-size: 0.85rem;
    }
    
    .auth-footer a {
        font-size: 0.85rem;
    }

    .slider-content {
        padding: 1rem;
    }

    .slider-content h2 {
        font-size: 1.25rem;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .detail-title {
        font-size: 1.5rem;
    }

    .detail-current-price {
        font-size: 1.5rem;
    }

    .source-code-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .detail-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .detail-price {
        text-align: left;
    }
}

/* 超小屏幕设备优化 (320px以下) */
@media (max-width: 320px) {
    main .auth-card {
        margin: 0.25rem;
        padding: 0.75rem;
        width: calc(100% - 0.5rem);
    }
    
    .auth-header h1 {
        font-size: 1.25rem;
    }
    
    .auth-header p {
        font-size: 0.8rem;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        padding: 0.5rem 0.75rem;
        font-size: 14px;
    }
    
    .btn {
        padding: 0.75rem 0.85rem;
        font-size: 0.9rem;
    }
    
    .social-button {
        width: 2.25rem;
        height: 2.25rem;
    }
    
    .auth-footer {
        font-size: 0.8rem;
    }
}
/* 修复认证页面容器宽度问题 */
.auth-page .container {
    max-width: 1440px !important;
    padding: 0 1rem !important;
}

/* 确保认证页面内容区域正常显示 */
.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    margin: 2rem auto;
}

/* 个人中心样式 */
.user-center-layout {
    display: flex;
    gap: 2rem;
    margin: 2rem 0;
}

/* 侧边栏样式 */
.user-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.user-profile-card {
    background: var(--background);
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    overflow: hidden;
    background: var(--background-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar i {
    font-size: 2rem;
    color: var(--text-secondary);
}

.user-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0.5rem 0;
    color: var(--text-primary);
}

.user-email {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0.25rem 0 1rem;
}

.user-balance {
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: white;
    padding: 0.75rem;
    border-radius: 0.75rem;
    text-align: center;
}

.balance-label {
    font-size: 0.75rem;
    opacity: 0.9;
    display: block;
    margin-bottom: 0.25rem;
}

.balance-amount {
    font-size: 1.25rem;
    font-weight: 700;
}

.user-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.user-nav .nav-item {
    margin-bottom: 0.25rem;
}

.user-nav .nav-item a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.user-nav .nav-item a:hover {
    background: var(--background-secondary);
    color: var(--text-primary);
}

.user-nav .nav-item.active a {
    background: var(--primary);
    color: white;
}

.user-nav .nav-item a i {
    width: 20px;
    margin-right: 0.75rem;
    text-align: center;
}

.logout-link {
    color: var(--danger) !important;
}

.logout-link:hover {
    background: var(--danger) !important;
    color: white !important;
}

/* 主内容区样式 */
.user-main-content {
    flex: 1;
    min-width: 0;
}

.user-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.user-content-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-content-header h2 i {
    color: var(--primary);
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* 统计卡片样式 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--background);
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.stat-info h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* 最近活动样式 */
.recent-activity {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.activity-section {
    background: var(--background);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.section-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-all {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.view-all:hover {
    text-decoration: underline;
}

.recent-list, .order-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recent-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.75rem;
    background: var(--background-secondary);
    transition: background 0.3s ease;
}

.recent-item:hover {
    background: var(--border);
}

.item-image {
    width: 60px;
    height: 60px;
    border-radius: 0.5rem;
    overflow: hidden;
    flex-shrink: 0;
}

.item-image img, .placeholder-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
}

.placeholder-image i {
    color: var(--text-secondary);
    font-size: 1.5rem;
}

.item-info {
    flex: 1;
}

.item-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.95rem;
}

.item-info h4 a {
    color: var(--text-primary);
    text-decoration: none;
}

.item-info h4 a:hover {
    color: var(--primary);
}

.item-price {
    color: var(--primary);
    font-weight: 600;
    margin: 0.25rem 0;
}

.item-time {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin: 0;
}

.order-item {
    padding: 1rem;
    border-radius: 0.75rem;
    background: var(--background-secondary);
    border: 1px solid var(--border);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.order-no {
    font-weight: 600;
    color: var(--text-primary);
}

.order-status {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-0 {
    background: #fef3c7;
    color: #92400e;
}

.status-1 {
    background: #d1fae5;
    color: #065f46;
}

.status-2 {
    background: #fee2e2;
    color: #991b1b;
}

.order-body {
    margin-bottom: 1rem;
}

.order-body p {
    margin: 0.25rem 0;
    color: var(--text-primary);
}

.order-time {
    color: var(--text-secondary) !important;
    font-size: 0.875rem;
}

/* 表单样式 */
.form-card {
    background: var(--background);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

.form-card h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.settings-form .form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--background);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

.form-help {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.form-error {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--danger);
    display: none;
}

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

.input-with-toggle {
    position: relative;
    display: flex;
    align-items: center;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.25rem;
}

.password-toggle:hover {
    background: var(--background-secondary);
    color: var(--text-primary);
}

/* 按钮样式 */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

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

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* 设置项样式 */
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info h4 {
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
}

.setting-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* 响应式设计 */
@media (max-width: 992px) {
    .user-center-layout {
        flex-direction: column;
    }
    
    .user-sidebar {
        width: 100%;
    }
    
    .recent-activity {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .user-center-layout {
        gap: 1rem;
    }
    
    .form-card {
        padding: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .user-content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .user-profile-card {
        padding: 1rem;
    }
    
    .user-nav .nav-item a {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .form-card {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

/* 优化认证页面的响应式表现 */
@media (max-width: 768px) {
    .auth-card {
        padding: 1.5rem;
        margin: 1rem;
        max-width: none;
        width: calc(100% - 2rem);
    }

    .auth-page .container {
        padding: 0 0.5rem;
    }
    
    /* 表单元素优化 */
    .form-input,
    .form-select,
    .form-textarea {
        font-size: 16px; /* 防止iOS缩放 */
        padding: 0.75rem;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    /* 社交按钮调整 */
    .social-buttons {
        gap: 0.75rem;
    }
    
    .social-button {
        width: 2.75rem;
        height: 2.75rem;
    }
}
