/* ==================== 变量 ==================== */
:root {
    --bg-primary: #0a0e14;
    --bg-secondary: rgba(19, 25, 32, 0.9);
    --bg-tertiary: #1a2129;
    --text-primary: #e6e9ed;
    --text-secondary: #8a919a;
    --accent-blue: #00b4d8;
    --accent-cyan: #00f5d4;
    --accent-pink: #f72585;
    --accent-orange: #ff9e00;
    --gradient-main: linear-gradient(135deg, #00b4d8, #00f5d4);
    --border-radius: 16px;
    --font-main: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* ==================== Canvas 全屏 ==================== */
#canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* ==================== 主容器 ==================== */
.main-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 30px;
    pointer-events: none;
}

/* ==================== 输入区域 ==================== */
.input-area {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: fadeInUp 0.6s ease;
}

.title {
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-icon {
    font-size: 1.5rem;
    -webkit-text-fill-color: initial;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 2px solid var(--bg-tertiary);
    border-radius: var(--border-radius);
    padding: 6px;
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
    box-shadow: 0 0 40px rgba(0,180,216,0.15);
}

.input-wrapper:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 0 50px rgba(0,180,216,0.3);
}

.input-prefix {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-cyan);
    padding: 0 12px;
    border-right: 2px solid var(--bg-tertiary);
    margin-right: 12px;
}

#bvInput {
    width: 200px;
    background: transparent;
    border: none;
    font-size: 1rem;
    color: var(--text-primary);
    font-family: var(--font-mono);
    outline: none;
}

#bvInput::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.submit-btn {
    background: var(--gradient-main);
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--bg-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,180,216,0.4);
}

.submit-btn.loading .btn-text { display: none; }
.submit-btn.loading .btn-loading {
    display: block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0,0,0,0.2);
    border-top-color: var(--bg-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.btn-loading { display: none; }

/* ==================== 状态区域 ==================== */
.status-area {
    pointer-events: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--border-radius);
    padding: 20px;
    backdrop-filter: blur(20px);
    display: none;
    animation: fadeInUp 0.4s ease;
    max-width: 600px;
    margin: 0 auto;
}

.status-area.active { display: block; }

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--bg-tertiary);
}

.status-bv {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent-cyan);
}

.status-progress {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-orange);
}

/* 横向滚动的日志区域 */
.status-logs {
    display: flex;
    flex-direction: row;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-blue) var(--bg-tertiary);
}

.status-logs::-webkit-scrollbar {
    height: 4px;
}

.status-logs::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 2px;
}

.status-logs::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 2px;
}

.status-logs .log-item {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 6px 12px;
    background: rgba(0,180,216,0.1);
    border-radius: 8px;
    border: 1px solid rgba(0,180,216,0.2);
    flex-shrink: 0;
    animation: fadeIn 0.3s ease;
}

/* ==================== 结果区域 ==================== */
.result-area {
    pointer-events: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--border-radius);
    padding: 20px;
    backdrop-filter: blur(20px);
    display: none;
    animation: fadeInUp 0.4s ease;
    max-width: 500px;
    margin: 0 auto;
}

.result-area.active { display: block; }

.result-header {
    margin-bottom: 15px;
}

.result-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.result-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.result-up::before { content: '👤 '; }

.result-bv {
    font-family: var(--font-mono);
    color: var(--accent-blue);
}

.result-actions {
    display: flex;
    gap: 10px;
}

.download-btn {
    flex: 1;
    background: var(--gradient-main);
    border: none;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,180,216,0.4);
}

.new-btn {
    padding: 12px 20px;
    background: transparent;
    border: 2px solid var(--bg-tertiary);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.new-btn:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* ==================== 动画 ==================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* ==================== 响应式 ==================== */
@media (max-width: 600px) {
    .main-container { padding: 20px; }
    .title { font-size: 1.5rem; }
    .input-wrapper { flex-wrap: wrap; justify-content: center; }
    .input-prefix { border-right: none; margin-right: 0; padding: 8px 0; border-bottom: 2px solid var(--bg-tertiary); width: 100%; text-align: center; }
    #bvInput { width: 100%; text-align: center; padding: 10px 0; }
    .submit-btn { width: 100%; justify-content: center; margin-top: 10px; }
}
