/**
 * 赛博朋克科技风格样式
 * 抖音素材数据采集与分析系统
 */

/* ============================================
   CSS 变量定义
   ============================================ */
:root {
    /* 主色调 */
    --tech-blue: #3b82f6;
    --magic-purple: #8b5cf6;
    --magic-purple-light: #a78bfa;
    --vibrant-pink: #ec4899;

    /* 背景色 */
    --bg-primary: rgba(15, 23, 42, 0.98);
    --bg-secondary: rgba(30, 41, 59, 0.95);
    --bg-hover: rgba(30, 41, 59, 0.6);
    --bg-active: rgba(30, 41, 59, 0.8);

    /* 文字颜色 */
    --text-primary: rgba(255, 255, 255, 1);
    --text-secondary: rgba(255, 255, 255, 0.75);
    --text-muted: rgba(255, 255, 255, 0.65);

    /* 边框颜色 */
    --border-light: rgba(59, 130, 246, 0.1);
    --border-normal: rgba(59, 130, 246, 0.2);
    --border-strong: rgba(59, 130, 246, 0.6);

    /* 侧边栏宽度 */
    --sidebar-width: 280px;

    /* 过渡动画 */
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   基础重置
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--tech-blue);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--magic-purple-light);
}

/* ============================================
   登录页面样式
   ============================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    position: relative;
    overflow: hidden;
}

/* 背景动画效果 */
.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(10%, 10%) scale(1.1); }
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.95));
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--border-normal);
    border-radius: 20px;
    padding: 40px;
    box-shadow:
        0 4px 30px rgba(0, 0, 0, 0.4),
        0 0 60px rgba(59, 130, 246, 0.1);
    position: relative;
    z-index: 1;
}

.login-filing {
    position: fixed;
    right: 20px;
    bottom: 16px;
    left: 20px;
    z-index: 1;
    text-align: center;
    font-size: 13px;
}

.login-filing a {
    color: var(--text-muted);
}

.login-filing a:hover {
    color: var(--magic-purple-light);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa, #a78bfa, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(96, 165, 250, 0.3);
    margin-bottom: 8px;
}

.login-logo p {
    color: var(--text-muted);
    font-size: 14px;
}

/* ============================================
   表单样式
   ============================================ */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(30, 41, 59, 0.6);
    border: 2px solid var(--border-normal);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    transition: var(--transition-normal);
    outline: none;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    border-color: var(--tech-blue);
    box-shadow:
        0 0 0 4px rgba(59, 130, 246, 0.2),
        0 0 20px rgba(59, 130, 246, 0.1);
}

.form-input:hover:not(:focus) {
    border-color: rgba(59, 130, 246, 0.4);
}

/* ============================================
   按钮样式
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(139, 92, 246, 0.8));
    border: 2px solid var(--border-strong);
    color: #fff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 25px rgba(59, 130, 246, 0.4),
        0 0 30px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
    box-shadow:
        0 2px 10px rgba(59, 130, 246, 0.3),
        inset 0 2px 10px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: rgba(30, 41, 59, 0.8);
    border: 2px solid var(--border-normal);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--tech-blue);
    color: var(--text-primary);
}

.btn-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(236, 72, 153, 0.8));
    border: 2px solid rgba(239, 68, 68, 0.6);
    color: #fff;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
}

/* ============================================
   布局样式
   ============================================ */
.app-container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    min-height: 100vh;
    transition: var(--transition-normal);
}

/* ============================================
   侧边栏样式
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.95));
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-right: 2px solid transparent;
    border-image: linear-gradient(180deg,
        rgba(59, 130, 246, 0.5),
        rgba(139, 92, 246, 0.5),
        rgba(236, 72, 153, 0.5)) 1;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: var(--transition-normal);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--tech-blue), var(--magic-purple));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.sidebar-logo-text {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: 12px;
    color: var(--text-secondary);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-item:hover::before {
    left: 100%;
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.15));
    color: var(--text-primary);
    border: 1px solid var(--border-normal);
    box-shadow:
        0 4px 15px rgba(59, 130, 246, 0.2),
        inset 0 0 20px rgba(59, 130, 246, 0.05);
}

.nav-item.active .nav-icon {
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.8));
}

.nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.3));
    transition: var(--transition-normal);
}

.nav-text {
    font-size: 14px;
    font-weight: 500;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-hover);
    border-radius: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--magic-purple), var(--vibrant-pink));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================
   卡片样式
   ============================================ */
.card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.9));
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--border-normal);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: var(--transition-normal);
}

.card:hover {
    box-shadow:
        0 6px 25px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title-icon {
    font-size: 20px;
    filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.5));
}

/* ============================================
   统计卡片
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.9));
    backdrop-filter: blur(25px);
    border: 1px solid var(--border-normal);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-normal);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--tech-blue), var(--magic-purple));
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 8px 30px rgba(59, 130, 246, 0.2),
        0 0 40px rgba(59, 130, 246, 0.1);
}

.stat-card.excellent::before {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.stat-card.potential::before {
    background: linear-gradient(90deg, var(--tech-blue), #60a5fa);
}

.stat-card.normal::before {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.stat-card.poor::before {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.15));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.4));
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
}

/* ============================================
   表格样式
   ============================================ */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    background: rgba(30, 41, 59, 0.6);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.15));
}

.table th {
    padding: 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-normal);
}

.table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.table tbody tr {
    transition: var(--transition-fast);
}

.table tbody tr:hover {
    background: rgba(59, 130, 246, 0.1);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   徽章样式
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-excellent {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-potential {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-normal {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-poor {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ============================================
   页面标题
   ============================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    gap: 20px;
}

.page-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

.page-header-actions .btn {
    width: auto;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa, #a78bfa, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(96, 165, 250, 0.3);
    margin-bottom: 8px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

/* ============================================
   消息提示
   ============================================ */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

/* ============================================
   加载动画
   ============================================ */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-normal);
    border-top-color: var(--tech-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   移动端汉堡菜单
   ============================================ */
.hamburger {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.9));
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-normal);
    border-radius: 12px;
    cursor: pointer;
    z-index: 1001;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: var(--transition-normal);
}

.hamburger span {
    width: 20px;
    height: 2px;
    background: var(--tech-blue);
    border-radius: 2px;
    transition: var(--transition-normal);
}

.hamburger:hover {
    border-color: var(--tech-blue);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 999;
}

/* ============================================
   响应式设计
   ============================================ */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 90%;
        max-width: 320px;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        margin-left: 0;
        padding: 80px 20px 20px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .page-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .page-header-actions .btn {
        width: 100%;
    }

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

    .page-title {
        font-size: 24px;
    }

    .card {
        padding: 20px;
    }

    .table th,
    .table td {
        padding: 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 30px 24px;
    }

    .login-logo h1 {
        font-size: 24px;
    }

    .form-input {
        padding: 12px 14px;
    }

    .btn {
        padding: 12px 20px;
    }

    .stat-value {
        font-size: 28px;
    }
}

/* ============================================
   减少动画偏好
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   滚动条样式
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--tech-blue), var(--magic-purple));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #60a5fa, #a78bfa);
}

/* ============================================
   工具类
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }
