/* === 基礎重置 === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', 'Microsoft JhengHei', sans-serif;
    background: #F1F5F9;
    color: #1E293B;
    min-height: 100vh;
}

/* === 主容器（工具區） === */
.app {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

/* === 網站頁首導覽 === */
.site-header {
    background: #FFFFFF;
    border-bottom: 1px solid #E2E8F0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.site-header-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0.9rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-size: 1.3rem;
    font-weight: 800;
    color: #3B82F6;
    letter-spacing: -0.5px;
}

.site-nav {
    display: flex;
    gap: 1.5rem;
}

.site-nav a {
    font-size: 0.9rem;
    color: #64748B;
    text-decoration: none;
    font-weight: 500;
}

.site-nav a:hover {
    color: #3B82F6;
}

/* === Hero === */
.hero {
    max-width: 720px;
    margin: 0 auto;
    padding: 3.5rem 1.5rem 2.5rem;
    text-align: center;
}

.hero-eyebrow {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: #3B82F6;
    text-transform: uppercase;
    margin-bottom: 0.9rem;
}

.hero-title {
    font-size: 2.1rem;
    font-weight: 800;
    color: #0F172A;
    line-height: 1.3;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1rem;
    color: #475569;
    line-height: 1.7;
    margin-bottom: 1.75rem;
}

.br-desktop {
    display: none;
}

@media (min-width: 640px) {
    .hero-title { font-size: 2.6rem; }
    .br-desktop { display: inline; }
}

.btn-hero {
    font-size: 1.05rem;
    padding: 0.85rem 2.25rem;
    box-shadow: 0 8px 24px rgba(59,130,246,0.3);
}

.hero-note {
    margin-top: 1rem;
    font-size: 0.84rem;
    color: #94A3B8;
}

/* === 功能特色 === */
.features {
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem 1.25rem 2.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.feature-card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
}

.feature-highlight {
    border: 1.5px solid #93C5FD;
    background: linear-gradient(180deg, #EFF6FF 0%, #FFFFFF 100%);
}

.feature-icon {
    font-size: 1.6rem;
    margin-bottom: 0.6rem;
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 0.4rem;
}

.feature-card p {
    font-size: 0.86rem;
    color: #64748B;
    line-height: 1.6;
}

/* === 廣告版位 === */
.ad-slot-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.ad-slot {
    min-height: 0;
    overflow: hidden;
}

.ad-slot:has(ins) {
    margin: 1.5rem 0;
}

/* === 常見問題 === */
.faq {
    max-width: 720px;
    margin: 0 auto;
    padding: 1rem 1.25rem 3rem;
}

.faq-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0F172A;
    margin-bottom: 1.25rem;
    text-align: center;
}

.faq-item {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.faq-item h3 {
    font-size: 0.94rem;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 0.35rem;
}

.faq-item p {
    font-size: 0.86rem;
    color: #64748B;
    line-height: 1.6;
}

/* === 卡片 === */
.card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07), 0 4px 16px rgba(0,0,0,0.05);
    margin-bottom: 1rem;
}

/* === 上傳區 === */
.upload-card {
    text-align: center;
    border: 2px dashed #CBD5E1;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    padding: 2.25rem 1.5rem;
}

.upload-card:hover {
    border-color: #93C5FD;
    background: #F8FBFF;
}

.upload-card.drag-over {
    border-color: #3B82F6;
    background: #EFF6FF;
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    pointer-events: none;
}

.upload-primary {
    font-size: 1rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.3rem;
    pointer-events: none;
}

.upload-or {
    font-size: 0.82rem;
    color: #94A3B8;
    margin-bottom: 0.75rem;
    pointer-events: none;
}

.upload-hint {
    font-size: 0.78rem;
    color: #94A3B8;
    margin-top: 0.75rem;
    pointer-events: none;
}

/* === 按鈕 === */
.btn {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background-color 0.15s, opacity 0.15s, transform 0.1s;
    text-decoration: none;
    text-align: center;
    font-family: inherit;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: #3B82F6;
    color: #FFFFFF;
}
.btn-primary:hover { background: #2563EB; }

.btn-outline {
    background: transparent;
    color: #3B82F6;
    border: 1.5px solid #3B82F6;
}
.btn-outline:hover { background: #EFF6FF; }

.btn-ghost {
    background: transparent;
    color: #64748B;
}
.btn-ghost:hover { background: #F1F5F9; }

/* 佔滿整行的按鈕 */
.btn-block {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
}

/* === 檔案資訊 === */
.file-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1E293B;
    word-break: break-all;
    margin-bottom: 0.2rem;
}

.file-size-text {
    font-size: 0.84rem;
    color: #64748B;
}

.file-warning {
    font-size: 0.8rem;
    color: #D97706;
    margin-top: 0.3rem;
}

/* === 分隔線 === */
.divider {
    border: none;
    border-top: 1px solid #F1F5F9;
    margin: 1rem 0;
}

/* === 設定列 === */
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.setting-label {
    font-size: 0.88rem;
    color: #475569;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.number-input {
    width: 68px;
    padding: 0.4rem 0.5rem;
    border: 1.5px solid #CBD5E1;
    border-radius: 7px;
    font-size: 0.95rem;
    text-align: center;
    color: #1E293B;
    font-family: inherit;
}
.number-input:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.input-unit {
    font-size: 0.84rem;
    color: #64748B;
}

.setting-note {
    font-size: 0.78rem;
    color: #94A3B8;
    margin-top: 0.3rem;
    text-align: right;
}

.select-input {
    padding: 0.4rem 0.75rem;
    border: 1.5px solid #CBD5E1;
    border-radius: 7px;
    font-size: 0.88rem;
    color: #1E293B;
    background: white;
    font-family: inherit;
    cursor: pointer;
}
.select-input:focus {
    outline: none;
    border-color: #3B82F6;
}

/* === 進度區 === */
#progressCard {
    text-align: center;
    padding: 2rem 1.5rem;
}

.progress-status {
    font-size: 0.88rem;
    color: #475569;
    margin-bottom: 1rem;
    min-height: 1.3em;
    line-height: 1.4;
}

.progress-track {
    background: #E2E8F0;
    border-radius: 99px;
    height: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3B82F6 0%, #6366F1 100%);
    border-radius: 99px;
    width: 0%;
    transition: width 0.35s ease;
}

.progress-pct {
    margin-top: 0.6rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #3B82F6;
}

/* === 結果區 === */
.result-card {
    text-align: center;
}

.result-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.result-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.size-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: #F8FAFC;
    border-radius: 12px;
}

.size-box {
    flex: 1;
    min-width: 0;
}

.size-label {
    font-size: 0.72rem;
    color: #94A3B8;
    margin-bottom: 0.3rem;
}

.size-value {
    font-size: 1rem;
    font-weight: 700;
    color: #1E293B;
}

.size-value.green  { color: #059669; }
.size-value.accent { color: #3B82F6; }

.arrow {
    color: #CBD5E1;
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* === 頁尾 === */
.footer {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
    font-size: 0.78rem;
    color: #94A3B8;
    padding: 1rem 1.25rem 2rem;
}

/* === 響應式（小螢幕） === */
@media (max-width: 400px) {
    body { padding: 1rem 0.75rem 2rem; }
    .card { padding: 1.25rem; }
    .size-value { font-size: 0.9rem; }
    .size-row { gap: 0.35rem; }
}
