:root {
  --ink: #18252c;
  --muted: #66757d;
  --line: #d9e0df;
  --surface: #ffffff;
  --surface-soft: #f4f7f5;
  --surface-blue: #edf2f8;
  --green: #147b62;
  --green-dark: #0f634f;
  --green-soft: #e4f4ee;
  --blue: #3b58b8;
  --orange: #b96b2c;
  --shadow: 0 20px 55px rgba(25, 49, 57, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background: #eef2f1;
}

body {
  margin: 0;
  min-width: 320px;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(520px, 1.08fr) minmax(440px, 0.92fr);
  background: var(--surface);
}

.login-showcase {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  padding: 38px clamp(40px, 6vw, 88px);
  background:
    linear-gradient(135deg, rgba(59, 88, 184, 0.09), transparent 56%),
    linear-gradient(25deg, rgba(20, 123, 98, 0.12), transparent 62%),
    #f6f8f5;
}

.login-showcase::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -150px;
  bottom: -170px;
  border-radius: 50%;
  border: 70px solid rgba(20, 123, 98, 0.06);
}

.login-brand,
.workspace-brand,
.mobile-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green);
  box-shadow: 0 9px 20px rgba(20, 123, 98, 0.23);
}

.brand-mark svg {
  width: 20px;
  height: 20px;
}

.showcase-copy {
  position: relative;
  z-index: 2;
  max-width: 650px;
  margin-top: clamp(80px, 13vh, 150px);
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--green);
}

.showcase-copy h1 {
  margin: 15px 0 18px;
  max-width: 650px;
  font-family: "Noto Serif SC", "Songti SC", SimSun, serif;
  font-size: clamp(38px, 4.1vw, 59px);
  line-height: 1.21;
  letter-spacing: -0.025em;
}

.showcase-copy p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.paper-showcase {
  position: absolute;
  z-index: 1;
  right: clamp(36px, 7vw, 120px);
  bottom: -68px;
  width: 330px;
  height: 438px;
  padding: 34px 38px;
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid rgba(24, 37, 44, 0.1);
  border-radius: 3px;
  box-shadow: 0 28px 75px rgba(31, 56, 63, 0.2);
  transform: rotate(-8deg);
}

.paper-topline {
  width: 100%;
  height: 4px;
  background: var(--ink);
}

.paper-logo {
  margin-top: 29px;
  text-align: center;
  font-family: "STXingkai", "KaiTi", serif;
  font-size: 32px;
  font-weight: 700;
}

.paper-degree {
  margin: 12px 0 42px;
  text-align: center;
  font-family: "Noto Serif SC", "SimSun", serif;
  font-size: 16px;
  font-weight: 700;
}

.paper-fields {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 15px 14px;
  align-items: center;
  font-family: "Noto Serif SC", "SimSun", serif;
  font-size: 12px;
}

.paper-fields b {
  display: block;
  height: 1px;
  background: #30383b;
}

.paper-date {
  margin-top: 46px;
  text-align: center;
  font-family: "Noto Serif SC", "SimSun", serif;
  font-size: 12px;
}

.paper-seal {
  position: absolute;
  right: 28px;
  bottom: 24px;
  width: 58px;
  height: 58px;
  border: 3px double rgba(184, 51, 51, 0.3);
  border-radius: 50%;
}

.login-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px;
  background: #fff;
}

.login-form {
  width: min(100%, 420px);
}

.mobile-brand {
  display: none;
}

.login-form h2 {
  margin: 12px 0 34px;
  font-size: 30px;
  line-height: 1.3;
}

.login-form > label,
.field {
  display: grid;
  gap: 8px;
}

.login-form > label + label {
  margin-top: 18px;
}

.login-form label > span,
.field > span {
  color: #536269;
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input,
select {
  height: 46px;
  padding: 0 13px;
}

textarea {
  min-height: 250px;
  padding: 15px;
  resize: vertical;
  line-height: 1.75;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(20, 123, 98, 0.11);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 48px;
}

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: transparent;
  cursor: pointer;
}

