:root {
  --bg-start: #eaf6ff;
  --bg-end: #ffffff;
  --card: #ffffff;
  --border: #dce8f5;
  --text: #111827;
  --muted: #667085;
  --primary: #1e78ff;
  --primary-hover: #1669e8;
  --danger: #c62828;
  --success: #146c43;
  --shadow: 0 18px 40px rgba(30, 120, 255, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Arial, "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
}

button,
input,
select,
textarea {
  font: inherit;
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 32px;
  font-weight: 800;
}

.brand-title {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.brand-english {
  color: #111111;
}

.brand-subtitle {
  color: #0b3a75;
  font-size: 0.72em;
  font-weight: 600;
  font-style: normal;
}

.brand-edition {
  color: inherit;
  font-size: 0.78em;
  font-weight: inherit;
  margin-left: 2px;
}

.brand-icon {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #ffffff;
  font-size: 24px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1e78ff, #3aa0ff);
}

.top-actions,
.button-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.nav-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  line-height: 1;
  padding: 0 20px;
  border: 1px solid #cfdced;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.nav-button:hover,
.secondary-button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.ghost-button {
  border-color: transparent;
  color: var(--muted);
}

.main-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.05fr;
  gap: 28px;
}

.config-stack {
  display: grid;
  gap: 22px;
}

.panel {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

h1,
h2 {
  margin: 0 0 22px;
  color: #111111;
  line-height: 1.2;
}

h1 {
  font-size: 26px;
}

h2 {
  font-size: 20px;
}

label {
  display: block;
  margin: 16px 0 8px;
  color: #111111;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfdced;
  border-radius: 8px;
  background: #ffffff;
  outline: none;
}

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

textarea {
  min-height: 160px;
  padding: 16px;
  resize: vertical;
  line-height: 1.7;
}

#promptInput {
  min-height: 238px;
}

.small-textarea {
  min-height: 74px;
  padding: 10px 12px;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 120, 255, 0.12);
}

.textarea-wrap {
  position: relative;
}

.textarea-wrap span {
  position: absolute;
  right: 16px;
  bottom: 14px;
  color: var(--muted);
}

.help-text,
.center-help,
.status-text,
.error-text {
  margin: 8px 0 0;
  font-size: 14px;
}

.help-text,
.center-help {
  color: var(--muted);
}

.center-help {
  text-align: center;
}

.config-readme-notice {
  margin: -8px 0 22px;
  color: #9b111e;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.6;
}

.config-readme-notice a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.status-text {
  color: var(--success);
  min-height: 20px;
}

.status-success {
  color: var(--success);
  font-weight: 700;
}

.module-status {
  min-height: 20px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.module-status.success {
  color: var(--success);
}

.module-status.error {
  color: var(--danger);
}

.module-status.info {
  color: #4f647a;
}

.status-enabled {
  color: var(--primary);
  font-weight: 600;
}

.status-error {
  color: var(--danger);
  font-weight: 700;
}

.error-text {
  color: var(--danger);
  min-height: 20px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.segmented.three {
  grid-template-columns: repeat(3, minmax(44px, 1fr));
  gap: 8px;
  max-width: 190px;
}

#aspectRatioGroup {
  grid-template-columns: repeat(8, minmax(44px, 1fr));
  gap: 8px;
  overflow-x: auto;
}

#aspectRatioGroup button {
  height: 38px;
  min-width: 44px;
  padding: 0 4px;
}

#imageSizeGroup button,
#qualityGroup button {
  height: 38px;
  min-width: 44px;
  padding: 0 4px;
}

.segmented button {
  height: 44px;
  border: 1px solid #cfdced;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.segmented button.active {
  border-color: var(--primary);
  color: #ffffff;
  background: var(--primary);
}

.segmented.disabled-control {
  opacity: 0.55;
}

.segmented.disabled-control button {
  cursor: not-allowed;
}

.path-row {
  display: grid;
  grid-template-columns: 1fr 140px;
}

.inline-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 12px;
}

.custom-prompt-row {
  grid-template-columns: minmax(0, 1fr) max-content;
  margin-top: 10px;
}

