:root {
  --wechat-accent: var(--tool-blue);
  --wechat-accent-dark: var(--tool-blue);
  --wechat-accent-soft: rgba(168, 213, 207, 0.2);
  --wechat-ink: var(--tool-ink);
  --wechat-muted: var(--tool-muted);
  --wechat-line: var(--tool-line);
  --wechat-surface: var(--tool-paper);
  --wechat-danger: var(--portal-danger);
  --wechat-radius: 6px;
}

.xiumi-main {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
  padding-bottom: 64px;
}

.xiumi-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
}

.xiumi-heading h1,
.wechat-review-main h1 {
  margin: 6px 0 10px;
}

.xiumi-heading > div > p:last-child,
.wechat-review-main .project-heading > p:last-child {
  max-width: 720px;
  color: var(--wechat-muted);
  line-height: 1.7;
}

.local-review-link {
  flex: none;
}

.heading-actions {
  display: flex;
  flex: none;
  gap: 8px;
}

#mySubmissionsHeading { scroll-margin-top: 24px; }

.prototype-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  margin: 24px 0;
  padding: 13px 2px 13px 16px;
  border: 0;
  border-left: 2px solid var(--tool-gold);
  border-radius: 0;
  background: transparent;
  color: var(--tool-muted);
}

.workflow-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 0 24px;
  border: 1px solid var(--wechat-line);
  border-radius: 0;
  background: rgba(255, 253, 247, 0.48);
  overflow: hidden;
}

.workflow-strip > span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 17px 18px;
  border-right: 1px solid var(--wechat-line);
}

.workflow-strip > span:last-child { border-right: 0; }
.workflow-strip b { font-size: 14px; }
.workflow-strip small { color: var(--wechat-muted); }

.xiumi-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}

.xiumi-form-column {
  display: grid;
  gap: 20px;
}

.workflow-section,
.submission-sticky,
.wechat-review-card {
  border: 0;
  border-bottom: 1px solid rgba(154, 183, 170, 0.74);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.workflow-section { padding: 26px 2px 30px; }

.section-heading {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 18px;
  margin-bottom: 24px;
}

.section-heading > span {
  display: inline-grid;
  place-items: center;
  align-self: start;
  min-height: 34px;
  border-radius: 5px;
  background: var(--wechat-accent-soft);
  color: var(--wechat-accent-dark);
  font-size: 13px;
  font-weight: 700;
}

.section-heading h2,
.submission-list-heading h2 {
  margin: 0;
  color: var(--tool-ink);
  font-size: 22px;
}

.section-heading p,
.submission-help {
  margin: 6px 0 0;
  color: var(--wechat-muted);
  line-height: 1.65;
}

.instruction-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px;
  border: 1px solid rgba(154, 183, 170, 0.78);
  border-radius: 7px;
  background: rgba(255, 253, 247, 0.56);
}

.instruction-panel p {
  margin: 6px 0 0;
  color: var(--wechat-muted);
  line-height: 1.6;
}

.security-note {
  margin: 14px 0 0;
  color: #52625d;
  font-size: 13px;
}

.form-field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--wechat-ink);
  font-weight: 650;
}

.form-field small,
.signature-panel small,
.cover-fieldset small,
.sync-confirm small {
  color: var(--wechat-muted);
  font-weight: 400;
  line-height: 1.55;
}

.form-field input,
.form-field textarea,
.signature-panel textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--tool-line);
  border-radius: 6px;
  background: var(--tool-paper);
  color: var(--tool-ink);
  font: inherit;
  font-weight: 500;
  line-height: 1.6;
  padding: 12px 13px;
}

.form-field input:focus,
.form-field textarea:focus,
.signature-panel textarea:focus {
  border-color: var(--wechat-accent);
  outline: 3px solid rgba(47, 107, 91, 0.16);
}

.form-field input[readonly] {
  background: rgba(168, 213, 207, 0.12);
  color: var(--tool-muted);
}

.copy-panel,
.signature-panel {
  margin-bottom: 18px;
  border: 1px solid var(--wechat-line);
  border-radius: 7px;
  background: rgba(255, 253, 247, 0.56);
}

.copy-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px;
}

.copy-panel > div { display: grid; gap: 5px; }
.copy-panel span,
.signature-panel header span { color: var(--wechat-muted); font-size: 13px; }

.signature-panel { padding: 18px; }
.signature-panel header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.signature-panel header > div { display: grid; gap: 5px; }
.signature-panel textarea { resize: vertical; min-height: 180px; }
.signature-panel > small { display: block; margin-top: 10px; }

.rules-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.rules-list p {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 15px;
  border-radius: 6px;
  background: rgba(168, 213, 207, 0.14);
}

.rules-list span { color: var(--wechat-muted); font-size: 13px; line-height: 1.55; }

.identity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.cover-fieldset {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.cover-fieldset legend { margin-bottom: 9px; font-weight: 650; }
.cover-fieldset > label:not(.upload-field),
.sync-confirm {
  display: flex;
  align-items: start;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--wechat-line);
  border-radius: 6px;
  background: rgba(255, 253, 247, 0.56);
}

