/* ============================================
   兑换码平台样式文件
   ============================================ */

/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 根元素变量 */
:root {
    --primary-color: #667eea;
    --primary-hover: #5568d3;
    --success-color: #48bb78;
    --error-color: #f56565;
    --warning-color: #ed8936;
    --bg-color: #f7fafc;
    --card-bg: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* 页面基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 
                 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* 页面标题 */
.header {
    text-align: center;
    color: white;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 分类标签容器 */
.categories {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2rem;
}

/* 分类标签 */
.category-tag {
    background: white;
    color: var(--primary-color);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: var(--shadow);
}

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

.category-tag.active {
    background: var(--primary-color);
    color: white;
}

/* 兑换码容器 */
.codes-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* 兑换码卡片 */
.code-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.code-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.code-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.code-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.code-quantity {
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
}

.quantity-limited {
    background: #fff5f5;
    color: var(--error-color);
}

.quantity-unlimited {
    background: #f0fff4;
    color: var(--success-color);
}

.code-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* 口令提示 */
.password-hint {
    display: inline-block;
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.85rem;
    margin: 0.5rem 0;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.code-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.code-value {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 复制按钮 */
.copy-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.copy-btn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    transform: none;
}

/* 空状态 */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: white;
    font-size: 1.2rem;
}

/* 加载状态 */
.loading {
    text-align: center;
    color: white;
    font-size: 1.1rem;
}

/* 通知提示 */
.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    font-weight: 500;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

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

.notification.error {
    background: var(--error-color);
    color: white;
}

/* 页脚 */
.footer {
    text-align: center;
    color: white;
    padding: 2rem 1rem;
    margin-top: 3rem;
    opacity: 0.8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .codes-container {
        grid-template-columns: 1fr;
    }
    
    .notification {
        right: 1rem;
        left: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem 0.5rem;
    }

    .code-card {
        padding: 1rem;
    }
}

/* ============================================
   我的领取记录样式
   ============================================ */

.my-records-section {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-top: 2rem;
    overflow: hidden;
}

.records-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    user-select: none;
    transition: background 0.3s ease;
}

.records-header:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8b 100%);
}

.records-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.toggle-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.toggle-icon.expanded {
    transform: rotate(180deg);
}

.records-content {
    padding: 1.5rem;
}

.records-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.records-table th,
.records-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.records-table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--text-primary);
}

.records-table tr:hover {
    background: var(--bg-color);
}

.records-table code {
    background: #f7fafc;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--primary-color);
}

.no-records {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.record-time {
    font-size: 0.9rem;
    color: var(--text-secondary);
}