.icon-button:hover {
  background: var(--surface-soft);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.password-field .icon-button {
  position: absolute;
  right: 4px;
  top: 4px;
}

.form-error {
  margin: 12px 0 0;
  color: #a83e35;
  font-size: 13px;
}

.primary-button {
  border: 0;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  color: #fff;
  background: var(--green);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(20, 123, 98, 0.2);
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.primary-button:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
  box-shadow: 0 15px 32px rgba(20, 123, 98, 0.24);
}

.primary-button:disabled {
  opacity: 0.58;
  cursor: wait;
  transform: none;
}

.primary-button svg {
  width: 18px;
  height: 18px;
}

.login-button {
  width: 100%;
  margin-top: 28px;
}

.login-footnote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  color: #77858b;
  font-size: 12px;
}

.login-footnote svg {
  width: 14px;
  height: 14px;
}

.workspace {
  min-height: 100vh;
  background:
    linear-gradient(180deg, #edf2f1 0, #f7f8f7 340px, #f2f5f3 100%);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  height: 68px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 22px;
  padding: 0 clamp(20px, 4vw, 58px);
  border-bottom: 1px solid rgba(24, 37, 44, 0.1);
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(14px);
}

.workspace-brand {
  width: max-content;
  color: var(--ink);
  text-decoration: none;
}

.workspace-brand .brand-mark {
  width: 32px;
  height: 32px;
}

.workspace-brand .brand-mark svg {
  width: 17px;
  height: 17px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-item {
  height: 38px;
  border: 0;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  background: transparent;
  color: #506168;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.nav-item svg {
  width: 16px;
  height: 16px;
}

.nav-item.active {
  color: var(--green);
  background: var(--green-soft);
}

.account-menu {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 9px;
}

.account-avatar {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.account-name {
  color: #56676e;
  font-size: 13px;
}

.workspace-main {
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto;
  padding: 38px 0 70px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
  margin-bottom: 25px;
}

.page-heading h1 {
  margin: 8px 0 8px;
  font-family: "Noto Serif SC", "Songti SC", SimSun, serif;
  font-size: clamp(28px, 3.3vw, 42px);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.template-status {
  min-width: 180px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid #cddbd6;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.8);
  color: #27413a;
  font-size: 13px;
  font-weight: 800;
}

.template-status svg {
  width: 16px;
  height: 16px;
}

.template-picker {
  position: relative;
  min-width: 280px;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 9px 0 12px;
  border: 1px solid #cddbd6;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.9);
  color: #27413a;
}

.template-search-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--green);
}

.template-picker input[type="search"] {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 800;
  outline: none;
  appearance: none;
}

.template-picker input[type="search"]:focus {
  border-color: transparent;
  box-shadow: none;
}

.template-picker input[type="search"]::-webkit-search-cancel-button {
  width: 14px;
  height: 14px;
}

.template-picker-toggle {
  width: 28px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 5px;
  padding: 0;
  background: transparent;
  color: #52766c;
  cursor: pointer;
}

.template-picker-toggle:hover {
  background: #edf4f0;
}

.template-picker-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 160ms ease;
}

.template-picker.open .template-picker-toggle svg {
  transform: rotate(180deg);
}

.template-options {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  z-index: 50;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #cddbd6;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(25, 49, 57, 0.16);
}

.template-option {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #27413a;
  text-align: left;
  cursor: pointer;
}

.template-option:hover,
.template-option.active {
  background: var(--green-soft);
  color: var(--green-dark);
}

.template-option-label {
  min-width: 0;
  flex: 1;
  line-height: 1.35;
}

.template-option-check {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--green);
  opacity: 0;
}

.template-option.selected .template-option-check {
  opacity: 1;
}

.template-option-empty {
  padding: 14px 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #25a87c;
  box-shadow: 0 0 0 5px rgba(37, 168, 124, 0.1);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(350px, 0.55fr);
  gap: 22px;
  align-items: start;
}

.editor-column,
.preview-column {
  min-width: 0;
}

.editor-column {
  display: grid;
  gap: 18px;
}

.panel {
  border: 1px solid rgba(24, 37, 44, 0.09);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 26px rgba(34, 58, 64, 0.055);
}

.source-panel,
.info-panel {
  padding: 25px 27px 28px;
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 22px;
}

.step-index {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green);
  font-size: 14px;
  font-weight: 800;
}

.panel-heading h2 {
  margin: 0 0 3px;
  font-size: 18px;
  line-height: 1.3;
}

