:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-soft: #f8f9fa;
  --ink: #151a1e;
  --muted: #6c747c;
  --line: #e1e5e8;
  --line-strong: #cfd5d9;
  --nav: #11181c;
  --nav-soft: #202a2f;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eaf1ff;
  --tee: #1479b8;
  --tee-soft: #e7f4fc;
  --custom: #7b4bb7;
  --custom-soft: #f2eafb;
  --green: #16835c;
  --green-soft: #e8f7f1;
  --amber: #b66b11;
  --amber-soft: #fff4df;
  --red: #c3423f;
  --red-soft: #fff0ef;
  --shadow: 0 16px 46px rgba(25, 34, 40, 0.07);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.ai-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(480px, 1.28fr);
  gap: 22px;
  align-items: start;
}

.ai-settings-panel,
.ai-migration-panel {
  padding: 30px;
}

.ai-settings-panel .section-heading,
.ai-migration-panel .section-heading {
  margin-bottom: 24px;
}

.ai-boundary {
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px solid #dbe4ef;
  border-radius: 12px;
  background: #f7f9fc;
  color: #526174;
  font-size: 13px;
  line-height: 1.7;
}

.ai-result {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid #dce3ec;
  border-radius: 14px;
  background: #f8fafc;
}

.ai-result h3,
.ai-repair-result h3 {
  margin: 14px 0 8px;
}

.ai-result p,
.ai-repair-result p {
  line-height: 1.75;
}

.ai-result-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  color: #59697c;
  font-size: 13px;
}

.ai-warning-list,
.ai-action-list {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding-left: 20px;
  color: #5f6672;
}

.ai-action-list li span {
  display: block;
  margin-top: 3px;
  color: #68788b;
}

.ai-confirm {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid #bfd4ff;
  border-radius: 12px;
  background: #f4f7ff;
  line-height: 1.6;
}

.ai-confirm input {
  margin-top: 4px;
}

.ai-execute-row {
  justify-content: flex-end;
  margin-top: 16px;
}

.ai-next-step {
  display: grid;
  gap: 5px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid #d7dee8;
  border-radius: 12px;
  background: #f7f9fc;
}

.ai-next-step.ready {
  border-color: #b9e3d1;
  background: #edf9f3;
  color: #087a52;
}

.ai-next-step.blocked {
  border-color: #f2cac6;
  background: #fff4f2;
  color: #b33128;
}

.ai-next-step span {
  color: inherit;
  opacity: 0.82;
}

.button.ai-button {
  border: 1px solid #b9c9ff;
  background: #eef3ff;
  color: #2457c5;
}

.button.ai-button:hover {
  border-color: #7d9eff;
  background: #e5edff;
}

.ai-repair-dialog {
  width: min(680px, calc(100vw - 48px));
}

.ai-repair-result {
  padding: 8px 2px 12px;
}

@media (max-width: 1180px) {
  .ai-layout {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 75% -10%, rgba(86, 116, 190, 0.09), transparent 30rem),
    var(--bg);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  letter-spacing: -0.03em;
}

h1 {
  margin-bottom: 0;
  font-size: 31px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 8px;
  font-size: 22px;
}

h3 {
  margin-bottom: 6px;
  font-size: 16px;
}

.muted {
  color: var(--muted);
  line-height: 1.65;
}

