:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --error: #ef4444;
    --success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100%;
    /* 改為 100% 配合 html */
    display: block;
    /* 改回 block，減少捲動衝突 */
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    /* 優化 iOS 捲動 */
}

/* Background Blobs */
.background-blobs {
    position: fixed;
    /* 改為 fixed，捲動時背景保持不變 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(80px);
    border-radius: 50%;
    opacity: 0.5;
    animation: move 20s infinite alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: rgba(99, 102, 241, 0.3);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: rgba(168, 85, 247, 0.2);
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: rgba(236, 72, 153, 0.15);
    top: 50%;
    left: 60%;
    animation-delay: -10s;
}

@keyframes move {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(50px, 50px) scale(1.1);
    }
}

/* Container & Card */
.container {
    width: 100%;
    max-width: 1000px;
    padding: 80px 20px 0;
    /* 頂部多留一點空間 */
    margin: 0 auto;
    /* 水平居中 */
    margin-bottom: 400px;
    /* 底部留巨大的空白，讓使用者絕對可以往上滑 */
    min-height: 1px;
    /* 確保渲染 */
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(0);
    transition: transform 0.3s ease;
    text-align: center;
    /* 確保內容置中 */
}

.glass-card:hover {
    transform: translateY(-5px);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo svg {
    width: 32px;
    height: 32px;
}

h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(to right, #fff, #94a3b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.file-name-display {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px dashed var(--primary);
    margin: 10px auto 20px;
    /* 改為 auto 確保在 flex/block 中都置中 */
    word-break: break-all;
    display: inline-block;
    /* 讓背景包覆文字 */
    max-width: 100%;
}

.error-text {
    color: var(--error) !important;
    background: rgba(239, 68, 68, 0.1);
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.download-section {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 20px 0;
}

button {
    padding: 16px 40px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 220px;
    margin: 0 auto;
    /* 再次確保置中 */
}

button:hover {
    background: var(--primary-hover);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

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

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Loader */
.btn-loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    display: none;
    animation: spin 0.8s linear infinite;
}

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

/* Status Message */
.status-message {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9rem;
    min-height: 1.2rem;
    transition: all 0.3s ease;
}

.status-message.error {
    color: var(--error);
}

.status-message.success {
    color: var(--success);
}

/* Footer */
.footer {
    margin-top: 30px;
    text-align: center;
    color: #e2e8f0;
    /* 明亮的白灰色 */
    font-size: 0.85rem;
}

.footer-link {
    color: #ffffff;
    text-decoration: underline;
    transition: all 0.3s ease;
    font-weight: 700;
}

.footer-link:visited {
    color: #ffffff;
}

.footer-link:hover {
    color: var(--primary) !important;
    text-decoration: none;
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

/* Info Sections */
.info-section {
    margin-top: 40px;
    text-align: left;
    border-top: 1px solid var(--glass-border);
    padding-top: 40px;
}

.info-section h2 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-section h2 svg {
    width: 24px;
    height: 24px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.info-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

.info-item h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.info-item p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.content-text {
    color: var(--text-muted);
    line-height: 1.8;
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.content-text strong {
    color: var(--text-main);
}

@media (max-width: 600px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .glass-card {
        padding: 30px 20px;
    }

    h1 {
        font-size: 1.5rem;
    }
}