/* ============================================================
   common.css — X智算平台公共样式
   所有页面统一引用
   ============================================================ */

/* ===== CSS Variables ===== */
:root {
    --color-primary: #667eea;
    --color-primary-glow: rgba(102, 126, 234, 0.4);
    --color-secondary: #764ba2;
    --color-accent: #4facfe;
    --color-bg-deep: #0a0a1a;
    --color-bg-card: rgba(255, 255, 255, 0.04);
    --color-border-glow: rgba(102, 126, 234, 0.2);
    --color-text-main: #e8e8f0;
    --color-text-sub: #a0a0b8;
    --color-text-muted: #6a6a8a;
    --color-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    --radius-card: 20px;
    --radius-btn: 30px;
    --transition: all 0.3s ease;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-family);
    background: var(--color-bg-deep);
    min-height: 100vh;
    color: var(--color-text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== 背景动效 ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(102, 126, 234, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(118, 75, 162, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(79, 172, 254, 0.04) 0%, transparent 50%);
    z-index: 0;
    pointer-events: none;
}

/* ===== 浮动粒子 ===== */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--color-primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: floatParticle 20s infinite linear;
}
.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 25s; }
.particle:nth-child(2) { left: 25%; animation-delay: 2s; animation-duration: 18s; opacity: 0.2; }
.particle:nth-child(3) { left: 40%; animation-delay: 4s; animation-duration: 22s; }
.particle:nth-child(4) { left: 55%; animation-delay: 1s; animation-duration: 20s; opacity: 0.25; }
.particle:nth-child(5) { left: 70%; animation-delay: 3s; animation-duration: 28s; }
.particle:nth-child(6) { left: 85%; animation-delay: 5s; animation-duration: 16s; opacity: 0.2; }
.particle:nth-child(7) { left: 15%; top: 30%; animation-delay: 7s; animation-duration: 30s; opacity: 0.15; }
.particle:nth-child(8) { left: 60%; top: 60%; animation-delay: 2s; animation-duration: 24s; opacity: 0.2; }

@keyframes floatParticle {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    10% { opacity: 0.3; }
    90% { opacity: 0.3; }
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 40px;
    position: relative;
    z-index: 1;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); border-radius: 10px; }
::-webkit-scrollbar-thumb { background: rgba(102, 126, 234, 0.3); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }

/* ===== Navbar ===== */
.navbar {
    padding: 20px 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text-main);
    text-decoration: none;
}
.logo i {
    font-size: 28px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.3));
}
.logo span {
    color: var(--color-text-muted);
    font-weight: 400;
    font-size: 16px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ===== 面包屑 ===== */
.breadcrumb {
    padding: 16px 0 20px;
    font-size: 14px;
    color: var(--color-text-muted);
}
.breadcrumb a {
    color: var(--color-primary);
    text-decoration: none;
}
.breadcrumb a:hover {
    text-decoration: underline;
}
.breadcrumb .current {
    color: var(--color-text-main);
}

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-btn);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: var(--font-family);
}
.btn-outline {
    background: transparent;
    color: var(--color-text-sub);
    border: 1px solid rgba(255,255,255,0.1);
}
.btn-outline:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--color-primary);
    color: var(--color-text-main);
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.1);
}
.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 40px rgba(102, 126, 234, 0.4);
}
.btn-success {
    background: #48bb78;
    color: white;
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.25);
}
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(72, 187, 120, 0.3); }
.btn-danger {
    background: #fc8181;
    color: white;
}
.btn-danger:hover { background: #f56565; }
.btn-warning {
    background: #ed8936;
    color: white;
}
.btn-warning:hover { background: #dd6b20; }
.btn-glow {
    background: transparent;
    color: var(--color-text-main);
    border: 1px solid var(--color-primary);
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.05);
}
.btn-glow:hover {
    background: rgba(102, 126, 234, 0.08);
    box-shadow: 0 0 50px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}
.btn-back {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-sub);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
}
.btn-back:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-main);
    border-color: var(--color-primary);
}
.btn-sm { padding: 6px 16px; font-size: 13px; }
.btn-xs { padding: 4px 12px; font-size: 12px; border-radius: 20px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ===== 用户信息 ===== */
.balance-display {
    background: rgba(102, 126, 234, 0.1);
    padding: 6px 18px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text-main);
    border: 1px solid rgba(102, 126, 234, 0.15);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.balance-display .amount {
    color: var(--color-primary);
    font-size: 16px;
}
.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px 14px 4px 8px;
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.user-badge .avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}
.user-badge .username {
    font-weight: 500;
    font-size: 13px;
    color: var(--color-text-sub);
}

