/* Header */
header{margin-bottom:40px}
.header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; flex-wrap: wrap; gap: 12px;}
.logo{display:flex;align-items:center;gap:12px;margin-bottom:6px}
.logo-mark{width:34px;height:34px;background:var(--accent);border-radius:8px;display:flex;align-items:center;justify-content:center}
.logo-mark svg{width:18px;height:18px;color:#0f0f0f;}
.logo-text{font-size:17px;font-weight:600;letter-spacing:-.02em}
.header-sub{font-size:13px;color:var(--tm);margin-left:46px}

/* Privacy Badge 修正：確保文字顏色足夠深 */
.privacy-badge{display:inline-flex;align-items:center;gap:6px;margin-left:46px;margin-top:6px;font-size:11px;color:var(--tm);border:1px solid var(--border);background:var(--surface);padding:4px 10px;border-radius:20px;font-weight:600;letter-spacing:.02em;transition:all 0.3s;}
.pdot{width:6px;height:6px;background:var(--success);border-radius:50%;}
:root[data-theme="light"] .privacy-badge{border-color:var(--bh); color: var(--text);}

/* Theme Toggle Button */
.theme-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; flex-shrink: 0;}
.theme-btn:hover { background: var(--s2); border-color: var(--bh); }
.theme-btn svg { width: 18px; height: 18px; }