.action-blue-button {
  min-width: 150px;
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.action-blue-button:hover {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
}

.generate-main-btn,
.secondary-button.generate-main-btn,
.primary-button.generate-main-btn {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9px;
  color: #ffffff;
  background: linear-gradient(90deg, #145bff 0%, #1d7cff 55%, #20c8f7 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 5px 12px rgba(20, 91, 255, 0.14),
    0 2px 5px rgba(32, 200, 247, 0.08);
  font-weight: 700;
  transition: all 0.18s ease;
}

.generate-main-btn:hover,
.secondary-button.generate-main-btn:hover,
.primary-button.generate-main-btn:hover {
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  background: linear-gradient(90deg, #083fe0 0%, #0d56d8 50%, #0b8fd0 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.20),
    0 7px 16px rgba(10, 73, 245, 0.18),
    0 2px 6px rgba(14, 167, 232, 0.10);
  transform: translateY(-0.5px);
}

.generate-main-btn:active,
.secondary-button.generate-main-btn:active,
.primary-button.generate-main-btn:active {
  color: #ffffff;
  background: linear-gradient(90deg, #1736b6 0%, #12329a 50%, #0a5d92 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 2px 4px rgba(0, 0, 0, 0.10),
    0 2px 6px rgba(23, 54, 182, 0.16);
  transform: translateY(0.5px);
}

.prompt-tools {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.reference-upload-box {
  display: grid;
  gap: 12px;
}

.reference-dropzone {
  display: grid;
  width: min(208px, 100%);
  min-height: 152px;
  place-items: center;
  gap: 6px;
  padding: 14px;
  border: 2px dashed #8bbcff;
  border-radius: 12px;
  color: #0b3a75;
  background: #f8fbff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.reference-dropzone span {
  display: block;
  text-align: center;
}

.reference-dropzone span + span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.reference-dropzone:hover,
.reference-dropzone.drag-over {
  border-color: var(--primary);
  background: #eef7ff;
  box-shadow: 0 10px 22px rgba(30, 120, 255, 0.12);
}

.reference-preview {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
}

.reference-preview img {
  width: 150px;
  height: 150px;
  border: 1px solid #dce8f5;
  border-radius: 8px;
  object-fit: cover;
  background: #f6fbff;
}

.reference-preview-info {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.reference-preview-info span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #111111;
  font-weight: 700;
}

.reference-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.reference-actions button {
  min-height: 36px;
  padding: 0 14px;
}

.optimizer-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.optimizer-title-row label {
  margin: 0 0 8px;
}

.inline-action-row .secondary-button {
  min-height: 46px;
}

.small-reject-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 14px;
}

.use-reference-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  color: var(--primary);
  font-size: 18px;
  font-weight: 700;
}

.use-reference-line input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.path-row input {
  border-radius: 8px 0 0 8px;
}

.path-row button {
  border-left: 0;
  border-radius: 0 8px 8px 0;
}

.path-hint {
  margin: 8px 0 0;
  color: #8b1e1e;
  font-size: 13px;
  line-height: 1.5;
}

.quality-warning {
  margin: 8px 0 0;
  color: #b00020;
  font-size: 15px;
  line-height: 1.55;
}

.quality-warning span {
  display: block;
}

.quality-warning strong {
  font-weight: 700;
}

.quality-note {
  margin: 6px 0 0;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.5;
}

.quality-note strong {
  font-weight: 700;
}

.primary-button {
  width: 100%;
  min-height: 52px;
  margin-top: 22px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  color: #ffffff;
  background: var(--primary);
  font-weight: 700;
  cursor: pointer;
}

.primary-button:hover {
  background: var(--primary-hover);
}

.all-history-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 112px;
  min-height: 46px;
  margin-top: 18px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 24px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  color: #ffffff;
  background: var(--primary);
  font-weight: 700;
  cursor: pointer;
}

.all-history-button:hover {
  background: var(--primary-hover);
}

.top-history-button {
  min-height: 44px;
  min-width: 104px;
  margin: 0 14px 0 0;
}

.user-menu {
  position: relative;
}

.user-menu-button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  display: grid;
  min-width: 138px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.user-menu-panel.hidden {
  display: none;
}

.user-menu-panel a,
.user-menu-panel button {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
}

.user-menu-panel a:hover,
.user-menu-panel button:hover {
  background: #f3f8ff;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.auth-panel {
  width: min(420px, 100%);
}

.auth-brand {
  margin-bottom: 18px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-switch {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.auth-switch a {
  color: var(--primary);
  font-weight: 700;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.82;
}

.generate-main-btn:disabled,
.secondary-button.generate-main-btn:disabled,
.primary-button.generate-main-btn:disabled {
  color: #ffffff;
  background: linear-gradient(90deg, #145bff 0%, #1d7cff 55%, #20c8f7 100%);
  transform: none;
  cursor: not-allowed;
  opacity: 0.82;
}

.primary-button.compact {
  width: auto;
  min-width: 180px;
  padding: 0 28px;
}

.result-panel {
  min-height: 680px;
}

.result-heading,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.result-heading h1 {
  margin-bottom: 0;
}

.compact-download-button {
  min-height: 38px;
  padding: 0 16px;
}

.preview-box {
  display: grid;
  width: min(430px, 100%);
  min-height: 430px;
  margin: 0 auto 22px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #cfdced;
  border-radius: 8px;
  color: var(--muted);
  background: #f8fbff;
}

.preview-box img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 560px;
  object-fit: contain;
  background: #ffffff;
}

.preview-image-button {
  display: grid;
  width: 100%;
  height: 100%;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.preview-image-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.result-info p {
  margin: 8px 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  grid-auto-rows: auto;
}

.history-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  cursor: pointer;
}

.history-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.history-item span {
  display: block;
  padding: 8px;
  color: #111111;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.section-head h1 {
  margin-bottom: 0;
}

.hidden {
  display: none;
}

.check-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-weight: 400;
}

.model-enabled-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.model-enabled-row .check-line {
  margin-top: 0;
}

.check-line input,
.checkbox-group input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.model-enabled-note {
  margin: 0;
  color: var(--primary);
  font-size: 16px;
  line-height: 1.35;
}

.checkbox-group {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #cfdced;
  border-radius: 8px;
  background: #ffffff;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 400;
}

.large-textarea {
  min-height: 300px;
  margin-top: 14px;
}

.table-wrap {
  width: 100%;
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  background: #f4f9ff;
}

tr:last-child td {
  border-bottom: 0;
}

.pricing-table {
  min-width: 620px;
}

.pricing-table th,
.pricing-table td {
  text-align: center;
}

.pricing-table th:first-child,
.pricing-table td:first-child {
  text-align: left;
  font-weight: 700;
}

.cost-row td {
  color: #6f42c1;
  font-weight: 700;
}

.pricing-note {
  margin: 16px 0 0;
  color: #111111;
  font-size: 14px;
  line-height: 1.7;
}

.doc-page {
  display: grid;
  margin: 0 auto;
  gap: 22px;
}

.doc-hero h1 {
  margin-bottom: 0;
  color: #0b3a75;
  font-size: 30px;
}

.doc-section h2 {
  color: #0b3a75;
  border-left: 5px solid var(--primary);
  padding-left: 12px;
}

.doc-section h3 {
  margin: 28px 0 12px;
  color: #0b3a75;
  font-size: 20px;
}

.doc-section h4 {
  margin: 18px 0 8px;
  color: #111111;
  font-size: 16px;
}

.doc-section p {
  margin: 8px 0;
  color: #111111;
  line-height: 1.75;
}

.doc-section a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.doc-table {
  min-width: 680px;
}

.doc-table th {
  color: #0b3a75;
}

.doc-config {
  margin: 12px 0 18px;
  padding: 14px 16px;
  border: 1px solid #b9d7ff;
  border-radius: 8px;
  background: #f4f9ff;
}

.doc-tip,
.doc-warning {
  margin: 14px 0;
  padding: 14px 16px;
  border-radius: 8px;
}

.doc-tip {
  border: 1px solid #d9ccff;
  background: #f6f1ff;
}

.doc-warning {
  border: 1px solid #ffd08a;
  background: #fff7df;
}

.doc-warning p {
  color: #b00020;
  font-weight: 700;
}

.doc-purple-text {
  color: #6f42c1 !important;
  font-weight: 700;
}

.doc-tip-compact {
  margin-top: 22px;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.small-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #cfdced;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.small-button.danger {
  color: var(--danger);
}

.danger-button {
  color: var(--danger);
}

.history-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.history-limit-warning {
  margin: 12px 0;
  color: #c62828;
  font-size: 20px;
  font-weight: 800;
}

.history-page-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.history-select-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  font-weight: 400;
}

.history-select-row input {
  width: 16px;
  height: 16px;
}

.history-image-button {
  width: 100%;
  padding: 0;
  border: 0;
  background: #f8fbff;
  cursor: pointer;
}

.history-image-button img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: contain;
}

.history-card-body {
  padding: 12px;
}

.history-card-body strong,
.history-card-body p {
  display: block;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.history-card-body p {
  color: var(--muted);
  font-size: 13px;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 24, 39, 0.62);
}

.image-modal.hidden {
  display: none;
}

.image-modal-content {
  position: relative;
  width: min(96vw, 1280px);
  max-height: 92vh;
  padding: 18px;
  overflow: hidden;
  border-radius: 8px;
  background: #ffffff;
}

.modal-actions {
  margin-bottom: 12px;
}

.modal-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
  max-height: calc(92vh - 82px);
  overflow: hidden;
}

