/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* 深空漫游主题色系 */
    --bg-color-main: #0B0E14;
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --glass-bg: rgba(20, 25, 33, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --primary-glow: #6366F1;
    --secondary-glow: #8B5CF6;
    --accent: #10B981;
    --error: #EF4444;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* 动态背景光效 (Blobs) */
.background-blob {
    position: absolute;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.6;
    animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--secondary-glow) 0%, transparent 70%);
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

.blob-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.4) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: scale(1) translate(0, 0); }
    50% { transform: scale(1.2) translate(50px, 30px); }
    100% { transform: scale(0.9) translate(-30px, -50px); }
}

/* 布局容器 */
.app-container {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    z-index: 1;
}

/* 抬头打字效果区域 */
.hero-section {
    text-align: center;
    animation: fadeDown 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.main-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    letter-spacing: -1.5px;
}

.gradient-text {
    background: linear-gradient(135deg, #00F2FE 0%, #4FACFE 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* 毛玻璃容器库 */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    transform-origin: center;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.input-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
    opacity: 0;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 文本域 */
textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.2rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    resize: none;
    outline: none;
    transition: all 0.3s ease;
}

textarea:focus {
    border-color: var(--primary-glow);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background: rgba(0, 0, 0, 0.4);
}

textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* 按键列 */
.action-row {
    display: flex;
    justify-content: flex-end;
}

/* 按钮全局样式 */
button {
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

button:active {
    transform: scale(0.96);
}

/* 主干打通按钮 */
.primary-btn {
    padding: 0.8rem 2rem;
    background: linear-gradient(135deg, var(--primary-glow) 0%, var(--secondary-glow) 100%);
    color: white;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

.primary-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.3), transparent);
    transform: skewX(-20deg);
    transition: 0.5s;
}

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

.primary-btn:hover {
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
}

.primary-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: translateY(0);
}

/* 二级/三级按钮 */
.secondary-btn {
    padding: 0.7rem 1.5rem;
    background: var(--accent);
    color: white;
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.2);
}

.secondary-btn:hover {
    background: #0EA5E9;
    box-shadow: 0 12px 24px rgba(14, 165, 233, 0.3);
    transform: translateY(-2px);
}

.tertiary-btn {
    padding: 0.7rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.tertiary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 结果区域 */
.result-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.result-area.hidden {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}

.result-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.result-content-wrapper {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}

@media (max-width: 640px) {
    .result-content-wrapper {
        grid-template-columns: 1fr;
    }
}

.video-preview {
    width: 100%;
    aspect-ratio: 9/16;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
}

.video-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.info-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
}

.v-title {
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.4;
}

.download-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Loading 动画元件 */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.hidden {
    display: none !important;
}

/* Toast 微动效弹窗 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    z-index: 1000;
    opacity: 0;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.error {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

.toast.success {
    border-color: var(--accent);
    background: rgba(16, 185, 129, 0.1);
}
