/* CHUNITHM 样式 - 暗色金黄主题 */

:root {
    --bg-primary: #1a150a;
    --bg-secondary: #2d2515;
    --bg-tertiary: #3d321f;
    --accent-primary: #ffc107;
    --accent-secondary: #ffd54f;
    --accent-glow: rgba(255, 193, 7, 0.3);
    --text-primary: #ffffff;
    --text-secondary: #ffe082;
    --text-muted: #8b7355;
    --border-color: #5c4a2a;
    --rarity-basic: #9e9e9e;
    --rarity-advanced: #4fc3f7;
    --rarity-expert: #ffca28;
    --rarity-master: #ff7043;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* 导航栏 */
.main-nav {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-bottom: 2px solid var(--accent-primary);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo .logo-img {
    height: 50px;
}

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

.nav-link {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.nav-link.chu {
    background: var(--accent-primary);
    color: #000;
}

.nav-link.mai {
    background: #1a2d4a;
    color: #7dd3fc;
}

.nav-link.mu3 {
    background: #3d1f28;
    color: #ff758f;
}

.nav-link:not(.active):hover {
    opacity: 0.8;
}

/* 主内容区 */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.filter-group select,
.filter-group input {
    padding: 0.6rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    min-width: 120px;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-group {
    flex: 1;
    min-width: 200px;
}

/* 数值筛选面板 */
.filter-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.filter-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filter-section label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.range-slider {
    position: relative;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    margin: 0.5rem 0;
}

.range-slider input[type="range"] {
    position: absolute;
    width: 100%;
    height: 6px;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
    top: 0;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.range-slider input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.range-values {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
}

@media (max-width: 768px) {
    .filter-panel {
        grid-template-columns: 1fr;
    }
}

.search-group input {
    width: 100%;
}

.result-count {
    color: var(--text-muted);
    font-size: 0.9rem;
    align-self: flex-end;
}

.page-range-info {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* 卡片网格 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card-item {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--border-color);
}

.card-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--accent-glow);
    border-color: var(--accent-primary);
}

/* 卡片信息 */
.card-info {
    padding: 1rem;
}

.card-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-character {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.card-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.card-image {
    aspect-ratio: 3/4;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
}

.card-layers {
    position: absolute;
    inset: 0;
}

.card-layers .layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card-info {
    padding: 1rem;
}

.card-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-character {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.card-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
}

/* 难度徽章 */
.rarity-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.rarity-badge.rarity-basic { background: var(--rarity-basic); color: #000; }
.rarity-badge.rarity-advanced { background: var(--rarity-advanced); color: #000; }
.rarity-badge.rarity-expert { background: var(--rarity-expert); color: #000; }
.rarity-badge.rarity-master { background: var(--rarity-master); color: #fff; }

/* 分类徽章 */
.category-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* 分类徽章颜色 */
.category-badge.category-basic {
    background: #4caf50;
    color: #fff;
}

.category-badge.category-advanced {
    background: #ffc107;
    color: #000;
}

.category-badge.category-expert {
    background: #f44336;
    color: #fff;
}

.category-badge.category-master {
    background: #9c27b0;
    color: #fff;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 2rem 0;
}

.page-btn {
    padding: 0.6rem 1.2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
}

.page-btn:hover:not(:disabled) {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #000;
}

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

.page-info {
    color: var(--text-secondary);
}

/* 页码跳转 */
.page-jump {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-input {
    width: 60px;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    text-align: center;
    font-size: 0.9rem;
}

.page-input:focus {
    border-color: var(--accent-primary);
    outline: none;
}

.go-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
}

/* 购物车按钮 */
.cart-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: none;
    color: #000;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 16px var(--accent-glow);
    transition: all 0.3s;
    z-index: 90;
}

.cart-toggle:hover {
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: #ff1744;
    border-radius: 50%;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* 购物车面板 */
.cart-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 2px solid var(--accent-primary);
    z-index: 200;
    transition: right 0.3s;
    display: flex;
    flex-direction: column;
}

.cart-panel.active {
    right: 0;
}

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

.cart-header h3 {
    color: var(--accent-secondary);
}

.cart-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.cart-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 1rem;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

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

.cart-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.cart-item-remove {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ff1744;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

.cart-footer {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.cart-footer button {
    flex: 1;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border: none;
    color: #000;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
    background: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-primary) 100%);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(255, 193, 7, 0.3);
}

/* 弹窗中的加入购物车按钮 */
.modal-actions .btn-primary {
    width: 100%;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.modal-actions .btn-primary::before {
    content: '+';
    font-size: 1.2rem;
    font-weight: 400;
}

/* 加入购物车按钮 - 与 maimai 统一 */
.add-to-cart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border: none;
    border-radius: 12px;
    color: #000;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.4);
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 193, 7, 0.5);
    background: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-primary) 100%);
}

.add-to-cart-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.4);
}

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

.btn-secondary:hover {
    background: var(--bg-tertiary);
}

/* 弹窗 */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

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

.modal-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 2px solid var(--accent-primary);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
}

.modal-body {
    padding: 2rem;
}

.modal-preview {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.modal-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-title {
    font-size: 1.5rem;
    color: var(--accent-secondary);
    margin: 0;
}

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

.modal-tag {
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.modal-tag.secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.modal-stats {
    display: flex;
    gap: 1rem;
    justify-content: space-around;
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 8px;
}

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

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.modal-skills {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 8px;
}

.skill-item {
    margin-bottom: 0.8rem;
}

.skill-item:last-child {
    margin-bottom: 0;
}

.skill-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.skill-value {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.pricing-card {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 193, 7, 0.05) 100%);
    border: 1px solid rgba(255, 193, 7, 0.4);
    padding: 1rem;
    border-radius: 8px;
}

.pricing-card h3 {
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.pricing-display {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-secondary);
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.input-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.input-group input {
    padding: 0.6rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qty-btn {
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.2rem;
}

.quantity-control input {
    width: 60px;
    text-align: center;
    padding: 0.5rem;
}

.modal-card-display {
    display: flex;
    gap: 2rem;
}

.modal-card-image {
    flex-shrink: 0;
    width: 300px;
    height: 400px;
    position: relative;
    background: var(--bg-tertiary);
    border-radius: 12px;
    overflow: hidden;
}

.modal-card-info {
    flex: 1;
}

.modal-card-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--accent-secondary);
}

.modal-card-character {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.modal-card-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.modal-card-stats {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.modal-card-stats h4 {
    margin-bottom: 1rem;
    color: var(--accent-secondary);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--text-secondary);
}

.stat-value {
    font-weight: 600;
    color: var(--accent-primary);
}

.modal-card-actions {
    display: flex;
    gap: 1rem;
}

.modal-card-actions button {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* 定价信息 */
.pricing-info {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 213, 79, 0.05) 100%);
    border: 1px solid rgba(255, 193, 7, 0.4);
    border-radius: 12px;
    padding: 1rem;
    margin: 1rem 0;
}

.pricing-info h3 {
    color: var(--accent-primary);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.pricing-display {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-secondary);
}

/* 状态提示 */
.loading-state,
.empty-state,
.error-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.error-state {
    color: #ff1744;
}

/* 响应式 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filter-bar {
        flex-direction: column;
    }
    
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cart-panel {
        width: 100%;
        right: -100%;
    }
    
    .modal-card-display {
        flex-direction: column;
    }
    
    .modal-card-image {
        width: 100%;
        height: 300px;
    }
}