/* ===== Login Panel ===== */
.login-panel {
    max-width: 420px;
    margin: 80px auto;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-card);
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: var(--color-shadow);
}
.login-panel .logo-icon {
    text-align: center;
    font-size: 48px;
    margin-bottom: 8px;
}
.login-panel .logo-icon i {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.login-panel h2 {
    text-align: center;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--color-text-main);
}
.login-panel .form-group { margin-bottom: 16px; }
.login-panel .form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--color-text-sub);
    font-size: 14px;
}
.login-panel .form-group input,
.login-panel .form-group select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    font-size: 14px;
    color: var(--color-text-main);
    transition: var(--transition);
    font-family: var(--font-family);
}
.login-panel .form-group input:focus,
.login-panel .form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
.login-panel .form-group input::placeholder {
    color: var(--color-text-muted);
}
.login-panel .btn { width: 100%; justify-content: center; margin-top: 8px; }
.login-panel .flex-row { display: flex; gap: 12px; margin-top: 8px; }
.login-panel .flex-row .btn { flex: 1; }
.login-panel .text-muted { color: var(--color-text-muted); font-size: 13px; text-align: center; margin-top: 8px; }

/* ===== Toast ===== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
    width: 100%;
}
.toast {
    padding: 14px 20px;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    font-size: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    gap: 10px;
}
.toast-success { background: linear-gradient(135deg, #48bb78, #38a169); }
.toast-error { background: linear-gradient(135deg, #fc8181, #e53e3e); }
.toast-info { background: linear-gradient(135deg, #4299e1, #3182ce); }
.toast-warning { background: linear-gradient(135deg, #ed8936, #dd6b20); }
@keyframes slideIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===== Card ===== */
.card {
    background: var(--color-bg-card);
    border-radius: var(--radius-card);
    padding: 24px 28px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(8px);
    margin-bottom: 20px;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}
.card-header h3 {
    font-size: 18px;
    font-weight: 700;
}
.card-header h3 i {
    color: var(--color-primary);
    margin-right: 8px;
}

/* ===== 表单 ===== */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--color-text-sub);
    font-size: 14px;
}
.form-group label .required { color: #fc8181; margin-left: 2px; }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    font-size: 14px;
    color: var(--color-text-main);
    transition: var(--transition);
    font-family: var(--font-family);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.08);
}
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--color-text-muted);
}
.form-group textarea { resize: vertical; min-height: 70px; }
.form-group .hint { font-size: 12px; color: var(--color-text-muted); margin-top: 4px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }

/* ===== 通用工具类 ===== */
.text-muted { color: var(--color-text-muted); font-size: 13px; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }

/* ===== 上传区域 ===== */
.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--color-text-sub);
}
.upload-area:hover {
    border-color: var(--color-primary);
    background: rgba(102, 126, 234, 0.03);
}
.upload-area .icon { font-size: 32px; color: var(--color-text-muted); }
.upload-area .title { font-weight: 600; margin: 8px 0 2px; }
.upload-area .hint { font-size: 13px; color: var(--color-text-muted); }
.upload-area input[type="file"] { display: none; }

