:root {
  --ink: #172033;
  --muted: #6c7486;
  --blue: #6ea8ff;
  --violet: #9d8cff;
  --success: #37a977;
  --danger: #d84f68;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: #f7f8fc;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid rgba(110, 168, 255, .38); outline-offset: 3px; }

.app-shell {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 0 28px;
  background:
    linear-gradient(rgba(121,134,170,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(121,134,170,.045) 1px, transparent 1px),
    radial-gradient(circle at 50% -10%, #fff 0, #f8f9fd 45%, #f3f5fa 100%);
  background-size: 36px 36px, 36px 36px, auto;
}

.aurora { position: absolute; z-index: -1; border-radius: 999px; filter: blur(4px); opacity: .28; pointer-events: none; }
.aurora-one { top: 12%; left: -120px; width: 340px; height: 340px; background: radial-gradient(circle, rgba(110,168,255,.7), transparent 68%); }
.aurora-two { right: -100px; bottom: 7%; width: 320px; height: 320px; background: radial-gradient(circle, rgba(157,140,255,.66), transparent 68%); }

.site-header {
  width: min(1120px, 100%);
  margin: 0 auto;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 18px; font-weight: 760; letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: #fff; font-size: 19px; font-weight: 800; background: linear-gradient(135deg, var(--blue), var(--violet)); box-shadow: 0 9px 22px rgba(111,129,222,.24); }
.privacy-pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid rgba(73,166,122,.16); border-radius: 999px; color: #347b5a; background: rgba(239,250,244,.72); font-size: 12px; font-weight: 650; }

.converter { width: min(720px, 100%); margin: auto; padding: 54px 0 86px; text-align: center; }
.intro { margin-bottom: 30px; }
.eyebrow { display: inline-block; margin-bottom: 14px; color: #7a6de0; font-size: 11px; font-weight: 820; letter-spacing: .2em; }
.intro h1 { margin: 0; font-size: clamp(34px, 6vw, 52px); line-height: 1.12; letter-spacing: -.055em; font-weight: 780; }
.intro p { margin: 16px auto 0; max-width: 520px; color: var(--muted); font-size: 15px; line-height: 1.8; }

.converter-card { padding: 12px; border: 1px solid rgba(255,255,255,.82); border-radius: 28px; background: rgba(255,255,255,.58); box-shadow: 0 26px 70px rgba(45,55,90,.1), inset 0 1px 0 rgba(255,255,255,.9); backdrop-filter: blur(24px) saturate(135%); }
.auth-gate { min-height: 286px; padding: 34px; border: 1px solid rgba(119,123,205,.18); border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); background: rgba(250,251,255,.78); }
.key-icon { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 16px; border-radius: 19px; color: #858ca2; background: linear-gradient(145deg, rgba(110,168,255,.12), rgba(157,140,255,.17)); box-shadow: inset 0 0 0 1px rgba(123,111,218,.08), 0 10px 24px rgba(108,105,220,.06); }
.key-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.auth-gate > strong { margin-bottom: 6px; color: var(--ink); font-size: 17px; font-weight: 740; }
.auth-gate > span:not(.key-icon) { font-size: 12px; }
.auth-form { width: min(390px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; margin-top: 22px; }
.auth-form input { min-width: 0; height: 46px; padding: 0 14px; border: 1px solid rgba(92,107,144,.2); border-radius: 13px; outline: none; color: var(--ink); background: rgba(255,255,255,.88); box-shadow: inset 0 1px 2px rgba(45,55,90,.04); }
.auth-form input:focus { border-color: rgba(122,108,224,.64); box-shadow: 0 0 0 3px rgba(122,108,224,.1); }
.auth-form button { height: 46px; padding: 0 18px; border: 0; border-radius: 13px; color: #fff; background: linear-gradient(120deg, #6f9df7, #8e7beb); cursor: pointer; font-size: 13px; font-weight: 650; box-shadow: 0 10px 22px rgba(108,105,220,.18); }
.auth-form button:hover:not(:disabled) { background: linear-gradient(120deg, #6493ed, #8270df); }
.auth-form button:disabled { opacity: .58; cursor: wait; }
.auth-error { margin: 11px 0 0; color: var(--danger); font-size: 11px; }
.drop-zone { width: 100%; min-height: 286px; border: 1.5px dashed rgba(119,123,205,.34); border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); background: rgba(250,251,255,.7); transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.drop-zone:hover, .drop-zone.is-dragging { border-color: rgba(122,108,224,.68); background: rgba(244,244,255,.94); transform: translateY(-1px); }
.upload-icon { width: 66px; height: 66px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 21px; color: #7477ff; background: linear-gradient(145deg, rgba(110,168,255,.15), rgba(157,140,255,.2)); box-shadow: inset 0 0 0 1px rgba(123,111,218,.1), 0 12px 28px rgba(108,105,220,.08); }
.upload-icon svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.drop-zone strong { margin-bottom: 7px; color: var(--ink); font-size: 17px; font-weight: 740; }
.drop-zone > span:not(.upload-icon) { font-size: 13px; }
.drop-zone small { margin-top: 19px; color: #9399a9; font-size: 11px; }

.file-workspace { padding: 22px; text-align: left; }
.file-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 15px; border: 1px solid rgba(92,107,144,.15); border-radius: 17px; background: rgba(249,250,253,.86); }
.file-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; color: #7569da; background: #eeecff; font-size: 10px; font-weight: 800; }
.file-meta { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.file-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 690; }
.file-meta small { color: #8a91a2; font-size: 11px; }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 10px; display: grid; place-items: center; color: #82899a; background: transparent; cursor: pointer; font-size: 22px; }
.icon-button:hover:not(:disabled) { color: var(--danger); background: #fff0f3; }
.icon-button:disabled { opacity: .45; cursor: not-allowed; }

.progress-wrap { margin: 24px 3px 0; }
.progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: #e9eaf3; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--violet)); transition: width .28s ease; }
.progress-caption { display: flex; justify-content: space-between; margin-top: 7px; color: #858c9c; font-size: 10px; }

.status-message { display: flex; align-items: center; gap: 8px; margin-top: 18px; padding: 10px 12px; border-radius: 11px; font-size: 12px; }
.status-message.converting { color: #5d6590; background: #f2f3fb; }
.status-message.success { color: #277c54; background: #edf9f3; }
.status-message.error { color: #a83c50; background: #fff0f3; }
.status-message.converting #statusIcon { animation: spin .9s linear infinite; }

.actions { display: flex; gap: 10px; margin-top: 22px; }
.actions button { min-height: 48px; border-radius: 14px; font-weight: 650; cursor: pointer; }
.primary-action { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; color: #fff; background: linear-gradient(120deg, #6f9df7, #8e7beb); box-shadow: 0 12px 25px rgba(108,105,220,.22); }
.primary-action:hover:not(:disabled) { background: linear-gradient(120deg, #6493ed, #8270df); box-shadow: 0 14px 29px rgba(108,105,220,.28); }
.primary-action:disabled { opacity: .58; cursor: wait; }
.secondary-action { padding: 0 20px; border: 0; color: #5f6676; background: #f1f2f7; }
.secondary-action:hover { background: #e9ebf2; }

.standalone-error { margin: 13px 0 0; color: var(--danger); font-size: 12px; }
.footnotes { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 22px; margin-top: 22px; color: #7b8292; font-size: 11px; }
.footnotes span { display: inline-flex; align-items: center; gap: 5px; }
.footnotes b { color: var(--success); }
footer { padding: 20px 0 28px; color: #9399a8; text-align: center; font-size: 10px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .app-shell { padding: 0 16px; }
  .site-header { min-height: 68px; }
  .privacy-pill { padding: 7px 9px; font-size: 10px; }
  .converter { padding: 42px 0 64px; }
  .intro h1 { font-size: 36px; }
  .intro p { max-width: 320px; font-size: 13px; }
  .converter-card { border-radius: 23px; }
  .auth-gate { min-height: 250px; padding: 26px 18px; }
  .auth-form { grid-template-columns: 1fr; }
  .auth-form button { width: 100%; }
  .drop-zone { min-height: 250px; }
  .file-workspace { padding: 14px; }
  .actions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
