* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    padding: 15px;
    font-size: 14px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header {
    background: #667eea;
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.header h1 {
    font-size: 2em;
    margin-bottom: 8px;
    font-weight: 300;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

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

.stat-number {
    font-size: 1.5em;
    font-weight: bold;
}

.stat-label {
    font-size: 0.8em;
    opacity: 0.9;
}

.controls {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 180px;
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

.filter-select {
    padding: 10px 15px 10px 15px;
    padding-right: 35px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    min-width: 140px;
    cursor: pointer;
    transition: border-color 0.3s ease;
    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 10px center;
    background-size: 16px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.reset-button {
    padding: 10px 20px;
    border: 1px solid #ff6b6b;
    border-radius: 8px;
    font-size: 14px;
    background: #ff6b6b;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
}

.reset-button:hover {
    background: #ff5252;
    border-color: #ff5252;
    transform: translateY(-1px);
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
}

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

.product-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #e9ecef;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.product-header {
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #e9ecef;
}

.product-name {
    font-size: 1.3em;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.3;
}

.product-model {
    font-size: 0.95em;
    color: #666;
    font-family: 'Courier New', monospace;
    background: #f1f3f4;
    padding: 4px 8px;
    border-radius: 3px;
    display: inline-block;
}

.product-category {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.85em;
    margin-top: 8px;
}

.product-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-desc {
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
    font-size: 1em;
}

.product-verified {
    color: #666;
    font-size: 0.9em;
    text-align: right;
    margin-top: 5px;
}

.no-verified {
    color: #999;
    font-style: italic;
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 12px;
}

.tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.8em;
}

.product-links-and-time {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    margin-bottom: 5px;
}

.product-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.product-link {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9em;
    padding: 6px 12px;
    border: 1px solid #667eea;
    border-radius: 5px;
    transition: all 0.3s;
}

.product-link:hover {
    background: #667eea;
    color: white;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: #f8f9fa;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    background: white;
    color: #333;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination button:hover:not(:disabled) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

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

.pagination .page-info {
    padding: 8px 15px;
    background: #667eea;
    color: white;
    border-radius: 5px;
    font-size: 0.9em;
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.1em;
    color: #666;
}

.no-results {
    text-align: center;
    padding: 40px;
    font-size: 1.1em;
    color: #666;
}

/* 暗色模式样式 */
[data-theme="dark"] body {
    background: #1a1a1a;
    color: #ffffff;
}

[data-theme="dark"] .container {
    background: #2d2d2d;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .header {
    background: #1a1a2e;
}

[data-theme="dark"] .controls {
    background: #252525;
    border-bottom-color: #404040;
}

[data-theme="dark"] .search-input {
    background: #333333;
    border-color: #404040;
    color: #ffffff;
}

[data-theme="dark"] .search-input::placeholder {
    color: #b3b3b3;
}

[data-theme="dark"] .filter-select {
    background: #333333 url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' 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") no-repeat right 10px center;
    background-size: 16px;
    border-color: #404040;
    color: #ffffff;
}

[data-theme="dark"] .tag {
    background: #4a5568;
    color: #ffffff;
}

[data-theme="dark"] .product-card {
    background: #333333;
    border-color: #404040;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .product-card:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .product-header {
    background: linear-gradient(135deg, #252525 0%, #2d2d2d 100%);
    border-bottom-color: #404040;
}

[data-theme="dark"] .product-name {
    color: #ffffff;
}

[data-theme="dark"] .product-model {
    color: #b3b3b3;
    background: #404040;
}

[data-theme="dark"] .product-category {
    background: #4a5568;
    color: white;
}

[data-theme="dark"] .product-desc {
    color: #b3b3b3;
}

[data-theme="dark"] .product-verified {
    color: #b3b3b3;
}

[data-theme="dark"] .no-verified {
    color: #b3b3b3;
}

[data-theme="dark"] .pagination {
    background: #252525;
}

[data-theme="dark"] .pagination .page-info {
    background: #4a5568;
    color: white;
}

[data-theme="dark"] .pagination button {
    background: #333333;
    border-color: #404040;
    color: #ffffff;
}

[data-theme="dark"] .pagination button:hover:not(:disabled) {
    background: #4a5568;
    color: #ffffff;
}

[data-theme="dark"] .product-link:hover {
    background: #4a5568;
    color: white;
}

[data-theme="dark"] .loading,
[data-theme="dark"] .no-results {
    color: #b3b3b3;
}

/* 主题切换按钮 */
.theme-toggle {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    height: fit-content;
}

.theme-toggle:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .theme-toggle {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

.theme-icon {
    font-size: 16px;
    transition: transform 0.3s ease;
}

[data-theme="dark"] .sun-icon {
    display: none;
}

[data-theme="dark"] .moon-icon {
    display: inline;
}

[data-theme="light"] .sun-icon {
    display: inline;
}

[data-theme="light"] .moon-icon {
    display: none;
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .header h1 {
        font-size: 1.8em;
    }

    .stats {
        flex-direction: row;
        gap: 12px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .stat-item {
        min-width: 80px;
    }

    .search-box {
        flex-direction: column;
    }

    /* 移动端主题切换按钮 - 右上角fixed定位 */
    .theme-toggle {
        position: fixed;
        top: 20px;
        right: 20px;
        bottom: auto;
        left: auto;
        padding: 12px;
        font-size: 12px;
        border-radius: 20px;
        z-index: 1000;
    }

    /* 移动端隐藏按钮文字，只显示图标 */
    .theme-toggle .theme-text {
        display: none;
    }
}