.cover-fieldset > label span,
.sync-confirm span { display: grid; gap: 4px; }
.cover-fieldset input[type="radio"],
.sync-confirm input { width: 18px; height: 18px; accent-color: var(--wechat-accent); }

.upload-field {
  margin-top: 4px;
  padding: 14px;
  border: 1px dashed #9eafa8;
  border-radius: 6px;
  background: rgba(255, 253, 247, 0.42);
}

.upload-field input { border: 0; padding: 5px 0; background: transparent; }
.upload-field small[data-kind="error"] { color: var(--wechat-danger); }
.upload-field small[data-kind="success"] { color: var(--wechat-accent-dark); }

.sync-confirm { margin: 4px 0 18px; }
.form-feedback { min-height: 24px; margin-bottom: 10px; color: var(--wechat-muted); line-height: 1.5; }
.form-feedback[data-kind="error"] { color: var(--wechat-danger); }
.form-feedback[data-kind="success"] { color: var(--wechat-accent-dark); }
.submit-action { width: 100%; justify-content: center; }

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  box-sizing: border-box;
  padding: 0 16px;
  border-radius: 5px;
  text-decoration: none;
  white-space: nowrap;
}

.primary-action:active,
.secondary-action:active { transform: translateY(1px); }
.primary-action:disabled,
.secondary-action:disabled { cursor: not-allowed; opacity: 0.48; transform: none; }

.submission-sticky {
  position: static;
  padding: 26px 2px 30px;
}

.submission-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.submission-list-heading .eyebrow { margin: 0 0 4px; }
.submission-help { margin-bottom: 18px; font-size: 13px; }
.submission-state { padding: 24px 12px; color: var(--wechat-muted); text-align: center; line-height: 1.6; }
.student-submission-list { display: grid; gap: 14px; }

.student-submission-card {
  padding: 17px;
  border: 1px solid var(--wechat-line);
  border-radius: 7px;
  background: rgba(255, 253, 247, 0.56);
}

.student-submission-card > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.student-submission-card h3 { margin: 0; font-size: 18px; line-height: 1.45; }
.submission-status { flex: none; padding: 6px 10px; border-radius: 8px; background: #eef2f0; color: #4b5a55; font-size: 12px; font-weight: 700; }
.status-waiting_teacher_review { background: #fff2cc; color: #72540b; }
.status-teacher_processing { background: #e5eff7; color: #315f7c; }
.status-wechat_draft { background: var(--wechat-accent-soft); color: var(--wechat-accent-dark); }
.status-published { background: #dcefe5; color: #205c42; }
.status-withdrawn { background: #f1eeee; color: #776767; }

.submission-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; color: var(--wechat-muted); font-size: 13px; }
.status-history { display: grid; gap: 8px; margin: 16px 0; padding: 0 0 0 18px; }
.status-history li { padding-left: 3px; color: #52625d; font-size: 12px; }
.status-history strong { display: block; color: #334943; font-size: 13px; }
.status-history span { display: block; margin-top: 2px; }
.result-link { display: inline-block; margin-bottom: 14px; color: var(--wechat-accent-dark); font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.submission-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.submission-actions button { justify-content: center; min-width: 0; padding-inline: 10px; }
.card-feedback { margin: 11px 0 0; color: var(--wechat-muted); font-size: 12px; line-height: 1.55; }

.xiumi-submit-path {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border: 1px solid var(--tool-line);
  background: rgba(255, 253, 247, 0.48);
  list-style: none;
}

.xiumi-submit-path li {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 104px;
  padding: 17px 18px;
  border-right: 1px solid var(--tool-line);
}

.xiumi-submit-path li:last-child { border-right: 0; }
.xiumi-submit-path span { color: var(--tool-gold); font-size: 13px; font-weight: 800; }
.xiumi-submit-path strong { color: var(--tool-ink); font-size: 14px; line-height: 1.65; }

@media (max-width: 980px) {
  .xiumi-layout { grid-template-columns: 1fr; }
  .submission-sticky { position: static; }
}

@media (max-width: 720px) {
  .xiumi-main,
  .wechat-review-main { width: min(100% - 24px, 1240px); padding-bottom: 40px; }
  .xiumi-heading { align-items: start; flex-direction: column; gap: 16px; }
  .heading-actions { width: 100%; }
  .heading-actions .secondary-action { flex: 1; }
  .workflow-strip { grid-template-columns: 1fr 1fr; }
  .workflow-strip > span:nth-child(2) { border-right: 0; }
  .workflow-strip > span:nth-child(-n + 2) { border-bottom: 1px solid var(--wechat-line); }
  .workflow-section { padding: 19px; }
  .section-heading { grid-template-columns: 1fr; gap: 10px; }
  .section-heading > span { justify-self: start; padding: 0 12px; }
  .instruction-panel,
  .copy-panel,
  .signature-panel header { align-items: stretch; flex-direction: column; }
  .identity-grid,
  .rules-list,
  .submission-meta,
  .submission-actions { grid-template-columns: 1fr; }
  .xiumi-submit-path { grid-template-columns: 1fr; }
  .xiumi-submit-path li { min-height: 0; border-right: 0; border-bottom: 1px solid var(--tool-line); }
  .xiumi-submit-path li:last-child { border-bottom: 0; }
  .prototype-note { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