.kicker {
  margin-bottom: 7px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.kicker.light {
  color: #9cb9ff;
}

.button {
  min-height: 39px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.button.primary {
  background: var(--blue);
  color: white;
  box-shadow: 0 9px 20px rgba(37, 99, 235, 0.18);
}

.button.primary:hover:not(:disabled) {
  background: var(--blue-dark);
}

.button.secondary {
  border-color: #b9c9f4;
  background: var(--blue-soft);
  color: #2451a6;
}

.button.ghost {
  border-color: var(--line);
  background: #fff;
  color: #394249;
}

.button.danger {
  border-color: #efc8c6;
  background: var(--red-soft);
  color: var(--red);
}

.button.tee-button {
  background: var(--tee);
  color: white;
}

.button.custom-button {
  background: var(--custom);
  color: white;
}

.button.large {
  min-height: 48px;
  width: 100%;
  border-radius: 12px;
  font-size: 14px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

label {
  display: grid;
  gap: 8px;
  color: #414a50;
  font-size: 12px;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

textarea {
  resize: vertical;
  line-height: 1.65;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #7ca0fb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-stack {
  display: grid;
  gap: 15px;
}

.remember-option {
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  cursor: pointer;
}

.remember-option input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--blue);
}

.remember-option strong,
.remember-option small {
  display: block;
}

.remember-option strong {
  color: var(--ink);
  font-size: 12px;
}

.remember-option small,
.platform-remember-hint {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.5;
}

.platform-remember-hint {
  text-align: center;
}

.form-error {
  min-height: 18px;
  margin: 0;
  color: var(--red);
  font-size: 12px;
  line-height: 1.5;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(520px, 1.05fr) minmax(460px, 0.95fr);
}

.login-visual {
  position: relative;
  overflow: hidden;
  padding: clamp(52px, 7vw, 100px);
  display: flex;
  flex-direction: column;
  color: white;
  background:
    linear-gradient(145deg, rgba(10, 21, 31, 0.96), rgba(18, 39, 54, 0.94)),
    #111b23;
}

.login-visual::before,
.login-visual::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.login-visual::before {
  width: 560px;
  height: 560px;
  right: -210px;
  top: -160px;
  border: 1px solid rgba(156, 185, 255, 0.15);
  box-shadow:
    0 0 0 65px rgba(156, 185, 255, 0.025),
    0 0 0 130px rgba(156, 185, 255, 0.018);
}

.login-visual::after {
  width: 240px;
  height: 240px;
  left: -100px;
  bottom: -80px;
  background: rgba(37, 99, 235, 0.14);
  filter: blur(1px);
}

.login-brand,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.brand-glyph {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #4c7df2, #214eca);
  color: #fff;
  box-shadow: 0 12px 28px rgba(36, 82, 196, 0.3);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.brand-glyph img {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-glyph.small {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  flex: 0 0 38px;
  box-shadow: none;
  font-size: 11px;
}

.login-copy {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: auto 0;
}

.login-copy h1 {
  margin: 0 0 16px;
  font-family: Georgia, "STSong", serif;
  font-size: clamp(42px, 5vw, 68px);
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.045em;
}

.platform-line {
  margin-bottom: 30px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 18px;
  letter-spacing: 0.04em;
}

.login-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.login-capabilities span {
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
}

.login-form-wrap {
  padding: 48px;
  display: grid;
  place-items: center;
  background: #fafbfc;
}

.login-card {
  width: min(410px, 100%);
  display: grid;
  gap: 22px;
}

.login-card h2 {
  margin-bottom: 10px;
  font-size: 30px;
}

.secure-caption {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 11px;
}

.shield-dot,
.check-dot {
  width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
}

.shield-dot::after,
.check-dot::after {
  content: "✓";
  font-size: 10px;
  font-weight: 900;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px 18px;
  display: flex;
  flex-direction: column;
  color: white;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 30%),
    var(--nav);
}

.sidebar-brand {
  padding: 0 8px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
}

.sidebar-brand strong {
  font-size: 13px;
  letter-spacing: 0.08em;
}

.sidebar-brand span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
  letter-spacing: 0.02em;
}

#mainNav {
  margin-top: 20px;
  display: grid;
  gap: 5px;
}

.nav-item {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  padding: 0 11px;
  display: grid;
  grid-template-columns: 27px 1fr auto;
  gap: 7px;
  align-items: center;
  background: transparent;
  color: rgba(255, 255, 255, 0.56);
  text-align: left;
  font-size: 12px;
  font-weight: 800;
}

.nav-item:hover,
.nav-item.active {
  background: var(--nav-soft);
  color: white;
}

.nav-item.active {
  box-shadow: inset 3px 0 0 #5d8bff;
}

.nav-code {
  color: rgba(255, 255, 255, 0.25);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.count-badge {
  min-width: 20px;
  padding: 3px 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 9px;
}

.health-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #687278;
}

.health-dot.online {
  background: #4fd3a1;
  box-shadow: 0 0 0 4px rgba(79, 211, 161, 0.1);
}

.sidebar-spacer {
  flex: 1;
}

.engine-card {
  margin: 0 4px 14px;
  padding: 13px;
  display: grid;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
}

.engine-card > span {
  color: rgba(255, 255, 255, 0.36);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.engine-card div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.75);
  font-size: 10px;
}

