:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  font-synthesis: none;
  --ink: #17202a;
  --muted: #66717f;
  --line: #dfe4e8;
  --soft: #f6f8f9;
  --brand: #0d8b63;
  --brand-dark: #096a4c;
  --accent: #d96042;
  --danger: #bd3d3d;
  --white: #ffffff;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 1080px; background: var(--white); color: var(--ink); }
button, input, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-header {
  height: 68px;
  padding: 0 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}

.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand img { width: 38px; height: 38px; object-fit: cover; border-radius: 6px; }
.brand span { display: grid; gap: 1px; }
.brand strong { font-size: 16px; line-height: 1.2; }
.brand small { color: var(--muted); font-size: 12px; }
.service-state { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.service-state span { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px #dff3eb; }
.service-state.offline span { background: var(--danger); box-shadow: 0 0 0 4px #f8dfdf; }

main { width: 1180px; margin: 0 auto; padding: 38px 0 56px; }
.eyebrow { margin: 0 0 8px; color: var(--brand); font-size: 11px; font-weight: 700; text-transform: uppercase; }
h1, h2, p { letter-spacing: 0; }
h1 { margin: 0; font-size: 25px; line-height: 1.35; }
h2 { margin: 0; font-size: 18px; line-height: 1.4; }
p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }

.key-band {
  min-height: 150px;
  display: grid;
  grid-template-columns: 1fr 520px;
  gap: 64px;
  align-items: center;
  padding: 24px 0 30px;
  border-bottom: 1px solid var(--line);
}
.key-band h1 + p { margin-top: 10px; }
.key-form { display: grid; gap: 8px; }
.key-form label, .field label { font-size: 13px; font-weight: 700; }
.key-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
input, select {
  width: 100%; height: 42px; padding: 0 12px;
  border: 1px solid #cbd3d9; border-radius: 6px; outline: none;
  background: var(--white); color: var(--ink);
}
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px #dff3eb; }
select:disabled { color: #8c96a0; background: #f4f6f7; }

.button {
  height: 42px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #cbd3d9; border-radius: 6px; background: var(--white); color: var(--ink);
  font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.button:hover { border-color: #9ca7af; background: #fafbfb; }
.button.primary { border-color: var(--brand); background: var(--brand); color: var(--white); }
.button.primary:hover { border-color: var(--brand-dark); background: var(--brand-dark); }
.button.download { margin-top: 22px; border-color: var(--ink); background: var(--ink); color: var(--white); }
.button:disabled { cursor: not-allowed; opacity: 0.5; }
.button.loading { pointer-events: none; opacity: 0.7; }

.workspace {
  position: relative;
  min-height: 450px;
  display: grid;
  grid-template-columns: 330px 1fr;
  border-bottom: 1px solid var(--line);
}
.platform-panel { padding: 36px 30px 42px 0; border-right: 1px solid var(--line); }
.editor-panel { padding: 36px 0 42px 44px; }
.section-heading { margin-bottom: 20px; }
.platform-list { display: grid; gap: 8px; }
.platform-button {
  width: 100%; min-height: 65px; padding: 12px 14px;
  display: grid; gap: 4px; text-align: left;
  border: 1px solid transparent; border-radius: 6px; background: transparent; cursor: pointer;
}
.platform-button:hover { background: var(--soft); }
.platform-button.selected { border-color: #b8ddcf; background: #edf8f4; }
.platform-button.current::after {
  content: "当前"; grid-column: 2; grid-row: 1 / span 2; align-self: center; justify-self: end;
  color: var(--brand); font-size: 11px; font-weight: 700;
}
.platform-button strong { font-size: 14px; }
.platform-button small { color: var(--muted); font-size: 11px; }

.editor-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 36px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.editor-heading h2 + p { margin-top: 8px; }
.current-config { min-width: 230px; padding: 11px 14px; display: grid; gap: 4px; border-left: 3px solid var(--brand); background: var(--soft); }
.current-config span { color: var(--muted); font-size: 11px; }
.current-config strong { font-size: 13px; overflow-wrap: anywhere; }
.config-form { width: 600px; display: grid; gap: 24px; padding-top: 30px; }
.field { display: grid; gap: 9px; }
.field-label-row { display: flex; justify-content: space-between; align-items: center; }
.readonly-value { height: 42px; padding: 0 12px; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); font-size: 13px; }
.field-status { min-height: 22px; font-size: 12px; }
.field-status.success { color: var(--brand); }
.field-status.error { color: var(--danger); }
.text-button { padding: 0; border: 0; background: transparent; color: var(--brand); font-size: 12px; cursor: pointer; }
.editor-actions { padding-top: 3px; display: flex; justify-content: flex-end; }
.workspace-lock { position: absolute; inset: 0; display: grid; place-content: center; gap: 6px; text-align: center; background: rgba(255,255,255,0.93); }
.workspace-lock span { color: var(--muted); font-size: 13px; }
.workspace.connected .workspace-lock { display: none; }

.install-band { display: grid; grid-template-columns: 380px 1fr; gap: 90px; padding: 42px 0 0; }
.install-intro h2 + p { margin-top: 10px; }
.install-steps { margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 22px 34px; list-style: none; }
.install-steps li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; }
.install-steps li > span { width: 30px; height: 30px; display: grid; place-content: center; border: 1px solid #b8ddcf; border-radius: 50%; color: var(--brand); font-size: 12px; font-weight: 700; }
.install-steps strong { display: block; margin: 1px 0 4px; font-size: 13px; }
.install-steps p { font-size: 12px; }

.toast {
  position: fixed; right: 28px; bottom: 28px; z-index: 20;
  max-width: 380px; padding: 12px 16px; border-radius: 6px;
  background: var(--ink); color: var(--white); font-size: 13px;
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--danger); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
