/* ============================================
   AI音乐创作平台 - 全局样式
   响应式设计 + 动画特效
   ============================================ */

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主题色 */
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    /* 中性色 */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f7fa;
    --bg-dark: #1a202c;
    --text-primary: #1a202c;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    
    /* 阴影 */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* 动画速度 */
    --transition-fast: 150ms;
    --transition-base: 300ms;
    --transition-slow: 500ms;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   顶部导航栏
   ============================================ */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 0 20px;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    animation: slideDown var(--transition-base) ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 26px;
    font-weight: 700;
    text-decoration: none;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform var(--transition-base);
}

.logo:hover {
    transform: scale(1.05);
}

.nav {
    display: flex;
    gap: 35px;
    align-items: center;
}

.nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding: 5px 0;
    transition: opacity var(--transition-base);
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: white;
    transition: width var(--transition-base);
}

.nav a:hover::after {
    width: 100%;
}

/* V4.0.0：导航链接禁用状态 */
.nav a.nav-disabled {
    opacity: 0.5;
    filter: grayscale(50%);
    cursor: not-allowed;
}

.nav a.nav-disabled:hover::after {
    width: 0;
}

.nav a.nav-disabled:hover {
    opacity: 0.5;
}

.nav a:hover {
    opacity: 0.9;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.points-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 移动端导航 */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 0;
    }
    
    .nav {
        width: 100%;
        justify-content: center;
        gap: 15px;
        margin-top: 10px;
        font-size: 14px;
    }
}

/* ============================================
   容器和卡片
   ============================================ */
.container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
}

.card {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    animation: fadeInUp var(--transition-base) ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* ============================================
   按钮组件
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #6c757d;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-lg {
    padding: 16px 36px;
    font-size: 18px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* ============================================
   表单组件
   ============================================ */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    transition: all var(--transition-base);
    background: var(--bg-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

select.form-control {
    cursor: pointer;
}

/* ============================================
   作品网格
   ============================================ */
.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    animation: fadeIn var(--transition-slow);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.work-item {
    background: var(--bg-primary);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    cursor: pointer;
}

.work-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.work-cover {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 64px;
    position: relative;
    overflow: hidden;
}

.work-cover::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.work-info {
    padding: 20px;
}

.work-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.work-meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.work-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 响应式 */
@media (max-width: 1200px) {
    .work-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .work-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }
    
    .work-cover {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .work-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   加载动画
   ============================================ */
.loading {
    text-align: center;
    padding: 50px;
}

.spinner {
    border: 4px solid rgba(102, 126, 234, 0.1);
    border-left-color: var(--primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   通知和提示
   ============================================ */
.alert {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight var(--transition-base);
}

@keyframes slideInRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success);
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--info);
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--warning);
}

/* ============================================
   模态框
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn var(--transition-base);
    backdrop-filter: blur(4px);
}

.modal {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: scaleIn var(--transition-base);
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================
   进度条
   ============================================ */
.progress {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 10px;
    transition: width var(--transition-slow);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

/* ============================================
   徽章和标签
   ============================================ */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-primary {
    background: var(--primary);
    color: white;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-warning {
    background: var(--warning);
    color: white;
}

.badge-danger {
    background: var(--danger);
    color: white;
}

/* ============================================
   统计卡片
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 28px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.stat-value {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.stat-label {
    font-size: 15px;
    opacity: 0.95;
    font-weight: 500;
}

/* ============================================
   表格
   ============================================ */
.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-primary);
}

table th {
    background: var(--bg-secondary);
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border);
}

table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

table tr {
    transition: background var(--transition-fast);
}

table tr:hover {
    background: var(--bg-secondary);
}

/* ============================================
   页脚
   ============================================ */
.footer {
    background: var(--bg-dark);
    color: rgba(255,255,255,0.8);
    text-align: center;
    padding: 40px 20px;
    margin-top: 60px;
}

.footer p {
    margin-bottom: 10px;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

/* ============================================
   音乐播放器样式
   ============================================ */
.audio-player {
    width: 100%;
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-md);
}

audio {
    width: 100%;
    outline: none;
}

/* ============================================
   工具类
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }

.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }

/* ============================================
   响应式工具
   ============================================ */
@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
}

@media (min-width: 769px) {
    .show-mobile { display: none !important; }
}

/* ============================================
   深色模式支持（可选）
   ============================================ */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1e293b;
        --bg-secondary: #0f172a;
        --text-primary: #f1f5f9;
        --text-secondary: #94a3b8;
        --border: #334155;
    }
}

/* ============================================
   打印样式
   ============================================ */
@media print {
    .header, .footer, .btn { display: none; }
    .card { box-shadow: none; border: 1px solid var(--border); }
}