/* Panel & Layout */
.panel{display:none}.panel.active{display:block}
.step { animation: fadeIn 0.25s ease both; }
.step.hidden { display: none !important; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Shared Utilities */
.sep{height:1px;background:var(--border);margin:24px 0}
.slabel{font-size:11px;color:var(--td);letter-spacing:.06em;text-transform:uppercase;margin-bottom:8px;font-weight:600}
.note{font-size:12px;color:var(--td);margin-top:18px;line-height:1.6;}
.status{display:none;margin-top:10px;padding:9px 12px;border-radius:var(--rs);font-size:12px}
.status.success{display:block;background:rgba(74,222,128,.1);color:var(--success);border:1px solid rgba(74,222,128,.2)}
.status.error{display:block;background:rgba(255,92,92,.1);color:var(--danger);border:1px solid rgba(255,92,92,.2)}
.status.loading{display:block;background:var(--surface);color:var(--tm);border:1px solid var(--border)}
@keyframes spin{to{transform:rotate(360deg)}}
.spinner{width:13px;height:13px;border:2px solid transparent;border-top-color:currentColor;border-radius:50%;animation:spin .6s linear infinite;display:inline-block;vertical-align:middle}

/* Drop zone */
.drop-zone{border:1.5px dashed var(--bh);border-radius:var(--r);padding:36px 20px;text-align:center;cursor:pointer;transition:all .15s;background:var(--surface);position:relative;overflow:hidden}
.drop-zone::before{content:'';position:absolute;inset:0;background:radial-gradient(ellipse at center,rgba(232,255,71,.04) 0%,transparent 70%);pointer-events:none}
.drop-zone:hover,.drop-zone.drag-over,.drop-zone.over{border-color:rgba(232,255,71,.4);background:var(--s2)}
.drop-icon{font-size:32px;margin-bottom:10px;opacity:.6}
.drop-title{font-size:14px;font-weight:500;margin-bottom:3px}
.drop-hint{font-size:12px;color:var(--tm)}

/* Format Grid Note */
.fmt-wrap { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 12px; }
.fmt-col { flex: 1; min-width: 120px; }
.fmt-col .fmeta { font-size: 11px; color: var(--tm); margin-top: 4px; line-height:1.5;}

/* File Info Bar */
.file-item{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;background:var(--surface);border:1px solid var(--border);border-radius:var(--rs);transition:border-color .15s; margin-bottom: 24px;}
.file-item:hover{border-color:var(--bh)}
.file-info{display:flex;align-items:center;gap:12px}
.file-icon{width:36px;height:36px;background:rgba(232,255,71,.1);border-radius:5px;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:600;flex-shrink:0;border:1px solid transparent;}
.fname{font-size:13px;font-weight:500;overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px;}
.fmeta{font-size:11px;color:var(--tm);margin-top:2px}
.file-acts{display:flex;align-items:center;gap:6px}

/* Buttons */
.btns{display:flex;gap:7px;flex-wrap:wrap;margin-top:18px}
.btn{padding:9px 16px;border-radius:var(--rs);font-size:13px;font-weight:500;font-family:inherit;cursor:pointer;border:1px solid var(--border);background:var(--surface);color:var(--text);transition:all .15s;display:inline-flex;align-items:center;gap:5px}
.btn:hover{border-color:var(--bh);background:var(--s2)}
.btn:active{transform:scale(.98)}
.btn:disabled{opacity:.35;cursor:not-allowed;transform:none}
.btn.primary{background:var(--accent);color:#0f0f0f;border-color:var(--accent);font-weight:600}
.btn.primary:hover{background:#d4e83e;border-color:#d4e83e}
.btn svg{width:14px;height:14px}
.ib{width:26px;height:26px;border:none;background:transparent;cursor:pointer;color:var(--td);border-radius:4px;display:flex;align-items:center;justify-content:center;transition:all .12s;font-size:14px}
.ib:hover{background:var(--s2);color:var(--text)}
.ib.danger:hover{background:rgba(255,92,92,.12);color:var(--danger)}

/* Format Selection Grid */
.format-select-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px;}
.format-btn { padding:8px 16px;border-radius:var(--rs);font-size:13px;font-weight:500;font-family:inherit;cursor:pointer;border:1px solid var(--border);background:var(--surface);color:var(--text);transition:all .15s;display:inline-flex;align-items:center;gap:5px; }
.format-btn:hover { border-color:var(--bh);background:var(--s2); }
.format-btn.selected { background:var(--accent);color:#0f0f0f;border-color:var(--accent);font-weight:600; }

/* Config Section & Slider */
.config-section { margin-bottom: 20px; }
.quality-row { display: flex; align-items: center; gap: 14px; }
.quality-slider { flex: 1; -webkit-appearance: none; height: 4px; border-radius: 2px; background: var(--border); outline: none; cursor: pointer; transition: background 0.2s;}
.quality-slider:hover { background: var(--bh); }
.quality-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); cursor: pointer; transition:transform 0.1s;}
.quality-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.quality-value { font-family: monospace; font-size: 13px; color: var(--accent); min-width: 42px; text-align: right; font-weight: 600; }

/* Progress */
.progress-log { background: var(--surface); border: 1px solid var(--border); border-radius: var(--rs); padding: 12px; margin-top: 14px; max-height: 140px; overflow-y: auto; font-family: monospace; font-size: 11px; color: var(--tm); line-height: 1.8; }
.progress-log:empty { display: none; }

/* Footer */
.global-footer { margin-top: 50px; padding-top: 24px; border-top: 1px solid var(--border); text-align: center; font-size: 12px; color: var(--tm); display: flex; align-items: center; justify-content: center; gap: 8px;}

/* Scrollbar */
::-webkit-scrollbar{width:5px;height:5px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:var(--bh);border-radius:3px}
/* ══════════════════════
   Rich Global Footer
══════════════════════ */
.global-footer-rich {
  margin-top: 60px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}
.gf-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 640px) { .gf-features { grid-template-columns: 1fr; } }
.gf-feat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px 20px;
  transition: border-color 0.2s;
}
.gf-feat:hover { border-color: var(--bh); }
.gf-feat-icon { font-size: 22px; margin-bottom: 8px; }
.gf-feat-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.gf-feat-desc { font-size: 12px; color: var(--tm); line-height: 1.65; }
.gf-sep { height: 1px; background: var(--border); margin: 28px 0; }
.gf-sections { display: flex; flex-direction: column; gap: 0; }
.gf-section { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; margin-bottom: 12px; }
.gf-section-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; background: var(--s2); font-size: 14px; font-weight: 600; color: var(--text); border-bottom: 1px solid var(--border); }
.gf-section-icon { font-size: 16px; }
.gf-section-body { padding: 16px 18px; font-size: 12.5px; color: var(--tm); line-height: 1.7; }
.gf-steps { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.gf-steps li { font-size: 12.5px; color: var(--tm); }
.gf-tech-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 560px) { .gf-tech-grid { grid-template-columns: 1fr; } }
.gf-tech-item { background: var(--s2); border: 1px solid var(--border); border-radius: var(--rs); padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.gf-tech-name { font-size: 12px; font-weight: 600; color: var(--accent); font-family: monospace; }
.gf-tech-desc { font-size: 11px; color: var(--tm); line-height: 1.5; }
.gf-privacy-body strong { color: var(--text); }
.gf-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 20px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--rs); font-size: 11.5px; color: var(--tm); }
.gf-home-link { font-size: 12px; color: var(--accent); text-decoration: none; font-weight: 600; white-space: nowrap; transition: opacity 0.15s; }
.gf-home-link:hover { opacity: 0.75; }