.engine-card b {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 9px;
}

.sidebar-user {
  padding: 14px 4px 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
}

.sidebar-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #3c5f7b, #263c4e);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09);
}

.sidebar-avatar svg {
  width: 21px;
  height: 21px;
  fill: rgba(255, 255, 255, 0.9);
}

.sidebar-user-copy {
  min-width: 0;
}

.sidebar-user strong,
.sidebar-user small {
  display: block;
}

.sidebar-user strong {
  max-width: 125px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.sidebar-user small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 9px;
}

.sidebar-logout {
  min-height: 30px;
  border: 1px solid rgba(241, 142, 137, 0.25);
  border-radius: 8px;
  padding: 6px 8px;
  color: #ffaaa5;
  background: rgba(195, 66, 63, 0.08);
  font-size: 9px;
  font-weight: 800;
}

.sidebar-logout:hover {
  border-color: rgba(241, 142, 137, 0.45);
  background: rgba(195, 66, 63, 0.16);
}

.main-area {
  min-width: 0;
  padding: 26px clamp(24px, 3vw, 48px) 58px;
}

.topbar {
  min-height: 62px;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.topbar-status {
  padding-top: 4px;
  display: flex;
  gap: 8px;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 8px 11px;
  display: flex;
  gap: 7px;
  align-items: center;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.status-pill > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #aab1b6;
}

.status-pill.online {
  border-color: #c6e6d9;
  color: var(--green);
  background: var(--green-soft);
}

.status-pill.online > span {
  background: #32b27f;
}

.status-pill.running {
  border-color: #efd7af;
  color: var(--amber);
  background: var(--amber-soft);
}

.status-pill.running > span {
  background: #e59a37;
  box-shadow: 0 0 0 4px rgba(229, 154, 55, 0.12);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

.publish-notice {
  margin-bottom: 15px;
  padding: 11px 14px;
  border: 1px solid #cce9dc;
  border-radius: 11px;
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--green);
  background: var(--green-soft);
  font-size: 11px;
}

.panel,
.platform-card {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.panel {
  padding: 23px;
}

.panel-heading,
.section-heading,
.view-toolbar,
.dialog-header,
.dialog-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.panel-heading {
  margin-bottom: 20px;
}

.local-pill,
.settings-lock {
  border-radius: 99px;
  padding: 7px 10px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 10px;
  font-weight: 900;
}

.composer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, 0.55fr);
  gap: 20px;
}

