/* 开卷 · CAJ → PDF — instrument / ink 视觉 */

:root {
  --ink:      #0d1013;
  --ink-2:    #12171b;
  --ink-3:    #171d22;
  --line:     rgba(238, 232, 220, .11);
  --line-2:   rgba(238, 232, 220, .22);
  --paper:    #ece7dd;
  --muted:    #8c8677;
  --muted-2:  #6b675c;
  --accent:   #e8503a;
  --accent-2: #ff7a5c;
  --accent-dim: rgba(232, 80, 58, .14);
  --ok:       #86c99c;
  --warn:     #d8a657;

  --display: "Fraunces", "Songti SC", "Noto Serif CJK SC", serif;
  --ui:      "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --body:    "IBM Plex Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;

  --pad: clamp(1.25rem, 4vw, 2.5rem);
  --max: 1100px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(70rem 40rem at 15% -10%, rgba(232, 80, 58, .10), transparent 60%),
    radial-gradient(60rem 36rem at 100% 0%, rgba(120, 150, 200, .07), transparent 55%),
    radial-gradient(50rem 30rem at 50% 120%, rgba(232, 80, 58, .06), transparent 60%);
}

.grain {
  position: fixed;
  inset: -10%;
  z-index: 0;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

.topbar, main, footer { position: relative; z-index: 1; }

a { color: var(--accent-2); text-decoration-color: rgba(255,122,92,.35); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

code {
  font-family: var(--ui);
  font-size: .82em;
  padding: .12em .42em;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255,255,255,.03);
  color: var(--paper);
}

.u { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent); }

.mono-label {
  font-family: var(--ui);
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- topbar ---------- */

.topbar {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.4rem var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: .6rem;
  color: inherit;
  text-decoration: none;
}
.brand__mark { color: var(--accent); align-self: center; display: inline-flex; }
.brand__name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: .02em;
}
.brand__sub {
  font-family: var(--ui);
  font-size: .68rem;
  letter-spacing: .14em;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--ui);
  font-size: .68rem;
  letter-spacing: .1em;
  padding: .38rem .7rem;
  border: 1px solid var(--line-2);
  border-radius: 100px;
  color: var(--paper);
  white-space: nowrap;
}
.pill--signal .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(134,201,156,.16);
}

/* ---------- hero ---------- */

main { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad) 4rem; }

.hero { padding: clamp(2rem, 6vw, 4.5rem) 0 clamp(1.6rem, 4vw, 3rem); }

.kicker {
  font-family: var(--ui);
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.2rem;
}

h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.4rem, 7.4vw, 4.6rem);
  line-height: .96;
  letter-spacing: -.025em;
  margin: 0 0 1.5rem;
  font-variation-settings: "opsz" 90, "SOFT" 0;
  text-wrap: balance;
}
h1 em {
  font-style: italic;
  color: var(--accent);
  font-variation-settings: "opsz" 120, "SOFT" 40;
}

.lede {
  max-width: 46rem;
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  color: #c9c3b6;
  margin: 0 0 2rem;
}
.lede strong { color: var(--paper); font-weight: 600; }

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.facts li {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  padding: .8rem 1.6rem .8rem 0;
  margin-right: 1.6rem;
  border-right: 1px solid var(--line);
}
.facts li:last-child { border-right: 0; margin-right: 0; }
.facts__k {
  font-family: var(--ui);
  font-size: .66rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.facts__v { font-size: .92rem; color: var(--paper); }

/* ---------- dropzone ---------- */

.panel { margin-top: .5rem; }

.drop {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 15rem;
  padding: 3rem 1.5rem;
  border: 1.5px dashed var(--line-2);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(255,255,255,.022), rgba(255,255,255,0));
  cursor: pointer;
  transition: border-color .25s, background .25s, transform .25s;
  outline: none;
}
.drop:hover, .drop:focus-visible { border-color: var(--accent); background: rgba(232,80,58,.05); }
.drop.is-drag {
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: scale(1.005);
}

