/* 稿件匹配页（/:lang/match）专用样式。
 * 只在本页通过 head.ejs 的 extraCss 加载；沿用站点纸色变量，不覆盖全局样式。
 * 目标：390px 无横向溢出，表单与结果两栏在窄屏堆叠。 */

.match-page {
  padding: clamp(20px, 4vw, 36px) 0 56px;
}

.match-intro {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 18px;
  margin-bottom: 24px;
}

.match-intro h1 {
  font-size: clamp(1.6rem, 4.4vw, 2.15rem);
  max-width: 30ch;
}

.match-intro h1 em {
  font-style: italic;
  color: var(--accent);
}

.match-intro .deck {
  margin-bottom: 8px;
}

.match-scope {
  font-size: 0.86rem;
  color: var(--muted);
  max-width: 70ch;
  margin: 0;
}

.match-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(20px, 3vw, 36px);
  align-items: start;
}

@media (max-width: 860px) {
  .match-layout { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------- 表单 ---------------- */

.match-form {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(16px, 3vw, 24px);
}

.match-field + .match-field { margin-top: 16px; }

.match-form label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.match-req { color: var(--gold); }

.match-form input[type="text"],
.match-form input[type="number"],
.match-form select,
.match-form textarea {
  width: 100%;
  max-width: 100%;
  padding: 9px 11px;
  font: inherit;
  font-size: 0.94rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
}

.match-form textarea {
  min-height: 108px;
  resize: vertical;
  line-height: 1.55;
}

.match-form input:focus-visible,
.match-form select:focus-visible,
.match-form textarea:focus-visible {
  border-color: var(--accent);
}

.match-form [aria-invalid="true"] { border-color: var(--gold); }

.match-help {
  margin: 5px 0 0;
  font-size: 0.79rem;
  color: var(--muted);
}

.match-error {
  margin: 5px 0 0;
  font-size: 0.8rem;
  color: #8a2f24;
  font-weight: 600;
}

.match-constraints {
  margin-top: 20px;
  border-top: 1px solid var(--rule);
  padding-top: 14px;
}

.match-constraints summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}

.match-constraint-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 16px;
  margin-top: 14px;
}

.match-check label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 500;
  margin-top: 14px;
}

.match-check input[type="checkbox"] {
  width: auto;
  margin: 3px 0 0;
  accent-color: var(--accent);
}

.match-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 22px;
}

.match-submit {
  padding: 10px 20px;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--white);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
}

.match-submit:hover { background: var(--forest); border-color: var(--forest); }

.match-required {
  margin: 0;
  font-size: 0.79rem;
  color: var(--muted);
}

.match-privacy {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px dashed var(--rule);
  font-size: 0.77rem;
  color: var(--muted);
}

.match-side-link {
  margin: 14px 0 0;
  font-size: 0.85rem;
}

/* ---------------- 结果 ---------------- */

.match-results-head {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.match-results-head h2 { font-size: 1.15rem; }

.match-results-count {
  margin: 0 0 4px;
  font-size: 0.85rem;
  color: var(--muted);
}

.match-results-intro {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.match-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.match-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.match-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.match-issn {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
}

.match-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.match-badge-level {
  background: var(--accent-soft);
  color: var(--forest);
}

.match-card-title {
  font-size: 1.02rem;
  margin: 0 0 4px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.match-card-subject {
  margin: 0 0 10px;
  font-size: 0.84rem;
  color: var(--muted);
}

.match-missing { font-style: italic; }

.match-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 110px), 1fr));
  gap: 8px 14px;
  margin: 0 0 8px;
  padding: 10px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.match-metrics dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.match-metrics dd {
  margin: 2px 0 0;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.match-card-meta {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: var(--muted);
}

.match-evidence h3,
.match-constraints-state h3 {
  font-family: var(--sans);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 12px 0 6px;
}

.match-evidence ul,
.match-constraints-state ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.match-evidence li,
.match-constraints-state li {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.85rem;
  line-height: 1.45;
}

.match-ev-label {
  flex: 0 0 auto;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gold);
  padding-top: 1px;
}

.match-ev-body {
  flex: 1 1 200px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.match-ev-year {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-left: 6px;
}

.match-ev-extra {
  font-size: 0.76rem;
  margin-left: 8px;
  white-space: nowrap;
}

.match-cf-field {
  flex: 1 1 140px;
  color: var(--ink-soft);
}

.match-cf-value {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--rule);
}

.match-cf-fits { background: var(--forest-soft); color: var(--forest); border-color: var(--forest-soft); }
.match-cf-unknown { background: var(--paper-2); color: var(--muted); }
.match-cf-conflict { background: var(--gold-soft); color: var(--gold); border-color: var(--gold-soft); }

.match-foot-links {
  margin: 18px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------------- 通知 ---------------- */

.match-notice {
  background: var(--white);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.match-notice h2 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.match-notice p {
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.match-notice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 12px 0 0;
}

.match-btn-ghost {
  display: inline-block;
  padding: 7px 14px;
  font-size: 0.85rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  color: var(--accent);
  background: var(--paper);
}

.match-btn-ghost:hover {
  border-color: var(--accent);
  text-decoration: none;
}

@media (max-width: 430px) {
  .match-form,
  .match-card,
  .match-notice { padding: 14px; }
  .match-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .match-badges { margin-left: 0; }
  h1 { font-size: 1.5rem; }
}

/* ---------------- 首页主表单（compact） ---------------- */

.match-form-compact {
  max-width: 560px;
  background: var(--white);
  box-shadow: 0 1px 0 var(--rule);
}

.match-form-compact .match-field + .match-field { margin-top: 12px; }

.match-form-compact .match-help { font-size: 0.76rem; }

.match-form-compact .match-form textarea,
.match-form-compact textarea { min-height: 76px; }

.match-form-compact .match-actions { margin-top: 16px; }

.hero-journal-search {
  margin: 14px 0 0;
  font-size: 0.85rem;
}