.url-field small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.scope-card {
  padding: 14px;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.field-label {
  margin: 0 4px 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.scope-option {
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 8px 9px;
  align-items: center;
  border-radius: 9px;
  background: #fff;
  font-weight: 500;
}

.scope-option input {
  width: 15px;
  height: 15px;
  accent-color: var(--blue);
}

.scope-option b,
.scope-option small {
  display: block;
}

.scope-option b {
  font-size: 11px;
}

.scope-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.composer-actions {
  margin-top: 17px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.inline-status {
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}

.status-orb {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #bdc3c7;
}

.inline-status.working .status-orb {
  background: var(--blue);
  animation: pulse 1.2s infinite;
}

.inline-status.success .status-orb {
  background: var(--green);
}

.inline-status.error .status-orb {
  background: var(--red);
}

.preflight-section {
  margin-top: 25px;
}

.section-heading {
  margin-bottom: 14px;
}

.target-account-selector {
  margin-bottom: 14px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 2fr);
  gap: 16px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
}

.target-account-selector > div:first-child strong,
.target-account-selector > div:first-child span {
  display: block;
}

.target-account-selector > div:first-child strong {
  font-size: 12px;
}

.target-account-selector > div:first-child span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.target-account-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.target-account-group {
  min-width: 0;
  margin: 0;
  padding: 10px;
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.target-account-group legend {
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  font-weight: 900;
}

.target-platform-logo,
.target-platform-logo img {
  width: 18px;
  height: 18px;
  display: block;
}

.target-platform-logo img {
  object-fit: cover;
  border-radius: 5px;
}

.target-account-option {
  padding: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
  border-radius: 8px;
  background: var(--surface-soft);
  cursor: pointer;
}

.target-account-option input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  accent-color: var(--blue);
  cursor: pointer;
}

.target-account-option strong,
.target-account-option small {
  display: block;
}

.target-account-option strong {
  font-size: 10px;
}

.target-account-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.preflight-list,
.task-list {
  display: grid;
  gap: 11px;
}

.preflight-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(25, 34, 40, 0.045);
}

.preflight-card.invalid {
  border-color: #efc7c4;
}

.preflight-main {
  padding: 17px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.select-product {
  width: 17px;
  height: 17px;
  margin-top: 4px;
  accent-color: var(--blue);
}

.platform-chip,
.status-tag,
.task-status {
  display: inline-flex;
  align-items: center;
  border-radius: 99px;
  padding: 5px 8px;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}

.platform-chip.teeinblue {
  color: var(--tee);
  background: var(--tee-soft);
}

.platform-chip.customall {
  color: var(--custom);
  background: var(--custom-soft);
}

.preflight-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.preflight-title-row h3 {
  margin: 0;
}

.source-link {
  max-width: 800px;
  margin: 7px 0 10px;
  overflow: hidden;
  color: var(--muted);
  font-family: Consolas, monospace;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.count-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.count-row span {
  border-radius: 7px;
  padding: 5px 7px;
  background: #f2f4f5;
  color: #596168;
  font-size: 9px;
}

.preflight-notices {
  padding: 0 17px 15px 48px;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
}

.preflight-notices .error {
  color: var(--red);
}

.preflight-actions {
  width: 220px;
  min-width: 220px;
  display: grid;
  gap: 7px;
}

.preflight-actions > .button,
.preflight-actions > .task-status,
.preflight-actions > .status-tag {
  width: 100%;
  min-height: 36px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.view-toolbar {
  margin-bottom: 16px;
}

.filter-tabs {
  padding: 4px;
  display: flex;
  gap: 3px;
  border-radius: 10px;
  background: #e7eaec;
}

.filter-tabs button {
  border: 0;
  border-radius: 7px;
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.filter-tabs button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 3px 10px rgba(34, 42, 47, 0.08);
}

.task-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.task-card-top {
  padding: 16px 17px 13px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 220px;
  gap: 18px;
}

.record-select {
  display: inline-flex;
  min-width: 36px;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 5px;
  position: relative;
  z-index: 3;
  cursor: pointer;
}

.record-select input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--blue);
  cursor: pointer;
}

.task-card h3 {
  margin: 8px 0 5px;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 9px;
}

.task-timeline {
  margin-top: 9px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 13px;
  color: #68727b;
  font-size: 9px;
}

.task-timeline span {
  display: inline-flex;
  gap: 4px;
  white-space: nowrap;
}

.task-timeline b {
  color: #303940;
  font-weight: 800;
}

.task-timeline em {
  padding: 2px 6px;
  border-radius: 999px;
  color: #346c5b;
  background: #eaf7f2;
  font-style: normal;
  font-weight: 800;
}

.task-status.succeeded {
  color: var(--green);
  background: var(--green-soft);
}

.task-status.running,
.task-status.waiting-retry {
  color: var(--amber);
  background: var(--amber-soft);
}

.task-status.needs-assets,
.task-status.failed,
.task-status.cancelled {
  color: var(--red);
  background: var(--red-soft);
}

.task-status.ready {
  color: var(--blue);
  background: var(--blue-soft);
}

.task-progress {
  width: 100%;
  height: 5px;
  display: block;
  border: 0;
  background: #edf0f1;
  appearance: none;
}

.task-progress::-webkit-progress-bar {
  background: #edf0f1;
}

.task-progress::-webkit-progress-value {
  background: var(--blue);
}

.task-progress::-moz-progress-bar {
  background: var(--blue);
}

.task-progress.complete::-webkit-progress-value {
  background: var(--green);
}

.task-progress.complete::-moz-progress-bar {
  background: var(--green);
}

.task-progress.stopped::-webkit-progress-value {
  background: var(--red);
}

.task-progress.stopped::-moz-progress-bar {
  background: var(--red);
}

.ai-analysis-progress .task-progress {
  margin: 16px 0 18px;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
}

.ai-analysis-steps {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
}

.ai-analysis-steps li {
  min-width: 0;
  padding: 10px 8px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
}

.ai-analysis-steps li > span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #65717c;
  background: #edf0f3;
  font-size: 10px;
}

.ai-analysis-steps li.current {
  border-color: #9ab8ff;
  color: var(--blue-dark);
  background: var(--blue-soft);
}

.ai-analysis-steps li.current > span {
  color: white;
  background: var(--blue);
}

.ai-analysis-steps li.done {
  border-color: #b9e4d3;
  color: var(--green);
  background: var(--green-soft);
}

.ai-analysis-steps li.done > span {
  color: white;
  background: var(--green);
}

.ai-analysis-steps strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-message {
  margin: 0;
  padding: 11px 17px;
  border-top: 1px solid #edf0f1;
  color: #596168;
  background: #fafbfb;
  font-size: 10px;
}

.asset-list {
  padding: 13px 17px;
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  background: #fff8f7;
}

.asset-row {
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  border: 1px solid #f0d7d4;
  border-radius: 9px;
  background: #fff;
}

.asset-row strong,
.asset-row small,
.asset-row code {
  display: block;
}

.asset-row strong {
  font-size: 11px;
}

.asset-row small,
.asset-row code {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.asset-row code {
  max-width: 650px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.settings-intro {
  margin-bottom: 17px;
  padding: 22px 24px;
  border-radius: 15px;
  display: flex;
  justify-content: space-between;
  gap: 28px;
  color: white;
  background: linear-gradient(130deg, #15232d, #263c48);
}

.settings-intro p:last-child {
  max-width: 760px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.7;
}

.settings-intro .kicker {
  color: #9cb9ff;
}

.settings-actions {
  height: fit-content;
  display: flex;
  gap: 9px;
  align-items: center;
}

.settings-refresh {
  color: #f5f9ff;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
}

.settings-refresh:hover {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.14);
}

.settings-lock {
  height: fit-content;
  color: #b9ead8;
  background: rgba(67, 201, 151, 0.12);
  white-space: nowrap;
}

.platform-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.platform-card {
  padding: 22px;
}

.platform-card.tee-card {
  box-shadow: inset 0 3px 0 var(--tee), var(--shadow);
}

.platform-card.custom-card {
  box-shadow: inset 0 3px 0 var(--custom), var(--shadow);
}

.platform-card-head {
  margin-bottom: 19px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.platform-card-head h2 {
  margin-bottom: 0;
}

.platform-logo {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 700;
}

.platform-logo.tee {
  color: var(--tee);
  background: var(--tee-soft);
}

.platform-logo.custom {
  color: var(--custom);
  background: var(--custom-soft);
}

.platform-logo svg,
.platform-logo img {
  width: 36px;
  height: 36px;
  display: block;
}

.platform-logo img {
  border-radius: 10px;
  object-fit: cover;
}

.status-tag {
  color: var(--muted);
  background: #edf0f1;
}

.status-tag.online {
  color: var(--green);
  background: var(--green-soft);
}

.status-tag.warning {
  color: #a25b00;
  background: #fff0d5;
}

.session-box {
  display: grid;
  gap: 15px;
}

.platform-account-list {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.platform-account-row {
  padding: 11px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.platform-account-row.error {
  border-color: rgba(206, 61, 54, 0.26);
  background: #fff7f6;
}

.platform-account-row.warning {
  border-color: rgba(194, 126, 21, 0.28);
  background: #fffbf2;
}

.platform-account-row .account-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: var(--blue);
  font-weight: 900;
}

.platform-account-row .account-avatar.platform-brand {
  color: var(--blue);
  background: #e8f2ff;
}

.platform-account-row .account-avatar.platform-brand svg,
.platform-account-row .account-avatar.platform-brand img {
  width: 29px;
  height: 29px;
  display: block;
}

.platform-account-row .account-avatar.platform-brand img {
  border-radius: 8px;
  object-fit: cover;
}

.platform-account-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.platform-account-actions .button {
  min-height: 34px;
  padding: 7px 11px;
}

.custom-card .platform-account-row .account-avatar.platform-brand {
  color: var(--custom);
  background: var(--custom-soft);
}

.platform-account-row strong,
.platform-account-row small {
  display: block;
}

.platform-account-row strong {
  font-size: 11px;
}

.platform-account-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.platform-account-row .platform-account-issue {
  color: #bd3731;
  line-height: 1.45;
}

.platform-account-row.warning .platform-account-issue {
  color: #9b6410;
}

.platform-account-state {
  color: #bd3731;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.platform-account-row.warning .platform-account-state {
  color: #9b6410;
}

.session-account {
  padding: 12px;
  display: flex;
  gap: 11px;
  align-items: center;
  border-radius: 10px;
  background: var(--surface-soft);
}

.session-account > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #e4e8ea;
  font-weight: 900;
}

.session-account strong,
.session-account small {
  display: block;
}

.session-account strong {
  font-size: 12px;
}

.session-account small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.settings-note {
  margin-top: 16px;
  padding: 17px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
}

.settings-note strong {
  font-size: 12px;
}

.settings-note p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.account-layout {
  max-width: 720px;
}

.updates-layout {
  display: grid;
  gap: 20px;
}

.update-summary-card,
.release-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.update-summary-card h2,
.release-card h2 {
  margin: 6px 0 8px;
}

.update-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.release-history {
  display: grid;
  gap: 16px;
}

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

.release-notes {
  margin: 18px 0 0;
  padding-left: 22px;
  color: var(--ink);
  line-height: 1.75;
}

.release-hash {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .update-summary-card,
  .release-card-heading {
    flex-direction: column;
  }

  .update-actions {
    justify-content: flex-start;
  }
}

.account-card {
  padding: 28px;
}

.account-profile {
  display: flex;
  gap: 15px;
  align-items: center;
}

.account-profile .kicker {
  margin-bottom: 5px;
}

.account-profile h2 {
  margin-bottom: 3px;
}

.account-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  flex: 0 0 58px;
  border-radius: 50%;
  background: linear-gradient(145deg, #4c7df2, #214eca);
  box-shadow: 0 12px 28px rgba(36, 82, 196, 0.2);
}

.account-avatar svg {
  width: 31px;
  height: 31px;
  fill: #fff;
}

.account-username {
  color: var(--muted);
  font-size: 10px;
}

.detail-list {
  margin: 20px 0;
}

.detail-list div {
  padding: 10px 0;
  display: grid;
  grid-template-columns: 110px 1fr;
  border-bottom: 1px solid var(--line);
}

.detail-list dt {
  color: var(--muted);
  font-size: 10px;
}

.detail-list dd {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
}

.account-logout {
  width: 100%;
}

.empty-state {
  padding: 62px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 13px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

dialog {
  width: min(1180px, calc(100vw - 52px));
  max-height: calc(100vh - 48px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 17px;
  box-shadow: 0 32px 100px rgba(12, 22, 28, 0.32);
}

dialog::backdrop {
  background: rgba(12, 20, 25, 0.58);
  backdrop-filter: blur(4px);
}

.dialog-shell {
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  background: #fff;
}

.dialog-header {
  padding: 21px 23px 13px;
}

.dialog-toolbar {
  padding: 0 23px 14px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.dialog-toolbar p {
  margin: 0;
  font-size: 10px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: #f0f2f3;
  color: #6b747a;
  font-size: 22px;
}

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

.variant-product {
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
}

.variant-product-head {
  padding: 13px 14px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  background: #f5f7f8;
}

.variant-product-head h3 {
  margin: 0;
}

.option-labels {
  display: flex;
  gap: 8px;
}

.option-labels label {
  display: flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

.option-labels input {
  width: 130px;
  padding: 7px 8px;
  font-size: 10px;
}

.variant-table-wrap {
  overflow-x: auto;
}

.variant-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.variant-table th,
.variant-table td {
  padding: 8px;
  border-bottom: 1px solid #edf0f1;
  text-align: left;
}

.variant-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.05em;
}

.variant-table input {
  min-width: 130px;
  padding: 7px 8px;
  font-size: 10px;
}

.locked-cell {
  color: #8b9398;
  font-family: Consolas, monospace;
  font-size: 9px;
}

#variantError {
  padding: 0 23px;
}

.dialog-actions {
  padding: 14px 23px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: 410px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #172128;
  color: white;
  box-shadow: 0 14px 42px rgba(10, 18, 23, 0.25);
  font-size: 11px;
  line-height: 1.5;
}

.download-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.pod-download-form {
  padding: 0 22px 22px;
  display: grid;
  gap: 17px;
}

.wide-field,
.pod-option-grid label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
}

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

.path-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.path-picker input[readonly] {
  color: #49565d;
  background: #f4f6f7;
}

.pod-progress-panel .section-heading,
.pod-history-panel .section-heading {
  padding: 20px 22px 10px;
}

.pod-current-task,
.pod-download-history {
  padding: 8px 22px 22px;
}

.pod-download-history {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 12px;
}

.pod-history-panel {
  margin-top: 18px;
}

.pod-task-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.pod-task-card.current {
  border-color: #b9cff8;
  background: #f8fbff;
}

.pod-task-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.pod-task-head > div {
  min-width: 0;
}

.pod-task-head > div:first-of-type {
  flex: 1;
}

.pod-task-head strong,
.pod-task-head small {
  display: block;
}

.pod-task-head strong {
  margin-top: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pod-task-head small {
  margin-top: 4px;
  color: var(--muted);
}

.platform-chip.pod {
  color: #345fd3;
  background: #e9f0ff;
}

.pod-task-progress {
  margin-top: 7px;
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 9px;
}

.pod-task-card .progress-track {
  width: 100%;
}

@media (max-width: 1120px) {
  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 46vh;
    padding: 46px;
  }

  .login-copy h1 {
    font-size: 52px;
  }

  .composer-grid,
  .platform-grid,
  .download-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: 10px;
  }

  .sidebar-brand > div,
  .nav-item > span:nth-child(2),
  .nav-item .count-badge,
  .engine-card,
  .sidebar-user > div {
    display: none;
  }

  .sidebar-brand {
    justify-content: center;
    padding-inline: 0;
  }

  .nav-item {
    grid-template-columns: 1fr;
    justify-items: center;
    padding-inline: 0;
  }

  .sidebar-user {
    justify-content: center;
    padding-inline: 0;
  }

  .sidebar-logout {
    width: 32px;
    padding-inline: 0;
    overflow: hidden;
    font-size: 0;
  }

  .sidebar-logout::before {
    content: "退出";
    font-size: 8px;
  }

  .main-area {
    padding: 22px 17px 48px;
  }

  .topbar,
  .panel-heading,
  .section-heading,
  .view-toolbar,
  .settings-intro,
  .dialog-toolbar {
    flex-direction: column;
  }

  .preflight-main {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .target-account-selector,
  .target-account-options {
    grid-template-columns: 1fr;
  }

  .preflight-actions {
    grid-column: 2;
    grid-template-columns: repeat(2, 1fr);
  }
}
