:root {
  --bg: #0F0E0E;
  --topbar: #131211;
  --card: #171615;
  --input: #201E1C;
  --line: #2A2826;
  --line-strong: #3A3734;
  --text: #F2F2F2;
  --muted: #A8A8A8;
  --dim: #767370;
  --accent: #E8C268;
  --success: #7DD9A6;
  --error: #E07866;
  --radius: 4px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.topbar {
  height: 76px;
  padding: 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--topbar);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 24px; height: 24px; flex: none; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: .01em; }
.brand-sep { width: 1px; height: 16px; background: var(--line-strong); }
.brand-en { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--dim); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.chip { padding: 7px 12px; border-radius: 3px; background: var(--input); color: var(--muted); font-size: 12px; white-space: nowrap; }
.deadline { font-size: 12px; color: var(--dim); white-space: nowrap; }

.page {
  min-height: calc(100dvh - 76px);
  padding: 56px 24px;
  display: grid;
  place-items: center;
}

.card {
  width: min(760px, 100%);
  padding: 32px 36px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.card-head h1 { margin: 0 0 8px; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.card-head p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted); }
.card-head .card-note {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--input);
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
.card-head .card-note strong { color: var(--text); font-weight: 600; }

.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field label { font-size: 13px; font-weight: 500; color: var(--text); }
.req { color: var(--accent); }

input[type="text"], textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--input);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  transition: border-color .18s ease, transform .18s ease;
}
textarea { min-height: 104px; resize: vertical; }
input[type="text"]::placeholder, textarea::placeholder { color: var(--dim); }
input[type="text"]:hover, textarea:hover { border-color: #4A4642; }
input[type="text"]:focus, textarea:focus { border-color: var(--accent); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--error); }

.counter { margin-top: -4px; text-align: right; font-family: var(--mono); font-size: 11px; color: var(--dim); }
.error-text { margin: 0; font-size: 12px; color: var(--error); }

.dropzone {
  min-height: 148px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  background: #1B1A18;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}
.dropzone > svg { width: 28px; height: 28px; }
.dropzone:hover, .dropzone.is-dragging { border-color: var(--accent); background: #211F1B; }
.dropzone:active { transform: scale(.995); }
.drop-main { margin: 0; font-size: 14px; font-weight: 500; }
.link { color: var(--accent); }
.drop-hint { margin: 0; font-size: 11px; color: var(--dim); }

.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.file-list:empty { display: none; }
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 12px;
  background: var(--input);
  border-radius: 3px;
  animation: row-in .22s ease both;
}
@keyframes row-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.file-thumb {
  width: 32px; height: 32px; flex: none;
  border-radius: 2px; overflow: hidden;
  background: #22282B;
  display: grid; place-items: center;
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-thumb svg { width: 14px; height: 14px; }
.file-thumb.is-archive { background: #2A251D; }
.file-name { flex: 1; min-width: 0; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-family: var(--mono); font-size: 11px; color: var(--dim); white-space: nowrap; }
.file-state { font-size: 11px; color: var(--success); white-space: nowrap; }
.file-remove {
  width: 22px; height: 22px; flex: none;
  padding: 0; display: grid; place-items: center;
  background: transparent; border: 0; border-radius: 3px;
  color: var(--muted); cursor: pointer;
  transition: color .18s ease, transform .18s ease;
}
.file-remove:hover { color: var(--error); transform: scale(1.08); }
.file-remove svg { width: 14px; height: 14px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.card-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: 22px; border-top: 1px solid var(--line);
}
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); cursor: pointer; }
.check input {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px; flex: none; margin: 0;
  background: var(--input); border: 1px solid var(--line-strong); border-radius: 3px;
  position: relative; cursor: pointer;
}
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after {
  content: ""; position: absolute; left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: solid #171615; border-width: 0 1.6px 1.6px 0;
  transform: rotate(45deg);
}
.btn-primary {
  min-width: 148px; min-height: 44px; padding: 0 28px;
  background: var(--accent); color: #171615;
  border: 0; border-radius: 3px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: transform .18s ease, opacity .18s ease;
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.foot-hint { margin: -8px 0 0; font-size: 12px; color: var(--dim); }
.foot-hint.is-warn { color: var(--accent); }

.draft-note, .resume-note {
  margin: 0;
  padding: 10px 12px;
  background: var(--input);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
.draft-note[hidden], .resume-note[hidden] { display: none; }
.draft-note strong, .resume-note strong { display: block; margin-bottom: 2px; color: var(--text); font-weight: 600; }
.draft-note.is-match, .resume-note { border-left-color: var(--success); }
.draft-note button {
  display: block; margin: 6px 0 0; padding: 0;
  background: none; border: 0;
  color: var(--accent); font-family: inherit; font-size: inherit;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}

.progress-wrap { display: flex; align-items: center; gap: 12px; }
.progress-wrap[hidden] { display: none; }
.progress-track { flex: 1; height: 4px; border-radius: 2px; background: var(--input); overflow: hidden; }
.progress-bar {
  width: 100%; height: 100%; background: var(--accent);
  transform: scaleX(0); transform-origin: left center;
  transition: transform .2s ease;
}
#progressText { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }

.result { padding: 16px 18px; border: 1px solid var(--line-strong); border-left: 3px solid var(--success); border-radius: 3px; background: var(--input); }
.result.is-error { border-left-color: var(--error); }
.result strong { display: block; margin-bottom: 6px; font-size: 14px; }
.result p { margin: 0; font-size: 12px; line-height: 1.7; color: var(--muted); }
.result p + p { margin-top: 6px; }
.result code { font-family: var(--mono); font-size: 11px; color: var(--accent); word-break: break-all; }
.result button {
  margin-top: 12px; padding: 6px 0;
  background: none; border: 0; color: var(--accent);
  font-family: inherit; font-size: 12px; cursor: pointer;
}

@media (max-width: 680px) {
  .topbar { height: 64px; padding: 0 20px; }
  .brand-en, .brand-sep, .deadline { display: none; }
  .chip { font-size: 11px; }
  .page { padding: 28px 16px; place-items: start center; }
  .card { padding: 24px 20px; gap: 20px; }
  .field-row { grid-template-columns: 1fr; }
  .card-footer { flex-direction: column; align-items: stretch; }
  .btn-primary { width: 100%; }
  .file-meta, .file-state { display: none; }
}

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