:root {
  --paper: #eef6fb;
  --card: #ffffff;
  --ink: #12314a;
  --muted: #5d7488;
  --line: #d5e5ef;
  --line-strong: #b7d2e2;
  --accent: #1b8fc9;
  --accent-dark: #0f6f9f;
  --accent-soft: #e4f2fa;
  --ok: #2e8b4a;
  --ok-soft: #e9f5ec;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(18, 49, 74, .05), 0 14px 34px -20px rgba(18, 49, 74, .28);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 50% -200px, #fbfdff 0%, transparent 70%),
    var(--paper);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

.page {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 24px 40px;
}

.masthead {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 26px;
}

.logo {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
  transition: transform .15s;
}

.logo:hover { transform: scale(1.04); }

.masthead h1 {
  margin: 0;
  font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
  font-size: clamp(24px, 4vw, 31px);
  font-weight: 700;
  letter-spacing: .04em;
}

.masthead p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  letter-spacing: .02em;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 34px 34px 30px;
}

.block + .block { margin-top: 30px; }

.block h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--ink);
}

.block h2::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(to right, var(--line), transparent);
}

.num {
  font-family: "Times New Roman", serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .12em;
  color: var(--accent);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 1px 8px 1px 9px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
}

.field { display: flex; flex-direction: column; gap: 7px; }
.field.wide { grid-column: 1 / -1; }

.label {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .02em;
}

.label em {
  font-style: normal;
  color: var(--accent);
  margin-left: 3px;
}

.label small {
  color: #9a9186;
  margin-left: 5px;
  font-size: 12px;
}

input[type="text"], input[type="password"], textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 14.5px;
  line-height: 1.55;
  transition: border-color .15s, box-shadow .15s;
}

textarea { resize: vertical; min-height: 62px; }

input[type="text"]:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(27, 143, 201, .14);
}

input::placeholder, textarea::placeholder { color: #b3aa9e; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 20px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  background: #f8fcfe;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.dropzone:hover, .dropzone:focus-visible {
  border-color: var(--accent);
  background: #f0f9ff;
  outline: none;
}

.dropzone.filled {
  border-style: solid;
  border-color: var(--ok);
  background: var(--ok-soft);
}

.dropzone.dragging {
  border-color: var(--accent);
  background: #f0f9ff;
}

.dropzone svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dropzone.filled svg { stroke: var(--ok); }

.dropzone strong { font-size: 14.5px; font-weight: 600; }
.dropzone span { font-size: 12.5px; color: var(--muted); }

#perf, #transcript {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.preview {
  margin-top: 14px;
  padding: 14px 16px;
  border-left: 3px solid var(--ok);
  background: var(--ok-soft);
  border-radius: 0 8px 8px 0;
  font-size: 13.5px;
  color: #2a4d3a;
}

.preview b { color: #1f3a2c; }

.preview .people {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.preview .people span {
  background: #fff;
  border: 1px solid #cfe0d5;
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 12.5px;
  color: #2f5a3f;
}

.preview .people i {
  font-style: normal;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 4px;
  background: #e4efe8;
  color: #5c7f68;
  font-size: 11px;
}

.error {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 3px solid #cf4b3a;
  border-radius: 0 8px 8px 0;
  background: #fbecea;
  color: #7d261c;
  font-size: 13.5px;
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 28px;
  padding: 14px 20px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fffdf9;
  font: inherit;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: .12em;
  cursor: pointer;
  transition: background .15s, transform .1s;
}

.primary:hover { background: var(--accent-dark); }
.primary:active { transform: translateY(1px); }
.primary:disabled { background: #b9b0a6; cursor: wait; }

.result {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 30px;
  padding: 22px;
  border: 1px solid #cfe6d7;
  border-radius: 12px;
  background: var(--ok-soft);
}

.result-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  font-size: 17px;
  line-height: 1;
}

.result-body { flex: 1; min-width: 0; }

.result h3 { margin: 2px 0 6px; font-size: 16px; color: #1f4a30; }

.filename {
  margin: 0 0 4px;
  font-size: 13.5px;
  color: #2f5a3f;
  word-break: break-all;
}

.meta { margin: 0 0 16px; font-size: 12.5px; color: #5c7f68; }

.result .primary {
  width: auto;
  margin-top: 0;
  padding: 10px 22px;
  letter-spacing: .08em;
}

.tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #d3e8f4;
  border-radius: 999px;
  padding: 1px 8px;
  letter-spacing: .04em;
}

.note {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.tutorial-wrap {
  position: relative;
  display: inline-block;
}

.tutorial {
  color: var(--accent);
  cursor: help;
  border-bottom: 1px dashed currentColor;
  outline: none;
}

.tutorial-wrap:hover .tutorial-pop,
.tutorial-wrap:focus-within .tutorial-pop {
  display: block;
}

.tutorial-pop {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 60;
  width: 360px;
  max-width: min(360px, calc(100vw - 48px));
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 30px -14px rgba(18, 49, 74, .35);
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.75;
  letter-spacing: 0;
  text-align: left;
}

.tutorial-pop::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -8px;
  height: 8px;
}

.tutorial-pop::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 18px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  transform: rotate(45deg);
}

.tutorial-pop a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

.tutorial-note {
  display: inline-block;
  margin-top: 2px;
  color: #7d8fa0;
  font-size: 11.5px;
}

.ai-preview {
  margin: 4px 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fcfe;
  max-height: 320px;
  overflow: auto;
}

.ai-preview h4 {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--ink);
}

.ai-preview p {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.7;
  color: #33506a;
}

.ai-preview ol {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.7;
  color: #33506a;
}

.ai-preview li { margin-bottom: 4px; }

.foot {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  margin-top: 22px;
  padding: 0 4px;
  color: #6f8a9c;
  font-size: 12px;
  letter-spacing: .03em;
}

.egg-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(10, 25, 40, .72);
  backdrop-filter: blur(3px);
}

.egg-card {
  width: min(92vw, 520px);
  padding: 14px 14px 16px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
  text-align: center;
}

.egg-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.egg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.egg-actions .primary,
.egg-secondary {
  flex: 1 1 180px;
  width: auto;
  margin: 0;
  padding: 11px 14px;
  border-radius: 9px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
}

.egg-actions .primary:hover { background: var(--accent-dark); }

.egg-secondary {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  transition: border-color .15s, color .15s, background .15s;
}

.egg-secondary:hover {
  border-color: #cf4b3a;
  color: #b33a2b;
  background: #fdf3f1;
}

.shutdown {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.shutdown p {
  margin: 0;
  color: #7d7d7d;
  font-family: "STHupo", "FZShuTi", "YouYuan", "Microsoft YaHei", sans-serif;
  font-size: 21px;
  letter-spacing: .05em;
}

@media (max-width: 640px) {
  .page { padding: 28px 14px 30px; }
  .card { padding: 24px 18px 22px; }
  .grid { grid-template-columns: 1fr; }
  .masthead { gap: 14px; }
  .masthead h1 { font-size: clamp(18px, 5.4vw, 23px); letter-spacing: .02em; }
  .logo { width: 54px; height: 54px; }
  .foot { flex-direction: column; gap: 4px; }
}
