/* app.css - 冰蓝玻璃拟态 · 去装饰化 · 工具型 TTS */
:root {
  --bg: #eaf6fc;
  --bg-card: rgba(255, 255, 255, 0.82);
  --bg-glass: rgba(234, 246, 252, 0.88);
  --text: #1a3a5c;
  --text-dim: #3d6e8a;
  --text-faint: #7aafc8;
  --accent: #4fb8e0;
  --accent-soft: #2a98c0;
  --accent-deep: #1878ab;
  --border: rgba(79, 184, 224, 0.22);
  --shadow-sm: 0 4px 14px rgba(79, 184, 224, 0.10);
  --shadow-md: 0 8px 30px rgba(79, 184, 224, 0.14);
  --shadow-lg: 0 12px 35px rgba(79, 184, 224, 0.20);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 12%, rgba(79, 184, 224, 0.22), transparent 55%),
    radial-gradient(circle at 85% 85%, rgba(43, 152, 192, 0.18), transparent 50%),
    linear-gradient(180deg, #eaf6fc 0%, #d4eef8 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.86em;
  padding: 0.1em 0.4em;
  background: rgba(79, 184, 224, 0.08);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--accent-deep);
}

.layout {
  max-width: 880px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem 1.6rem;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.panel.hero {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(234, 246, 252, 0.65));
  padding: 2rem 1.8rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-soft);
  font-weight: 500;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

h2 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--accent-deep);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.lead {
  margin: 0.5rem 0 0.75rem;
  font-size: 0.92rem;
  font-weight: 400;
  color: var(--text-dim);
  max-width: 640px;
}

.meta {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  color: var(--text-faint);
  line-height: 1.7;
}

.field-label {
  margin: 0.75rem 0 0.25rem;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-soft);
  font-weight: 500;
}

.grid {
  display: grid;
  gap: 0.85rem;
}

.grid.two-up {
  grid-template-columns: 1fr 1fr;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.field > span {
  font-size: 0.74rem;
  color: var(--text-dim);
  font-weight: 500;
}

.field.wide {
  grid-column: 1 / -1;
}

input[type="text"],
input[type="number"],
input[type="file"],
select,
textarea {
  font: inherit;
  font-size: 0.88rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  width: 100%;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 184, 224, 0.15);
}

textarea {
  resize: vertical;
  min-height: 110px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  line-height: 1.55;
}

.checkbox-field {
  align-self: end;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-dim);
  transition: all 0.2s;
}

.checkbox-label:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
}

.checkbox-label input {
  width: auto;
  margin: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

button {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--accent-deep);
  cursor: pointer;
  transition: all 0.25s;
  letter-spacing: 0.02em;
}

button:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(79, 184, 224, 0.35);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  background: rgba(255, 255, 255, 0.4);
  color: var(--text-faint);
  box-shadow: none;
}

button.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

button.primary:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
}

.readonly {
  margin-top: 0.25rem;
  padding: 0.6rem 0.8rem;
  background: rgba(79, 184, 224, 0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.82rem;
  color: var(--text);
  word-break: break-all;
  min-height: 1.2em;
}

.log-output {
  margin: 0.5rem 0 0;
  padding: 0.75rem 0.85rem;
  background: rgba(26, 58, 92, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.55;
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.collapsible {
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  background: rgba(234, 246, 252, 0.4);
}

.collapsible summary {
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--accent-deep);
  font-weight: 500;
  padding: 0.2rem 0;
  user-select: none;
}

.collapsible summary:hover {
  color: var(--accent);
}

.collapsible[open] summary {
  margin-bottom: 0.6rem;
}

.info-list {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.8;
}

.info-list strong {
  color: var(--accent-deep);
  font-weight: 500;
}

@media (max-width: 720px) {
  .layout { padding: 1.5rem 1rem 3rem; }
  .panel { padding: 1.1rem 1.1rem; border-radius: 12px; }
  .panel.hero { padding: 1.4rem 1.2rem; }
  h1 { font-size: 1.5rem; }
  .grid.two-up { grid-template-columns: 1fr; }
  button { transition: none; }
  .panel { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg-card); }
}

@media (max-width: 720px) {
  * { transition: none !important; }
  button:hover { transform: none; }
}

/* ===== 进度条 / 弹窗 / Toast ===== */
.progress-wrap {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(234, 246, 252, 0.55);
}
.progress-bar {
  height: 8px;
  background: rgba(79, 184, 224, 0.15);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  transition: width 0.25s ease-out;
}
.progress-text {
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent-soft);
  margin-top: 0.4rem;
}
.progress-stage {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.toast-container {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 1000;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 200px;
  max-width: 360px;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  color: var(--text);
  font-size: 0.85rem;
  animation: toastIn 0.25s ease-out;
}
.toast.success { border-left: 3px solid #4fb8e0; }
.toast.error { border-left: 3px solid #e06b4f; color: #8a3d3d; }
.toast.info { border-left: 3px solid var(--accent-deep); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal[hidden] { display: none !important; }
.modal {
  position: fixed;
  inset: 0;
  background: rgba(26, 58, 92, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.modal-card {
  min-width: 320px;
  max-width: 420px;
  padding: 1.5rem 1.6rem;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.modal-title {
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 1rem;
  color: var(--text);
}
.modal-progress {
  height: 10px;
  background: rgba(79, 184, 224, 0.15);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.modal-text {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--accent-soft);
  font-size: 1.1rem;
}
.modal-stage {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-dim);
}