.panel-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.source-tabs {
  display: inline-flex;
  padding: 3px;
  border-radius: 7px;
  background: #eff3f2;
  margin-bottom: 16px;
}

.source-tab {
  height: 36px;
  border: 0;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 15px;
  background: transparent;
  color: #617178;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.source-tab.active {
  color: var(--green);
  background: #fff;
  box-shadow: 0 3px 10px rgba(30, 54, 60, 0.08);
}

.source-tab svg {
  width: 16px;
  height: 16px;
}

.textarea-footer {
  height: 39px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
  color: #7c898e;
  font-size: 12px;
}

.textarea-footer b {
  color: #45565d;
}

.text-button {
  height: 30px;
  border: 0;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  color: var(--blue);
  background: var(--surface-blue);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.text-button svg {
  width: 14px;
  height: 14px;
}

.dropzone {
  min-height: 290px;
  border: 1.5px dashed #a9c4ba;
  border-radius: 8px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  padding: 28px;
  text-align: center;
  background: #f9fbfa;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.dropzone.dragging,
.dropzone:hover {
  border-color: var(--green);
  background: var(--green-soft);
}

.dropzone input {
  display: none;
}

.dropzone-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--green);
  background: #e6f3ee;
}

.dropzone-icon svg {
  width: 26px;
  height: 26px;
}

.dropzone strong {
  font-size: 15px;
}

.dropzone > span:last-of-type {
  color: var(--muted);
  font-size: 12px;
}

.selected-file {
  max-width: 90%;
  padding: 7px 11px;
  border-radius: 6px;
  color: var(--green) !important;
  background: #fff;
  border: 1px solid #bed9cf;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.field-wide {
  grid-column: span 2;
}

.field input,
.field select {
  height: 43px;
  font-size: 14px;
}

.translate-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #d8e4df;
  border-radius: 7px;
  background: #f8fbf9;
  cursor: pointer;
}

.translate-option input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin: 1px 0 0;
  accent-color: var(--green);
  cursor: pointer;
}

.translate-option-copy {
  display: grid;
  gap: 3px;
}

.translate-option-copy strong {
  color: #314b45;
  font-size: 13px;
}

.translate-option-copy span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.action-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  border: 1px solid #bcd8cf;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(20, 123, 98, 0.08), transparent 60%),
    #fff;
}

.action-copy {
  display: flex;
  align-items: center;
  gap: 12px;
}

.action-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--orange);
  background: #f8eee5;
}

.action-icon svg {
  width: 20px;
  height: 20px;
}

.action-copy strong,
.action-copy span {
  display: block;
}

.action-copy strong {
  font-size: 15px;
}

.action-copy div > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.generate-button {
  min-width: 190px;
}

.progress-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 13px;
  align-items: center;
  padding: 18px 22px;
  border: 1px solid #cbd7e8;
  border-radius: 8px;
  background: #f6f8fc;
}

.progress-icon {
  grid-row: span 2;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: #e5ebf8;
}

.progress-icon svg {
  width: 21px;
  height: 21px;
  animation: spin 1.1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.progress-copy strong,
.progress-copy span {
  display: block;
}

.progress-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.progress-track {
  grid-column: 2;
  height: 5px;
  overflow: hidden;
  border-radius: 4px;
  background: #dfe6ef;
}

.progress-track span {
  display: block;
  width: 8%;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 320ms ease;
}

.result-panel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border: 1px solid #b7d8cb;
  border-radius: 8px;
  background:
    linear-gradient(100deg, rgba(20, 123, 98, 0.08), transparent 62%),
    #fff;
  box-shadow: 0 18px 36px rgba(20, 123, 98, 0.09);
}

.result-mark {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green);
}

.result-mark svg {
  width: 29px;
  height: 29px;
}

.result-copy h2 {
  margin: 4px 0 6px;
  font-size: 21px;
}

.result-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.result-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
}

.result-stats span {
  padding: 5px 8px;
  border-radius: 5px;
  color: #3c5950;
  background: var(--green-soft);
  font-size: 11px;
  font-weight: 800;
}

.download-button {
  white-space: nowrap;
}

.preview-column {
  position: sticky;
  top: 86px;
}

.preview-panel {
  padding: 22px;
}

.preview-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.preview-heading h2 {
  margin: 4px 0 0;
  font-size: 19px;
}

.page-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #596b72;
  font-size: 12px;
}