.modal-image-area {
  min-width: 0;
  overflow: auto;
}

.image-modal-content img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(92vh - 128px);
  object-fit: contain;
}

.modal-info-panel {
  min-width: 0;
  max-height: calc(92vh - 92px);
  padding: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fbff;
  font-size: 13px;
}

.modal-info-panel h2 {
  margin-bottom: 14px;
  font-size: 18px;
}

.modal-info-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.modal-prompt-box {
  max-height: 260px;
  padding: 10px 12px;
  overflow-y: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
  border: 1px solid #dce8f5;
  border-radius: 8px;
  background: #ffffff;
}

.modal-info-list {
  display: grid;
  gap: 12px;
  margin: 14px 0 0;
}

.modal-info-list div {
  display: grid;
  gap: 4px;
}

.modal-info-list dt {
  color: var(--muted);
  font-weight: 700;
}

.modal-info-list dd {
  margin: 0;
  color: #111111;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.modal-reference-preview img {
  width: 96px;
  height: 96px;
  max-height: none;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.modal-reference-preview img.hidden {
  display: none;
}

.modal-reference-missing {
  color: #111111;
  font-weight: 400;
}

.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid #cfdced;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.footer-actions {
  justify-content: flex-end;
}

@media (max-width: 980px) {
  .page-shell {
    width: min(100% - 28px, 760px);
  }

  .image-modal-content {
    overflow: auto;
  }

  .modal-main {
    grid-template-columns: 1fr;
    max-height: none;
    overflow: visible;
  }

  .modal-info-panel {
    max-height: none;
  }

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

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

  .main-grid,
  .form-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 560px) {
  .brand {
    font-size: 24px;
  }

  .panel {
    padding: 20px;
  }

  .path-row {
    grid-template-columns: 1fr;
  }

  .inline-action-row {
    grid-template-columns: 1fr;
  }

  .reference-upload-box {
    grid-template-columns: 1fr;
  }

  .path-row input,
  .path-row button {
    border-radius: 8px;
    border: 1px solid #cfdced;
  }

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

/* Public user menu alignment fix */
.user-menu-panel a,
.user-menu-panel button {
  min-height: 40px;
  padding-top: 0;
  padding-bottom: 0;
  display: flex;
  align-items: center;
}

/* Login page registration CTA */
.auth-register-button {
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  border: 1px solid #f2b600;
  border-radius: 8px;
  background: #ffd84d;
  color: #533800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(242, 182, 0, 0.22);
}

.auth-register-button:hover {
  background: #ffcd24;
  color: #402b00;
}

.auth-switch {
  width: 100%;
  margin-top: 14px;
  font-size: 0;
}

.auth-switch a[href$="register.html"] {
  width: 100%;
  min-height: 58px;
  border: 1px solid #f2b600;
  border-radius: 8px;
  background: #ffd84d;
  color: #533800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(242, 182, 0, 0.22);
}

.auth-switch a[href$="register.html"]::before {
  content: "新用户注册";
  font-size: 20px;
}

.auth-switch a[href$="register.html"]:hover {
  background: #ffcd24;
  color: #402b00;
}
/* Final login register button spacing override */
.auth-card .auth-switch {
  margin: 16px 0 0 !important;
  padding: 0 !important;
}

.auth-card .auth-switch a[href$="register.html"] {
  margin: 0 !important;
}

.auth-form .auth-register-button {
  min-height: 58px;
  margin-top: 0;
  border-color: #f2b600;
  background: #ffd84d;
  color: #533800;
  font-size: 20px;
}

.auth-form .auth-register-button:hover {
  background: #ffcd24;
  color: #402b00;
}

.auth-form .status-text:empty,
.auth-form .error-text:empty {
  display: none;
}
