:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #667085;
  --line: #d9dee8;
  --paper: #ffffff;
  --panel: #f6f7f9;
  --accent: #0b4a8f;
  --accent-strong: #07346b;
  --accent-soft: rgba(11, 74, 143, 0.12);
  --school-red: #b2212b;
  --shadow: 0 18px 46px rgba(23, 32, 51, 0.13);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  min-width: 1280px;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(11, 74, 143, 0.08), transparent 36%),
    linear-gradient(180deg, #f4f7fb 0%, #e8edf5 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.admin-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 82px;
  padding: 0 22px;
  color: #fff;
  background: linear-gradient(120deg, #08366b, #0b4a8f 58%, #183a64);
  border-radius: 0;
  box-shadow: var(--shadow);
}

.brand-lockup {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 14px;
}

.brand-logo {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  object-fit: cover;
  background: #fff;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(2, 20, 46, 0.22);
}

.eyebrow {
  margin: 0 0 4px;
  color: rgba(230, 240, 255, 0.86);
  font-size: 12px;
  text-transform: uppercase;
}

.topbar h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0;
}

.admin-account {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-account span {
  max-width: 160px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-ghost,
.header-primary {
  height: 34px;
  padding: 0 12px;
  border-radius: 6px;
}

.header-ghost {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.header-primary {
  color: #0b4a8f;
  background: #ffffff;
}

.base-url-field {
  display: grid;
  grid-template-columns: auto 330px;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
}

.base-url-field input,
.form-grid input,
.form-grid select,
#pageUrlInput {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.base-url-field input {
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.base-url-field input:focus,
.form-grid input:focus,
.form-grid select:focus,
#pageUrlInput:focus,
.rich-editor:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.workspace {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  height: auto;
  margin-top: 0;
  overflow: hidden;
}

.content-stage,
.dashboard-view,
.manage-view,
.manage-list-view,
.manage-detail-view,
.category-view {
  min-height: 0;
}

.manage-view,
.category-view {
  height: 100%;
}

.manage-list-view,
.category-view {
  height: 100%;
  overflow: auto;
  padding: 14px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(217, 222, 232, 0.9);
  border-radius: 0;
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.08);
}

.manage-detail-view {
  display: grid;
  grid-template-columns: minmax(610px, 1fr) 440px;
  gap: 14px;
  height: 100%;
}

[hidden] {
  display: none !important;
}

.content-stage {
  height: 100%;
}

.nav-sidebar,
.sidebar,
.editor-pane,
.preview-pane,
.dashboard-view {
  min-height: 0;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(217, 222, 232, 0.9);
  border-radius: 0;
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.08);
}

.sidebar,
.editor-pane {
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
}

.nav-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 14px;
  border-left: 0;
  border-top: 0;
  border-bottom: 0;
}

.nav-item,
.nav-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 42px;
  padding: 0 14px;
  color: #344054;
  text-align: left;
  background: transparent;
  border-radius: 6px;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.nav-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item.active,
.nav-item:hover {
  color: #fff;
  background: var(--accent);
}

.nav-logout {
  margin-top: auto;
  color: var(--school-red);
  background: #fff;
  border: 1px solid var(--line);
}