.page-count svg {
  width: 15px;
  height: 15px;
}

.a4-shell {
  padding: 16px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(59, 88, 184, 0.07), transparent 55%),
    #edf1ef;
}

.a4-page {
  aspect-ratio: 210 / 297;
  width: 100%;
  padding: 10% 10% 8%;
  background: #fff;
  border: 1px solid #d7dcda;
  box-shadow: 0 15px 35px rgba(31, 49, 55, 0.14);
  font-family: "Noto Serif SC", "Songti SC", SimSun, serif;
}

.cover-school {
  margin-top: 11%;
  text-align: center;
  font-family: "STXingkai", "KaiTi", serif;
  font-size: clamp(20px, 2vw, 30px);
  font-weight: 800;
}

.cover-degree {
  margin-top: 4%;
  text-align: center;
  font-size: clamp(13px, 1.25vw, 17px);
  font-weight: 800;
}

.cover-meta {
  display: grid;
  gap: clamp(8px, 1.3vh, 13px);
  margin-top: 17%;
  font-size: clamp(8px, 0.78vw, 11px);
}

.cover-meta > div {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.cover-meta span {
  flex: 0 0 auto;
  white-space: nowrap;
}

.cover-meta b {
  flex: 1 1 auto;
  min-width: 0;
  padding-bottom: 2px;
  overflow: hidden;
  border-bottom: 1px solid #283136;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.cover-meta > div:nth-child(2) b:first-of-type,
.cover-meta > div:nth-child(3) b:first-of-type {
  flex: 0.85 1 0;
}

.cover-footer {
  display: grid;
  gap: 6px;
  margin-top: 18%;
  text-align: center;
  font-size: clamp(8px, 0.78vw, 11px);
}

.structure-list {
  margin-top: 20px;
}

.structure-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13px;
}

.structure-title b {
  color: var(--green);
  font-size: 12px;
}

.structure-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.structure-items span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 5px;
  color: #3e5550;
  background: #f0f5f3;
  font-size: 11px;
  font-weight: 700;
}

.structure-items svg {
  width: 12px;
  height: 12px;
  color: var(--green);
}

@media (max-width: 1180px) {
  .login-view {
    grid-template-columns: 1fr 480px;
  }

  .paper-showcase {
    width: 270px;
    height: 360px;
    right: 40px;
  }

  .workspace-grid {
    grid-template-columns: minmax(0, 1fr) 390px;
  }

  .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .login-view {
    display: block;
  }

  .login-showcase {
    display: none;
  }

  .login-panel {
    min-height: 100vh;
  }

  .mobile-brand {
    display: inline-flex;
    margin-bottom: 52px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topnav {
    display: none;
  }

  .workspace-main {
    width: min(100% - 28px, 760px);
    padding-top: 26px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .preview-column {
    position: static;
    grid-row: 1;
  }

  .preview-panel {
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(280px, 1.2fr);
    gap: 20px;
  }

  .preview-heading {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }

  .structure-list {
    margin-top: 0;
    align-self: start;
  }
}

@media (max-width: 650px) {
  .login-panel {
    padding: 28px 22px;
    place-items: start stretch;
  }

  .login-form {
    width: 100%;
    padding-top: 8vh;
  }

  .mobile-brand {
    margin-bottom: 46px;
  }

  .topbar {
    height: 60px;
    padding: 0 14px;
  }

  .account-name {
    display: none;
  }

  .workspace-main {
    width: min(100% - 20px, 620px);
    padding-bottom: 40px;
  }

  .page-heading h1 {
    font-size: 28px;
  }

  .template-status,
  .template-picker {
    width: 100%;
  }

  .source-panel,
  .info-panel,
  .preview-panel {
    padding: 18px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: auto;
  }

  .action-panel,
  .result-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .action-panel {
    display: flex;
  }

  .generate-button,
  .download-button {
    width: 100%;
  }

  .result-panel {
    grid-template-columns: 1fr;
  }

  .result-mark {
    width: 46px;
    height: 46px;
  }

  .preview-panel {
    display: block;
  }

  .preview-heading {
    margin-bottom: 16px;
  }

  .structure-list {
    margin-top: 18px;
  }

  .a4-page {
    padding: 10% 9% 7%;
  }

  .cover-meta {
    margin-top: 15%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
