/* ===== FreeHost 全局样式 ===== */
:root {
    --bg: #0a0e1a;
    --bg-card: #131a2e;
    --bg-elev: #1a2340;
    --border: #2a3658;
    --text: #e2e8f0;
    --text-dim: #94a3b8;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius: 12px;
    --font: 'Segoe UI', system-ui, -apple-system, 'Noto Sans CJK SC', sans-serif;
}

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

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

a { color: var(--primary-hover); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== 导航栏 ===== */
.navbar {
    background: rgba(19, 26, 46, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .logo {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar .nav-links { display: flex; gap: 20px; align-items: center; }
.navbar .nav-links a { color: var(--text-dim); font-size: 0.92rem; }
.navbar .nav-links a:hover { color: var(--text); }
.navbar .nav-user { color: var(--text-dim); font-size: 0.88rem; }

/* ===== 容器 ===== */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 24px;
}

.container-narrow { max-width: 440px; }

/* ===== Hero ===== */
.hero {
    text-align: center;
    padding: 80px 24px 60px;
}
.hero h1 {
    font-size: 2.6rem;
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #818cf8, #c084fc, #f0abfc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p {
    color: var(--text-dim);
    font-size: 1.15rem;
    max-width: 560px;
    margin: 0 auto 32px;
}

/* ===== 卡片 ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 24px;
}
.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
}

/* ===== 表单 ===== */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-size: 0.88rem;
    color: var(--text-dim);
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
    font-family: var(--font);
    transition: border-color 0.2s;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; text-decoration: none; }
.btn-warning { background: var(--warning); color: #1a1a1a; }
.btn-warning:hover { background: #d97706; text-decoration: none; }
.btn-success { background: var(--success); color: #fff; }
.btn-ghost {
    background: var(--bg-elev);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--border); text-decoration: none; }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== 提示 ===== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 0.9rem;
}
.alert-error { background: rgba(239, 68, 68, 0.15); border: 1px solid var(--danger); color: #fca5a5; }
.alert-success { background: rgba(34, 197, 94, 0.15); border: 1px solid var(--success); color: #86efac; }
.alert-info { background: rgba(99, 102, 241, 0.15); border: 1px solid var(--primary); color: #c7d2fe; }
.alert-warning { background: rgba(245, 158, 11, 0.15); border: 1px solid var(--warning); color: #fcd34d; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
th, td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
th { color: var(--text-dim); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.5px; }
tr:hover td { background: rgba(99, 102, 241, 0.05); }

/* ===== 徽章 ===== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 600;
}
.badge-success { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.badge-info { background: rgba(99, 102, 241, 0.2); color: #c7d2fe; }

/* ===== 滑动验证码 ===== */
.captcha-container {
    margin: 20px 0;
}
.captcha-track {
    position: relative;
    width: 300px;
    height: 42px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    user-select: none;
}
.captcha-gap {
    position: absolute;
    top: 0;
    height: 42px;
    width: 42px;
    background: rgba(239, 68, 68, 0.12);
    border: 2px dashed rgba(239, 68, 68, 0.5);
    border-radius: 4px;
    box-sizing: border-box;
}
.captcha-piece {
    position: absolute;
    top: 0;
    left: 0;
    height: 42px;
    width: 42px;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    border-radius: 4px;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 2;
}
.captcha-piece:active { cursor: grabbing; }
.captcha-piece.verified {
    background: linear-gradient(135deg, var(--success), #16a34a);
}
.captcha-piece.failed { animation: shake 0.4s; }
.captcha-slider-bar {
    position: relative;
    width: 300px;
    height: 44px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 22px;
    margin-top: 14px;
    overflow: hidden;
    user-select: none;
}
.captcha-slider-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: rgba(34, 197, 94, 0.2);
    border-radius: 22px;
    transition: width 0.1s;
}
.captcha-slider-handle {
    position: absolute;
    top: 2px;
    left: 0;
    height: 40px;
    width: 40px;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    border-radius: 50%;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    z-index: 2;
}
.captcha-slider-handle:active { cursor: grabbing; }
.captcha-slider-handle.verified { background: linear-gradient(135deg, var(--success), #16a34a); }
.captcha-slider-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 0.82rem;
    pointer-events: none;
}
.captcha-status {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-dim);
}
.captcha-status.success { color: #86efac; }
.captcha-status.fail { color: #fca5a5; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* ===== 上传区域 ===== */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.upload-zone:hover { border-color: var(--primary); background: rgba(99, 102, 241, 0.05); }
.upload-zone.dragover { border-color: var(--primary); background: rgba(99, 102, 241, 0.1); }

/* ===== 进度条 ===== */
.storage-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-elev);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 6px;
}
.storage-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), var(--warning));
    border-radius: 4px;
    transition: width 0.3s;
}
.storage-bar-fill.full { background: var(--danger); }

/* ===== 统计卡片 ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}
.stat-card .stat-value { font-size: 1.8rem; font-weight: 800; }
.stat-card .stat-label { color: var(--text-dim); font-size: 0.82rem; margin-top: 4px; }

/* ===== 页脚 ===== */
.footer {
    text-align: center;
    padding: 32px;
    color: var(--text-dim);
    font-size: 0.82rem;
    border-top: 1px solid var(--border);
    margin-top: 60px;
}

/* ===== 模态框 ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 200;
    align-items: center;
    justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    width: 90%;
    max-width: 420px;
}
.modal h3 { margin-bottom: 16px; }

/* ===== 工具类 ===== */
.text-dim { color: var(--text-dim); }
.text-sm { font-size: 0.82rem; }
.text-center { text-align: center; }
.mt-2 { margin-top: 16px; }
.mt-1 { margin-top: 8px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.code-block {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 14px;
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #a5b4fc;
    word-break: break-all;
}
.link-box {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0;
}
.link-box .url { color: #a5b4fc; font-family: monospace; font-size: 0.88rem; word-break: break-all; }