.corner {
  position: absolute;
  width: 14px; height: 14px;
  border: 2px solid var(--accent);
  opacity: .55;
  transition: opacity .25s, transform .25s;
}
.drop:hover .corner, .drop.is-drag .corner { opacity: 1; }
.corner--tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.corner--tr { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.corner--bl { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }
.corner--br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.drop__inner { text-align: center; }
.drop__icon { width: 46px; height: 46px; color: var(--accent); opacity: .85; margin-bottom: .9rem; }
.drop.is-drag .drop__icon { animation: bob .9s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-5px) } }

.drop__title {
  font-family: var(--display);
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  font-weight: 600;
  margin: 0 0 .5rem;
}
.drop__hint { margin: 0; font-size: .84rem; color: var(--muted); }

/* ---------- queue ---------- */

.queue { margin-top: 1.75rem; animation: rise .5s both; }
.queue__head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--line);
}

.list { list-style: none; margin: 0; padding: 0; }

.row {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  animation: rise .45s both;
  animation-delay: var(--d, 0ms);
}
@keyframes rise { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }

.row__idx {
  font-family: var(--ui);
  font-size: .72rem;
  color: var(--muted-2);
}
.row__main { min-width: 0; }
.row__name {
  font-size: .96rem;
  font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row__meta {
  display: flex; flex-wrap: wrap; gap: .35rem .8rem;
  margin-top: .28rem;
  font-family: var(--ui);
  font-size: .7rem;
  color: var(--muted);
}
.row__meta .fmt { color: var(--accent-2); letter-spacing: .08em; }
.row__meta .err { color: var(--warn); }

.bar {
  margin-top: .6rem;
  height: 3px;
  background: var(--line);
  overflow: hidden;
}
.bar > i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .18s ease-out;
}
.bar--indet > i {
  width: 32%;
  animation: sweep 1.15s cubic-bezier(.6,.1,.3,.9) infinite;
}
@keyframes sweep { 0% { margin-left: -34% } 100% { margin-left: 102% } }
.bar--done > i { width: 100%; background: var(--ok); }
.bar--fail > i { width: 100%; background: var(--warn); }

.row__act { display: flex; align-items: center; gap: .5rem; }

.status {
  font-family: var(--ui);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.status--done { color: var(--ok); }
.status--fail { color: var(--warn); }
.status--work { color: var(--accent-2); }

/* ---------- buttons ---------- */

.btn {
  font-family: var(--ui);
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .5rem .85rem;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s, transform .12s;
}
.btn:hover { border-color: var(--accent); color: var(--accent-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn--primary {
  background: var(--accent); border-color: var(--accent); color: #140805; font-weight: 600;
}
.btn--primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #140805; }
.btn--ghost { border-color: transparent; color: var(--muted); padding: .4rem .6rem; }
.btn--ghost:hover { color: var(--accent-2); }

/* ---------- blueprint ---------- */

.blueprint { margin-top: clamp(3rem, 7vw, 5rem); }
.blueprint h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -.01em;
  margin: 0 0 1.6rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.card {
  background: var(--ink-2);
  padding: 1.4rem 1.3rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  transition: background .25s;
}
.card:hover { background: var(--ink-3); }
.card h3 {
  font-family: var(--ui);
  font-size: .95rem;
  letter-spacing: .06em;
  margin: 0;
  order: 2;
}
.card p { margin: 0; font-size: .86rem; color: var(--muted); order: 3; }
.card__badge {
  align-self: flex-start;
  order: 1;
  font-family: var(--ui);
  font-size: .62rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: .2rem .5rem;
  border: 1px solid currentColor;
  border-radius: 100px;
}
.card__badge--ok  { color: var(--ok); }
.card__badge--exp { color: var(--warn); }
.card__badge--no  { color: var(--muted); }

/* ---------- footer ---------- */

footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem var(--pad) 3rem;
  border-top: 1px solid var(--line);
  font-size: .82rem;
  color: var(--muted);
}
footer p { margin: 0 0 .5rem; }
.footnote { font-size: .74rem; color: var(--muted-2); }

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; }
  .facts li { border-right: 0; padding-right: 0; margin-right: 1.2rem; }
  .row { grid-template-columns: 1.8rem minmax(0,1fr); }
  .row__act { grid-column: 1 / -1; justify-content: flex-start; }
}

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