/* ===== 图片网格 ===== */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    margin-top: 10px;
}
.image-grid .img-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: var(--transition);
}
.image-grid .img-item:hover { transform: translateY(-4px); }
.image-grid .img-item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
}
.image-grid .img-item .img-label { font-size: 12px; color: var(--color-text-sub); margin-top: 4px; }
.img-status-success { color: #48bb78; }
.img-status-failed { color: #fc8181; }
.img-status-placeholder { color: #ed8936; }

/* ===== 作品网格 ===== */
.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 8px;
}
.work-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 14px;
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: var(--transition);
}
.work-item:hover { transform: translateY(-4px); border-color: rgba(102, 126, 234, 0.15); }
.work-item .type { font-size: 12px; font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.work-item .title { font-weight: 600; margin: 4px 0; }
.work-item .date { font-size: 12px; color: var(--color-text-muted); }
.work-item .status-badge {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.work-item video {
    width: 100%;
    max-height: 140px;
    border-radius: 8px;
    margin-top: 8px;
    background: #000;
}
.work-item .work-actions { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

.status-completed { background: rgba(72, 187, 120, 0.15); color: #48bb78; }
.status-pending { background: rgba(237, 137, 54, 0.15); color: #ed8936; }
.status-failed { background: rgba(252, 129, 129, 0.15); color: #fc8181; }
.status-planning { background: rgba(160, 160, 184, 0.1); color: var(--color-text-muted); }
.status-writing { background: rgba(102, 126, 234, 0.15); color: var(--color-primary); }
.status-editing { background: rgba(79, 172, 254, 0.15); color: var(--color-accent); }

/* ===== 进度条 ===== */
.progress-bar-container {
    margin-top: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 40px;
    height: 28px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.04);
    display: none;
}
.progress-bar-container.show { display: block; }
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 40px;
}
.progress-text-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--color-text-main);
    font-weight: 600;
    font-size: 12px;
    z-index: 2;
}

/* ===== 结果区域 ===== */
.result-area {
    margin-top: 16px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 14px;
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.04);
}
.result-area.show { display: block; }
.result-area h4 { font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }

/* ===== 工作类型筛选 ===== */
.work-type-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.work-type-filter .filter-btn {
    padding: 4px 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
    font-family: var(--font-family);
    color: var(--color-text-sub);
}
.work-type-filter .filter-btn:hover { border-color: var(--color-primary); }
.work-type-filter .filter-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* ===== 模式选择器 ===== */
.mode-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.mode-selector .btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--color-text-sub);
}
.mode-selector .btn.active {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    border-color: var(--color-primary);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
}
.mode-panel { display: none; }
.mode-panel.active { display: block; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .container { padding: 0 16px 30px; }
    .navbar { flex-direction: column; align-items: stretch; }
    .nav-actions { justify-content: center; flex-wrap: wrap; }
    .row { grid-template-columns: 1fr; }
    .image-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .work-grid { grid-template-columns: 1fr; }
    .card { padding: 16px 18px; }
    .login-panel { padding: 24px; margin: 40px auto; }
}

@media (max-width: 480px) {
    .login-panel { padding: 20px; }
    .breadcrumb { font-size: 12px; }
}
/* ===== 下拉菜单统一样式 ===== */

/* 下拉菜单主体 */
select {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--color-text-main);
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-family: var(--font-family);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a0a0b8' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    transition: var(--transition);
}

select:hover {
    border-color: rgba(102, 126, 234, 0.3);
}

select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.08);
}

/* 下拉菜单选项（深色主题适配） */
select option {
    background: #1a1a2e;
    color: #e8e8f0;
    padding: 10px 14px;
}

/* Firefox 下拉选项悬停 */
select option:hover,
select option:focus,
select option:active,
select option:checked {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary)) !important;
    color: #ffffff !important;
}

/* Chrome/Edge/Safari 下拉选项悬停（通过颜色反转） */
select option:checked {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary)) !important;
    color: #ffffff !important;
}

/* 多选下拉（如果有） */
select[multiple] option:checked {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary)) !important;
    color: #ffffff !important;
}

/* ===== 登录/注册页面下拉菜单 ===== */
.login-panel select {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--color-text-main);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-family: var(--font-family);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a0a0b8' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
    transition: var(--transition);
}

.login-panel select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.08);
}

.login-panel select option {
    background: #1a1a2e;
    color: #e8e8f0;
    padding: 10px 16px;
}

/* ===== 表单组中的下拉菜单 ===== */
.form-group select {
    width: 100%;
}