:root {
  color-scheme: light;
  --paper: #f2f6f7; --white: #fff; --ink: #172b35; --muted: #506673;
  --accent: #1c625b; --accent-deep: #144940; --wash: #e6f1ee; --line: #d1dce1;
  --error: #9c3530;
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; color: var(--ink); background: var(--paper); }
button, input, textarea, select { font: inherit; }
button, select, summary { cursor: pointer; }
a { color: inherit; }
p, h1, h2, h3 { margin: 0; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #38867c; outline-offset: 3px; }
.shell { width: min(1440px, calc(100% - 80px)); margin-inline: auto; }
.topbar { min-height: 72px; border-bottom: 1px solid var(--line); background: var(--white); }
.topbar-inner { display: flex; align-items: center; gap: 20px; min-height: 72px; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 750; font-size: 16px; }
.logo svg { display: block; width: 32px; height: 32px; fill: var(--accent); color: white; }
.top-badge { margin-left: auto; color: var(--muted); font-size: .82rem; }
.identity { display: flex; margin-left: auto; align-items: center; gap: 10px; min-width: 0; font-size: .85rem; }
#account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.welcome { display: grid; grid-template-columns: 1.25fr minmax(315px, .75fr); align-items: center; column-gap: 8vw; min-height: min(650px, 78vh); max-width: 1160px; padding-block: 72px; }
.welcome-copy h1 { font-size: clamp(44px, 6vw, 83px); font-weight: 750; line-height: 1.13; letter-spacing: -.065em; }
.kicker { display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 700; color: var(--accent); margin-bottom: 20px; }
.kicker span { width: 10px; height: 10px; border: 2px solid var(--accent); border-radius: 50%; }
.lede { margin-top: 22px; max-width: 32em; color: var(--muted); line-height: 1.8; }
.welcome-steps { display: flex; flex-wrap: wrap; gap: 18px; padding: 19px 0 0; margin: 32px 0 0; list-style: none; border-top: 1px solid var(--line); font-size: .88rem; }
.welcome-steps li span { color: var(--accent); font: 700 .78rem/1.5 ui-monospace, monospace; margin-right: 4px; }
.login-card, .empty { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: clamp(22px, 3.8vw, 42px); }
.card-glyph { display: grid; place-items: center; width: 44px; height: 44px; margin-block-end: 16px; border-radius: 10px; background: var(--wash); color: var(--accent); font-size: 23px; }
.login-card h2, .empty h2 { font-size: 1.5rem; margin-bottom: 7px; }
.login-card > p, .empty > p { color: var(--muted); font-size: .91rem; }
.login-card form { margin-top: 24px; }
label { display: block; color: var(--ink); font-size: .9rem; font-weight: 650; margin-block: 14px 5px; }
small { margin-left: 5px; font-size: .75rem; font-weight: 400; color: var(--muted); }
input, textarea, select { display: block; width: 100%; border: 1px solid #acbfc7; border-radius: 7px; padding: 10px 11px; background: #fff; color: var(--ink); min-height: 44px; }
input[readonly] { background: var(--paper); color: var(--muted); }
input::placeholder, textarea::placeholder { color: #627784; }
textarea { resize: vertical; }
.primary, .secondary, .quiet, .danger { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; gap: 6px; min-height: 42px; padding: 8px 14px; border: 1px solid transparent; border-radius: 7px; font-size: .87rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.primary { background: var(--accent); color: white; }
.primary:hover { background: var(--accent-deep); }
.secondary { color: var(--ink); background: var(--white); border-color: #acbfc7; }
.secondary:hover, .quiet:hover { background: var(--wash); }
.quiet, .danger { background: transparent; color: var(--accent); }
.danger { color: var(--error); }
.danger:hover { background: #faeae7; }
button:disabled { opacity: .55; cursor: not-allowed; }
.login-button { width: 100%; margin-top: 8px; }
.error, [data-error="true"] { color: var(--error); }
.error:not(:empty) { margin-top: 6px; font-size: .87rem; }
.footer { color: var(--muted); font-size: .82rem; padding-block: 22px 27px; border-top: 1px solid var(--line); }
.studio { padding-block: 34px 48px; }
.workspace-title { display: flex; align-items: end; justify-content: space-between; gap: 14px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.workspace-title .kicker { margin-bottom: 7px; }
.workspace-title h1 { font-size: clamp(28px, 4vw, 42px); letter-spacing: -.055em; line-height: 1.2; }
.workspace-title p:last-child { color: var(--muted); margin-top: 8px; font-size: .91rem; }
.workspace { display: grid; grid-template-columns: minmax(165px, 222px) minmax(0, 1fr); align-items: start; gap: 22px; margin-top: 24px; }
.rail { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 13px; }
.rail-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 5px 7px 11px; font-size: .77rem; color: var(--muted); }
.rail-head h2 { color: var(--ink); font-size: .93rem; }
.rail button { width: 100%; text-align: left; padding: 9px 7px; border: 1px solid transparent; border-radius: 7px; background: none; color: var(--ink); overflow-wrap: anywhere; font-size: .86rem; }
.rail button[aria-current="true"] { background: var(--wash); border-color: #bdd7d2; }
.rail button:hover { background: var(--wash); }
.site-label { display: block; font-weight: 700; }
.site-state, .muted, .hint { color: var(--muted); font-size: .79rem; }
.rail .muted { padding: 8px 7px; }
.empty .primary { margin-top: 18px; }
.editor-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 14px; overflow-wrap: anywhere; }
.editor-head h2 { font-size: 1.27rem; }
.editor-head p { font-size: .83rem; color: var(--muted); margin-top: 3px; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); align-items: start; gap: 16px; }
.site-form, .preview-panel, .publish-panel { border: 1px solid var(--line); border-radius: 12px; background: white; min-width: 0; }
.site-form, .publish-panel { padding: 18px; }
fieldset { border: 0; padding: 0 0 16px; margin: 0 0 16px; min-width: 0; border-bottom: 1px solid var(--line); }
legend { font-size: 1rem; font-weight: 720; margin-bottom: 4px; padding: 0; }
legend span { color: var(--accent); font: 700 .78rem/1.5 ui-monospace, monospace; margin-right: 3px; }
.hint { margin-top: 5px; }
details { margin-top: 15px; }
summary { color: var(--accent); font-size: .88rem; font-weight: 650; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-status, .notice { font-size: .87rem; }
.form-status:not(:empty) { margin: 9px 0; }
.form-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.preset-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.preset-controls select { flex: 1 1 9rem; width: auto; min-width: 0; }
.preview-panel { position: sticky; top: 12px; padding: 12px; }
.preview-top { display: flex; justify-content: space-between; align-items: center; padding: 0 2px 10px; }
.preview-top h3 { font-size: .92rem; }
.preview-top p, .preview-status { color: var(--muted); font-size: .77rem; }
.preview-status:not(:empty) { margin-top: 8px; }
.frame-wrap { overflow: hidden; border-radius: 7px; border: 1px solid var(--line); background: var(--paper); }
iframe { display: block; border: 0; width: 100%; height: clamp(450px, 68vh, 730px); background: var(--paper); }
.publish-panel { margin-top: 18px; }
.publish-panel > p { margin-top: 5px; }
.publish-panel > p:not(.hint):not(.form-status) { color: var(--muted); font-size: .87rem; }
.dns-record { margin-block: 13px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-size: .88rem; overflow-wrap: anywhere; }
.dns-label { font-weight: 720; }
.dns-record dl { margin: 6px 0; }
.dns-record dl div { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 7px; padding-block: 2px; }
.dns-record dd { margin: 0; }
.dns-record dt { color: var(--muted); }
code { font-family: ui-monospace, Menlo, monospace; background: var(--paper); padding: 1px 4px; border-radius: 3px; }
.host-record, #routing-records { margin: 5px 0; }
#routing-records { padding-left: 1.25rem; }
.publish-panel > .form-buttons { margin-top: 14px; }
.notice { margin: 12px 0; padding: 10px 14px; border-left: 3px solid var(--accent); background: white; }
.notice[data-error="true"] { border-color: var(--error); }
dialog { width: min(1180px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); padding: 10px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); }
dialog::backdrop { background: #142635b0; }
.dialog-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin: 0 0 8px; }
.dialog-head h2 { font-size: 1rem; margin-left: 6px; }
dialog iframe { height: min(78vh, calc(100dvh - 85px)); }
@media (max-width: 1100px) {
  .shell { width: calc(100% - 40px); }
  .editor-layout { grid-template-columns: minmax(0, 1fr); }
  .preview-panel { position: static; }
}
@media (max-width: 740px) {
  .shell { width: calc(100% - 28px); }
  .topbar, .topbar-inner { min-height: 58px; }
  .logo { gap: 6px; font-size: .9rem; }
  .logo svg { width: 26px; height: 26px; }
  .topbar-inner { gap: 8px; }
  .welcome { grid-template-columns: minmax(0, 1fr); gap: 26px; padding-block: 38px; }
  .welcome-copy h1 { font-size: clamp(36px, 9vw, 58px); }
  .welcome-steps { margin-top: 20px; gap: 13px; }
  .studio { padding-block: 20px 34px; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 15px; margin-top: 17px; }
  .rail { padding: 8px; }
  #site-list { display: flex; flex-wrap: wrap; gap: 5px; }
  .rail button { width: auto; max-width: 100%; }
  .workspace-title { align-items: start; padding-bottom: 16px; }
  .workspace-title .primary { min-height: 40px; padding: 6px 8px; font-size: .78rem; }
  .editor-head { flex-wrap: wrap; }
  .site-form, .publish-panel { padding: 14px; }
}
@media (max-width: 370px) {
  .field-pair { grid-template-columns: 1fr; gap: 0; }
}
