:root {
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #192d43;
  background: #f3f6fa;
  --navy: #172c44;
  --muted: #586d82;
  --line: #dce5ed;
  --primary: #226a63;
  --primary-hover: #1a574f;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; font-size: 14px; line-height: 1.55; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(24px, 3vw, 34px); line-height: 1.2; font-weight: 720; }
h2 { font-size: 17px; font-weight: 680; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
a { color: inherit; text-decoration: none; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 7px; color: #192d43; background: #fff; outline: none;
}
input::placeholder, textarea::placeholder { color: #65798c; }
input:focus, select:focus, textarea:focus { border-color: #4d958e; box-shadow: 0 0 0 3px #226a6319; }
button:focus-visible, a:focus-visible { outline: 3px solid #62aca4; outline-offset: 2px; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); }
textarea { resize: vertical; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 41px;
  padding: 9px 15px; border: 1px solid transparent; border-radius: 7px; font-weight: 620; white-space: nowrap;
}
.primary { background: var(--primary); color: #fff; }
.primary:hover:not(:disabled) { background: var(--primary-hover); }
.danger { background: #983f31; color: #fff; }
.danger:hover:not(:disabled) { background: #7f3025; }
.secondary { background: #fff; color: #2e4963; border-color: var(--line); }
.secondary:hover:not(:disabled), .text-button:hover:not(:disabled) { background: #edf3f7; }
.text-button { color: #365872; background: transparent; }
.full { width: 100%; }
.workspace { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; background: var(--navy); color: #fff;
  display: flex; flex-direction: column; padding: 25px 16px 20px;
}
.brand-lockup { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 710; }
.rail .brand-lockup { padding: 0 3px; white-space: nowrap; }
.brand-mark {
  background: #d5f0e9; color: #193c3a; border-radius: 8px; width: 43px; height: 40px;
  display: inline-grid; place-items: center; flex: 0 0 auto; font-size: 15px; letter-spacing: .04em;
}
.rail-nav { margin-top: 40px; display: grid; gap: 7px; }
.rail-item {
  text-align: left; border: 0; border-radius: 7px; background: transparent; color: #d0dce7;
  padding: 11px 15px; min-height: 43px;
}
.rail-item:hover, .rail-item.selected { color: #fff; background: #2a445b; }
.rail-item.selected { box-shadow: inset 3px 0 #9ce0d2; font-weight: 650; }
.rail-footer { margin-top: auto; display: grid; gap: 13px; padding: 16px 8px 0; border-top: 1px solid #ffffff20; color: #d0dce7; font-size: 12px; }
.rail-footer button { border: 0; padding: 0; background: transparent; color: #d0dce7; text-align: left; }
.rail-footer button:hover { color: #fff; }
.session-name { overflow-wrap: anywhere; }
.workspace-main { width: 100%; max-width: 1550px; margin: 0 auto; padding: 36px 32px 48px; }
.view-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.summary-grid article, .panel { background: #fff; border: 1px solid var(--line); border-radius: 11px; }
.summary-grid article { padding: 17px 19px; }
.summary-grid span { display: block; font-size: 13px; color: var(--muted); }
.summary-grid strong { display: block; margin-top: 7px; font-weight: 710; font-size: 29px; line-height: 1.1; }
.panel { min-width: 0; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.toolbar input[type=search] { width: min(100%, 260px); }
.toolbar select, .inline-label select { width: auto; max-width: 250px; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; white-space: normal; }
th, td { padding: 13px 16px; vertical-align: middle; overflow-wrap: anywhere; }
th { font-weight: 660; color: #425c72; background: #f5f8fb; white-space: nowrap; font-size: 12px; }
td { border-top: 1px solid #e8eef3; min-width: 110px; max-width: 320px; }
#forms-body td:first-child { min-width: 165px; }
#forms-body td:last-child { min-width: 150px; }
.table-scroll tbody tr:hover { background: #f9fcfd; }
.table-scroll[aria-busy=true] { opacity: .6; }
.row-title { display: block; font-weight: 650; }
.form-title-button { border: 0; padding: 0; text-align: left; background: transparent; color: #1f5c59; overflow-wrap: anywhere; }
.form-title-button:hover { text-decoration: underline; }
.row-detail { display: block; color: var(--muted); margin-top: 3px; font-size: 12px; max-width: 260px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.row-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.row-actions .button { font-size: 12px; min-height: 32px; padding: 5px 8px; }
.row-actions .delete-button { color: #963f31; }
.status { display: inline-block; padding: 3px 9px; border-radius: 5px; font-size: 12px; color: #4c6074; background: #edf2f7; white-space: nowrap; }
.status.published { color: #176054; background: #e3f3ed; }
.status.paused { color: #76521a; background: #fbefdc; }
.status.deleted { color: #864638; background: #f9ede7; }
.empty-cell { text-align: center; padding: 38px 16px; color: var(--muted); }
.notice { padding: 10px 12px; border-radius: 7px; overflow-wrap: anywhere; }
.error { background: #fff1ea; color: #8a3e26; border: 1px solid #f2d2c3; }
.panel-notice { margin: 13px 17px; }
.login-panel {
  width: min(calc(100% - 32px), 425px); margin: min(16vh, 120px) auto 40px; padding: 32px;
  border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 15px 45px #172c4410;
}
.login-panel h1 { margin: 24px 0 8px; font-size: 25px; }
.login-description { color: var(--muted); }
.login-panel .button { margin-top: 20px; }
.login-panel .notice { margin-top: 16px; }
.screen-loading { text-align: center; margin: 18vh auto; color: var(--muted); }
.editor-heading { margin-top: 10px; }
.records-heading { margin-top: 10px; }
.records-heading h1 { overflow-wrap: anywhere; }
.records-heading > div { min-width: 0; }
.editor-heading > div { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .52fr); gap: 17px; }
.editor-content { display: grid; gap: 14px; align-content: start; }
.editor-section { padding: 17px 18px; }
.editor-section h2 { margin-bottom: 13px; }
.input-label { display: grid; gap: 5px; margin: 0 0 11px; font-size: 13px; font-weight: 600; min-width: 0; }
.input-label input, .input-label select, .input-label textarea { font-weight: 400; }
.input-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field-hint { color: var(--muted); font-size: 12px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; gap: 10px; }
.section-heading h2 { margin: 0; }
.field-card { padding: 13px; border: 1px solid var(--line); background: #f9fbfd; border-radius: 8px; margin-top: 9px; }
.field-card > .input-grid { grid-template-columns: minmax(0, 1.5fr) minmax(95px, 1fr); }
.field-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.field-actions .check-label { margin-right: auto; }
.field-actions .button { padding: 5px 8px; min-height: 32px; font-size: 12px; }
.field-actions .remove-field { color: #93462e; }
.check-label { display: flex; align-items: center; gap: 6px; font-weight: 550; font-size: 13px; }
.verification-settings .input-label { margin: 12px 0 0; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.preview-pane { align-self: start; position: sticky; top: 16px; overflow: hidden; }
.preview-label { padding: 10px 14px; color: #38566d; background: #eef5f7; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 650; }
.preview-body { padding: 17px; }
.preview-body h2 { margin-bottom: 8px; color: #365f93; overflow-wrap: anywhere; }
.preview-description { color: var(--muted); margin-bottom: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.preview-field { margin-top: 13px; }
.preview-field > p { font-weight: 620; margin-bottom: 5px; overflow-wrap: anywhere; }
.preview-field input, .preview-field select, .preview-field textarea { font-size: 12px; }
.preview-choice { display: flex; align-items: center; gap: 5px; color: #486078; padding: 2px 0; font-size: 12px; overflow-wrap: anywhere; }
.preview-body .button { margin-top: 16px; }
.inline-label { display: flex; align-items: center; gap: 7px; color: #425c72; font-size: 13px; white-space: nowrap; }
.search-form { display: flex; gap: 6px; align-items: center; max-width: 100%; }
.search-form input[type=search] { flex: 1; min-width: 100px; }
.pagination { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 9px; border-top: 1px solid var(--line); padding: 12px 16px; font-size: 12px; color: var(--muted); }
.pagination-buttons { display: flex; align-items: center; gap: 8px; }
.pagination-buttons .button { font-size: 12px; min-height: 33px; padding: 6px 9px; }
dialog { width: min(calc(100% - 26px), 510px); max-height: 92vh; padding: 20px; border: 1px solid var(--line); border-radius: 12px; color: #192d43; }
dialog::backdrop { background: #1024389c; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; }
.dialog-title { color: var(--muted); margin: 3px 0 13px; overflow-wrap: anywhere; }
.delete-description { margin: 10px 0; color: #435b71; }
.delete-actions { justify-content: flex-end; margin-bottom: 0; }
.dialog-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.qr-area { display: grid; place-items: center; margin: 8px auto; min-height: 100px; color: var(--muted); }
.qr-area img { display: block; width: min(220px, 100%); height: auto; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 9px 15px; background: var(--navy); color: #fff; border-radius: 7px; max-width: calc(100% - 28px); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 1000px) {
  .workspace { grid-template-columns: 188px minmax(0, 1fr); }
  .rail { padding-inline: 12px; }
  .rail .brand-lockup { font-size: 14px; }
  .workspace-main { padding: 27px 21px 40px; }
  .editor-layout { grid-template-columns: minmax(0, 1fr); }
  .preview-pane { position: static; }
}
@media (max-width: 690px) {
  .workspace { display: block; }
  .rail { position: static; height: auto; padding: 13px 15px 10px; gap: 11px; }
  .rail-nav { margin: 0; display: flex; gap: 6px; }
  .rail-item { min-height: 36px; padding: 6px 11px; }
  .rail-footer { position: absolute; right: 16px; top: 20px; border: 0; padding: 0; }
  .rail-footer > span { display: none; }
  .workspace-main { padding: 19px 13px 32px; }
  .view-header { margin-bottom: 16px; }
  .summary-grid { gap: 7px; margin-bottom: 14px; }
  .summary-grid article { padding: 10px; }
  .summary-grid span { font-size: 11px; }
  .summary-grid strong { font-size: 23px; }
  .toolbar { padding: 11px; gap: 6px; }
  .toolbar input[type=search] { flex: 1; min-width: 120px; }
  th, td { padding: 10px 11px; }
  .editor-section { padding: 12px; }
  .search-form { flex: 1 1 100%; }
  .login-panel { padding: 24px; }
}
