:root {
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #f3f5f7;
  color: #18212b;
  --ink: #18212b;
  --muted: #687381;
  --line: #dce2e8;
  --surface: #ffffff;
  --blue: #1463d6;
  --blue-dark: #0f4fac;
  --danger: #c53b3b;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 64px; }
.login-panel { width: min(460px, 100%); margin: 12vh auto 0; padding: 32px; }
.login-panel h1 { margin-bottom: 8px; font-size: 32px; }
.login-form .button { margin-top: 20px; }
.topbar-actions { display: flex; gap: 10px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 10px; color: var(--blue); font-size: 12px; font-weight: 700; letter-spacing: .12em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(30px, 5vw, 44px); letter-spacing: -.04em; }
h2 { margin-bottom: 8px; font-size: 20px; }
.subtitle, .hint { color: var(--muted); font-size: 14px; line-height: 1.6; }
.workspace { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; }
.panel { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 8px 24px rgba(24, 33, 43, .05); }
.upload-panel { padding: 24px; align-self: start; }
.objects-panel { min-width: 0; padding: 24px; }
.security-panel { display: grid; grid-template-columns: 1fr minmax(300px, 1.4fr); gap: 24px; margin-bottom: 20px; padding: 20px 24px; }
.config-panel { margin-bottom: 20px; padding: 24px; }
.config-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
.config-form .button { grid-column: 1 / -1; max-width: 280px; }
.token-fields, .config-upload { min-width: 0; }
.config-upload h3 { margin: 0 0 8px; font-size: 16px; }
.config-upload .button { margin-top: 10px; }
.field-label { display: block; margin: 20px 0 8px; font-size: 13px; font-weight: 700; }
.field-label span { color: var(--muted); font-weight: 400; }
input[type="text"], input[type="password"], input[type="file"] { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); font: inherit; font-size: 14px; }
input:focus { outline: 3px solid #cfe0fb; border-color: var(--blue); }
.button { min-height: 42px; padding: 0 16px; border: 1px solid transparent; border-radius: 7px; cursor: pointer; font: inherit; font-size: 14px; font-weight: 700; }
.button.primary { width: 100%; margin-top: 22px; background: var(--blue); color: white; }
.button.primary:hover { background: var(--blue-dark); }
.button.secondary { border-color: var(--line); background: white; color: var(--ink); }
.button.secondary:hover { border-color: var(--blue); color: var(--blue); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading .hint { margin-bottom: 0; }
.prefix-input { max-width: 220px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { color: var(--muted); font-size: 12px; font-weight: 700; text-align: left; }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td:first-child { max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.actions { display: flex; gap: 8px; }
.text-button { padding: 4px 0; border: 0; background: transparent; color: var(--blue); cursor: pointer; font: inherit; font-size: 13px; }
.text-button.danger { color: var(--danger); }
.message { min-height: 22px; margin: 12px 0; color: var(--muted); font-size: 13px; }
.message.success { color: #287649; }
.message.error { color: var(--danger); }
.empty-state { padding: 42px 16px; color: var(--muted); text-align: center; }
.preview-modal[hidden] { display: none; }
.preview-modal { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 24px; }
.preview-backdrop { position: absolute; inset: 0; background: rgba(24, 33, 43, .58); }
.preview-dialog { position: relative; z-index: 1; display: flex; width: min(900px, 100%); max-height: min(88vh, 760px); flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 20px 50px rgba(24, 33, 43, .25); }
.preview-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.preview-header h2 { max-width: calc(100% - 44px); margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.close-button { width: 32px; height: 32px; border: 0; border-radius: 6px; background: #eef1f4; color: var(--ink); cursor: pointer; font-size: 24px; line-height: 1; }
.preview-content { display: grid; min-height: 240px; place-items: center; overflow: auto; padding: 24px; background: #f3f5f7; }
.preview-content img { display: block; max-width: 100%; max-height: calc(min(88vh, 760px) - 100px); object-fit: contain; }
@media (max-width: 760px) {
  .shell { width: min(100% - 24px, 600px); padding-top: 24px; }
  .topbar, .section-heading { align-items: stretch; flex-direction: column; }
  .topbar-actions { flex-wrap: wrap; }
  .workspace { grid-template-columns: 1fr; }
  .security-panel { grid-template-columns: 1fr; }
  .config-form { grid-template-columns: 1fr; }
  .config-form .button { grid-column: auto; max-width: none; }
  .prefix-input { max-width: none; }
}