.dashboard-view {
  overflow: auto;
  height: 100%;
  padding: 14px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  min-height: 104px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong {
  display: block;
  margin-top: 14px;
  overflow: hidden;
  font-size: 22px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-table-wrap {
  margin-top: 18px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.dashboard-table {
  width: 100%;
  margin-top: 14px;
  border-collapse: collapse;
}

.dashboard-table th,
.dashboard-table td {
  padding: 13px 10px;
  border-bottom: 1px solid #edf0f5;
  text-align: left;
}

.dashboard-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.dashboard-table td {
  font-size: 14px;
}

.dashboard-table button {
  height: 32px;
  padding: 0 12px;
  color: #fff;
  background: var(--accent);
  border-radius: 6px;
}

.list-filter-bar {
  display: grid;
  grid-template-columns: 200px minmax(240px, 1fr) 120px;
  gap: 12px;
  margin: 12px 0;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.list-filter-bar label span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.list-filter-bar input,
.list-filter-bar select {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}

.manage-table {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  border-spacing: 0;
  overflow: hidden;
}

.manage-table th,
.manage-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf0f5;
  text-align: left;
}

.manage-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.manage-table td {
  font-size: 14px;
}

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

.manage-table .row-title {
  max-width: 360px;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-table .row-title {
  max-width: 420px;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manage-table button {
  height: 32px;
  padding: 0 12px;
  color: #fff;
  background: var(--accent);
  border-radius: 6px;
}

.manage-table .table-actions {
  justify-content: flex-start;
}

.manage-table .danger-link {
  color: #a11f25;
  background: #fff;
  border: 1px solid #ead1d3;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
}

.pagination span {
  color: var(--muted);
  font-size: 13px;
}

.category-toolbar {
  display: grid;
  grid-template-columns: minmax(320px, 520px) auto;
  align-items: end;
  gap: 12px;
  margin: 16px 0;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.category-toolbar label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.category-toolbar input {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}

.category-toolbar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.category-table {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  border-spacing: 0;
  overflow: hidden;
}

.category-table th,
.category-table td {
  padding: 13px 12px;
  border-bottom: 1px solid #edf0f5;
  text-align: left;
}

.category-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.category-table td {
  font-size: 14px;
}

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

.table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.table-actions button {
  height: 32px;
  padding: 0 12px;
  color: #fff;
  background: var(--accent);
  border-radius: 6px;
}

.table-actions .danger-link {
  color: #a11f25;
  background: #fff;
  border: 1px solid #ead1d3;
}

.table-actions button:disabled {
  cursor: not-allowed;
  color: #98a2b3;
  background: #f2f4f7;
  border: 1px solid #e4e7ec;
}

.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.compact-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
}

.compact-form-grid label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.compact-form-grid input,
.compact-form-grid select {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  background: #fff;
}

.compact-form-grid input:focus,
.compact-form-grid select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.compact-publish {
  align-self: end;
  height: 38px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.external-link-field {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.external-link-field span {
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.external-link-field input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}

.external-link-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 74, 143, 0.12);
}

.compact-choice-row {
  display: grid;
  grid-template-columns: 1fr;
  margin-top: 8px;
}

.compact-choice-row > div {
  display: grid;
  grid-template-columns: auto minmax(136px, 168px) auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 6px 10px;
  background:
    linear-gradient(90deg, rgba(11, 74, 143, 0.06), rgba(201, 162, 79, 0.06)),
    #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.compact-choice-row .template-choice-panel {
  justify-content: start;
}

.choice-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 48px;
  color: #263248;
  font-size: 13px;
  line-height: 1.1;
  white-space: nowrap;
}

.choice-label::before {
  width: 18px;
  height: 18px;
  content: "";
  background: currentColor;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: 14px 14px;
}

.template-label {
  color: #0b63ce;
}

.template-label::before {
  background: linear-gradient(135deg, #0b63ce, #5bc0ff);
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M3 12.5 21 4l-6.3 16-3.4-6.2-6.5 3.6 3-5.8z'/%3E%3C/svg%3E");
}

.qr-label {
  min-width: 72px;
  color: #76533b;
}

.qr-label::before {
  background: linear-gradient(135deg, #76533b, #c6a04f);
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M4 4h7v7H4zm2 2v3h3V6zm7-2h7v7h-7zm2 2v3h3V6zM4 13h7v7H4zm2 2v3h3v-3zm9-2h2v2h-2zm3 0h2v2h-2zm-5 3h2v4h-2zm4 2h3v2h-3zm1-3h2v2h-2z'/%3E%3C/svg%3E");
}

.choice-select {
  width: 100%;
  height: 30px;
  min-width: 0;
  padding: 0 24px 0 9px;
  color: #1f2a44;
  font-size: 13px;
  font-weight: 700;
  background:
    linear-gradient(90deg, rgba(11, 99, 206, 0.1), transparent 34%),
    #fff;
  border: 1px solid #cfd7e6;
  border-radius: 6px;
  outline: none;
}

.qr-choice-select {
  background:
    linear-gradient(90deg, rgba(198, 160, 79, 0.16), transparent 34%),
    #fff;
}

.choice-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.custom-bg-control {
  display: inline-grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  justify-content: start;
  gap: 6px;
  width: max-content;
  min-width: max-content;
  padding-inline: 2px;
}

.custom-bg-control[hidden] {
  display: none;
}

.custom-bg-preview {
  width: 34px;
  height: 30px;
  background:
    linear-gradient(135deg, rgba(11, 74, 143, 0.18), rgba(178, 33, 43, 0.12)),
    #eef3f8;
  background-position: center;
  background-size: cover;
  border: 1px solid rgba(23, 32, 51, 0.1);
  border-radius: 5px;
}

.icon-text-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  min-width: 30px;
  padding-inline: 9px;
}

.icon-text-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

#chooseBackgroundBtn {
  color: #fff;
  background: linear-gradient(135deg, #0b63ce, #0b8ee8);
  border-color: rgba(11, 99, 206, 0.28);
}

#chooseBackgroundBtn:hover {
  background: linear-gradient(135deg, #084fba, #087ee8);
}

#clearBackgroundBtn {
  color: #a11f25;
  background: #fff7f7;
  border-color: #ead1d3;
}

.custom-bg-control.has-image .icon-text-btn {
  width: 30px;
  padding-inline: 0;
  justify-content: center;
}

.custom-bg-control.has-image .icon-text-btn span {
  display: none;
}

.detail-editor-block {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 300px);
}

.detail-editor-block .rich-editor {
  flex: 1;
  min-height: 460px;
}

.sidebar-head,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-head {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.page-list {
  overflow: auto;
  padding: 8px;
}

.page-item {
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 76px;
  margin-bottom: 8px;
  padding: 12px;
  text-align: left;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
}

.page-item:hover {
  background: #f5f7fb;
}

.page-item.active {
  background: #fff;
  border-color: #cfd7e5;
  box-shadow: 0 8px 20px rgba(23, 32, 51, 0.08);
}

.page-item strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-item span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-pane {
  overflow: auto;
  padding: 18px;
}

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

.form-grid label,
.base-url-field {
  font-size: 13px;
}

.form-grid label span,
.base-url-field span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
}

.template-block,
.editor-block {
  margin-top: 10px;
}

.template-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.template-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.template-option.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.choice-icon {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: var(--accent);
}

.choice-icon svg,
.tool-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.choice-swatches {
  display: flex;
  gap: 2px;
}

.choice-swatches i {
  width: 6px;
  height: 18px;
  border: 1px solid rgba(23, 32, 51, 0.14);
  border-radius: 999px;
}

.publish-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.publish-switch input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.qr-style-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.qr-style-option {
  display: inline-grid;
  min-height: 54px;
  padding: 10px;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.qr-style-option.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.qr-style-sample {
  display: grid;
  grid-template-columns: repeat(3, 5px);
  grid-auto-rows: 5px;
  gap: 3px;
}

.qr-style-sample i {
  width: 5px;
  height: 5px;
  background: #111;
}

.qr-style-option[data-style="black-rounded"] .qr-style-sample i {
  border-radius: 3px;
}

.qr-style-option[data-style="bronze-dot"] .qr-style-sample i {
  background: #76533b;
  border-radius: 999px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
  padding: 9px;
  background: #f3f5f8;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
}

.toolbar .tool-btn {
  display: inline-grid;
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  background: #fff;
  border: 1px solid #d2d8e3;
  border-radius: 6px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.toolbar .tool-btn:hover {
  border-color: currentColor;
  box-shadow: 0 6px 14px rgba(23, 32, 51, 0.1);
  transform: translateY(-1px);
}

.tool-blue {
  color: #1f5f99;
}

.tool-gold {
  color: #9a6b12;
}

.tool-slate {
  color: #334155;
}

.tool-green {
  color: #2f6f55;
}

.tool-bronze {
  color: #0b4a8f;
}

.tool-jade {
  color: #24716b;
}

.tool-red {
  color: #a11f25;
}

.rich-editor {
  min-height: 330px;
  padding: 20px;
  overflow: auto;
  line-height: 1.85;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  outline: none;
}

.rich-editor:empty::before {
  content: "输入正文";
  color: #98a2b3;
}

.rich-editor h1,
.rich-editor h2,
.rich-editor h3,
.rich-editor h4 {
  margin: 1.1em 0 0.55em;
  line-height: 1.35;
  letter-spacing: 0;
}

.rich-editor h2 {
  font-size: 20px;
}

.rich-editor h3 {
  font-size: 17px;
}

.rich-editor p {
  margin: 0 0 0.85em;
}

.rich-editor blockquote {
  margin: 1em 0;
  padding: 10px 12px;
  background: #eef5ff;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
}

.rich-editor ul,
.rich-editor ol {
  margin: 0 0 0.85em;
  padding-left: 1.35em;
}

.rich-editor hr {
  height: 1px;
  margin: 18px 0;
  background: #d9dee8;
  border: 0;
}

.rich-editor img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 6px;
}

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

.primary,
.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  height: 38px;
  padding: 0 14px;
  border-radius: 6px;
}

.primary {
  color: #fff;
  background: var(--accent);
}

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

.ghost {
  color: #263248;
  background: #fff;
  border: 1px solid var(--line);
}

.ghost:hover {
  background: #f5f7fb;
}

.danger {
  color: #a11f25;
}

.small {
  min-width: 60px;
  height: 34px;
}

.hidden-file {
  display: none;
}

.preview-pane {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  overflow: hidden;
  padding: 14px;
}

.preview-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  flex: 0 0 auto;
  padding: 4px;
  background: #edf0f5;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.preview-tab {
  height: 34px;
  color: #344054;
  background: transparent;
  border-radius: 6px;
}

.preview-tab.active {
  color: #fff;
  background: var(--accent);
}

.preview-phone-stage,
.preview-qr-stage {
  flex: 1 1 auto;
  min-height: 0;
}

.preview-phone-stage {
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
  container-type: size;
}

.preview-qr-stage {
  display: none;
  align-items: center;
  justify-content: center;
}

.preview-pane[data-preview-mode="qr"] .preview-phone-stage {
  display: none;
}

.preview-pane[data-preview-mode="qr"] .preview-qr-stage {
  display: flex;
}

.phone-frame {
  flex: 0 0 auto;
  width: auto;
  height: 100%;
  aspect-ratio: 396 / 857;
  max-width: 100%;
  padding: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #111827;
  border-radius: 28px;
  box-shadow: 0 16px 30px rgba(17, 24, 39, 0.2);
}

@supports (width: 100cqw) {
  .phone-frame {
    width: min(100cqw, calc(100cqh * 396 / 857));
    height: min(100cqh, calc(100cqw * 857 / 396));
  }
}

.phone-status {
  flex: 0 0 auto;
  width: 70px;
  height: 5px;
  margin: 0 auto 8px;
  background: #303849;
  border-radius: 999px;
}

.phone-screen {
  width: 100%;
  height: auto;
  min-height: 0;
  flex: 1;
  overflow: auto;
  background: #fff;
  border-radius: 18px;
}

.preview-pane,
.preview-phone-stage,
.phone-screen,
.preview-qr-stage {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.preview-pane::-webkit-scrollbar,
.preview-phone-stage::-webkit-scrollbar,
.phone-screen::-webkit-scrollbar,
.preview-qr-stage::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.phone-screen .mobile-page {
  min-height: 100%;
}

.qr-panel {
  width: min(100%, 380px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.qr-panel .section-title {
  min-width: 0;
}

.qr-template-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background:
    linear-gradient(90deg, rgba(198, 160, 79, 0.12), rgba(11, 74, 143, 0.05)),
    #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.qr-template-field .choice-select {
  height: 32px;
}

#qrCanvas {
  display: block;
  align-self: center;
  width: 260px !important;
  height: 260px !important;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.qr-note {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

#pageUrlInput {
  min-width: 0;
  height: 38px;
  margin-bottom: 0;
  color: #344054;
  background: #f8fafc;
}

.qr-actions {
  justify-content: stretch;
}

.qr-actions button {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
}

.toast {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 20;
  min-width: 180px;
  max-width: 360px;
  padding: 12px 14px;
  color: #fff;
  background: rgba(23, 32, 51, 0.94);
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 32, 51, 0.36);
}

.password-modal {
  width: min(420px, 100%);
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.background-crop-modal {
  width: min(820px, 100%);
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.background-crop-modal canvas {
  display: block;
  width: 100%;
  max-height: min(58vh, 520px);
  margin-top: 14px;
  background: #111827;
  border-radius: 6px;
  cursor: grab;
  touch-action: none;
}

.background-crop-modal canvas.is-dragging {
  cursor: grabbing;
}

.crop-zoom-field {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.crop-zoom-field input {
  width: 100%;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.password-form {
  display: grid;
  gap: 13px;
  margin-top: 16px;
}

.password-form label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.password-form input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}

.password-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.password-form .primary {
  width: 100%;
  margin-top: 4px;
}

.login-body {
  min-width: 0;
  background:
    linear-gradient(135deg, rgba(11, 74, 143, 0.16), transparent 42%),
    linear-gradient(180deg, #f4f7fb, #e7edf6);
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(460px, 100%);
  padding: 30px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(11, 74, 143, 0.16);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.login-brand img {
  width: 68px;
  height: 68px;
  flex: 0 0 auto;
  object-fit: cover;
  background: #fff;
  border: 2px solid rgba(11, 74, 143, 0.16);
  border-radius: 50%;
  box-shadow: 0 10px 22px rgba(8, 54, 107, 0.14);
}

.login-brand .eyebrow {
  color: #0b4a8f;
}

.login-panel h1 {
  margin: 0;
  color: #08366b;
  font-size: 22px;
  line-height: 1.35;
}

.login-subtitle {
  margin: 0 0 22px;
  padding: 10px 12px;
  color: #344054;
  font-size: 13px;
  background: #f4f7fb;
  border-left: 3px solid #b2212b;
  border-radius: 6px;
}

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

.login-form label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
}

.login-form input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}

.login-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 74, 143, 0.12);
}

.login-form .primary {
  width: 100%;
  margin-top: 4px;
  background: #0b4a8f;
}

.login-form .primary:hover {
  background: #07346b;
}

.login-toast {
  min-height: 22px;
  margin-top: 14px;
  color: #b2212b;
  font-size: 13px;
}
