/* 原始色值集中在 reference 层，组件只消费 semantic tokens。 */
:root {
  --ref-paper: #f7f8fa;
  --ref-white: #ffffff;
  --ref-ink: #1e2433;
  --ref-slate: #697386;
  --ref-line: #e5e8ed;
  --ref-blue: #395bd8;
  --ref-blue-dark: #2c4dc7;
  --ref-blue-soft: #eef2ff;
  --ref-green: #298560;
  --ref-red: #af3346;
  --ref-red-soft: #fff3f4;
  --ref-shadow: 0 8px 32px rgb(30 36 51 / 4%);
  --background: var(--ref-paper);
  --foreground: var(--ref-ink);
  --card: var(--ref-white);
  --muted-foreground: var(--ref-slate);
  --border: var(--ref-line);
  --primary: var(--ref-blue);
  --primary-hover: var(--ref-blue-dark);
  --primary-foreground: var(--ref-white);
  --accent: var(--ref-blue-soft);
  --positive: var(--ref-green);
  --destructive: var(--ref-red);
  --destructive-background: var(--ref-red-soft);
  --card-shadow: var(--ref-shadow);
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-code: "SFMono-Regular", Consolas, monospace;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button,
input,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
button,
input,
textarea,
a {
  -webkit-tap-highlight-color: transparent;
}
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 4px;
}
.topbar {
  height: 80px;
  padding: 0 48px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--foreground);
  text-decoration: none;
  font-size: 20px;
  letter-spacing: -0.6px;
}
.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--foreground);
  color: var(--primary-foreground);
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 700;
}
.brand-suffix {
  color: var(--muted-foreground);
  font-weight: 400;
}
.console-label {
  color: var(--muted-foreground);
  font-size: 13px;
}
main {
  max-width: 1104px;
  margin: 0 auto;
  padding: 64px 32px 32px;
}
.heading {
  margin-bottom: 40px;
}
.eyebrow {
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--positive);
  flex: 0 0 auto;
}
h1 {
  font-size: clamp(28px, 4vw, 36px);
  line-height: 1.3;
  letter-spacing: -1px;
  margin: 16px 0 12px;
  font-weight: 650;
  text-wrap: balance;
}
p {
  margin: 8px 0 0;
}
.heading p,
.muted {
  color: var(--muted-foreground);
}
.workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.card {
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--card-shadow);
  min-width: 0;
}
.section-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}
.step {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: 11px var(--font-code);
  color: var(--muted-foreground);
}
h2 {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
}
h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}
.login-intro {
  text-align: center;
  padding: 32px 0;
}
.account-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  background: var(--accent);
  color: var(--primary);
  border-radius: 12px;
  font-size: 24px;
}
.login-intro p {
  margin-top: 12px;
  color: var(--muted-foreground);
}
.button {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  transition: transform 140ms cubic-bezier(0.23, 1, 0.32, 1);
}
.button:active:not(:disabled) {
  transform: scale(0.98);
}
.primary {
  color: var(--primary-foreground);
  background: var(--primary);
}
.secondary {
  border-color: var(--border);
  background: var(--card);
  color: var(--foreground);
}
.wide {
  width: 100%;
}
.google-mark {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}
.text-button {
  padding: 8px;
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 12px;
}
#retry-session {
  margin-top: 12px;
  width: 100%;
}
.access-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-foreground);
  font-size: 11px;
}
.intro {
  font-size: 13px;
}
.prompt-empty {
  margin-top: 24px;
  padding: 32px 20px;
  background: var(--background);
  border-radius: 12px;
  text-align: center;
}
.code-icon {
  display: block;
  color: var(--primary);
  font: 24px var(--font-code);
  margin-bottom: 16px;
}
.prompt-empty p {
  color: var(--muted-foreground);
  font-size: 12px;
  margin-bottom: 24px;
}
.endpoint {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 8px;
  background: var(--card);
  margin-top: 8px;
  font-size: 11px;
  overflow-wrap: anywhere;
}
.endpoint span {
  color: var(--positive);
  font-weight: 600;
}
.endpoint code {
  min-width: 0;
}
.mono {
  font-family: var(--font-code);
  font-size: 11px;
}
.identity {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.identity > div {
  min-width: 0;
  flex: 1;
}
.identity strong,
#user-email {
  display: block;
  overflow-wrap: anywhere;
}
#user-email {
  font-size: 11px;
}
.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  height: 40px;
  background: var(--accent);
  color: var(--primary);
  border-radius: 50%;
  font-size: 17px;
}
label {
  display: block;
  font-size: 12px;
  margin-bottom: 8px;
  font-weight: 550;
}
.create-row {
  display: flex;
  gap: 8px;
}
input,
textarea {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
  width: 100%;
}
input {
  min-height: 44px;
}
input::placeholder {
  color: var(--muted-foreground);
}
.new-key {
  margin-top: 24px;
  padding: 16px;
  background: var(--accent);
  border-radius: 12px;
}
.key-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 12px;
}
.badge {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 10px;
  white-space: nowrap;
  color: var(--muted-foreground);
}
.key-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.small {
  font-size: 11px;
}
.keys-heading {
  margin: 24px 0 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.keys-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}
.key-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.key-item > div {
  min-width: 0;
}
.key-item strong {
  display: block;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.key-item .text-button {
  color: var(--destructive);
}
textarea {
  min-height: 360px;
  resize: vertical;
  line-height: 1.8;
  margin: 24px 0 16px;
  background: var(--background);
}
.notice {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--accent);
  margin-bottom: 24px;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.notice[data-error="true"] {
  color: var(--destructive);
  background: var(--destructive-background);
}
.page-footer {
  display: flex;
  justify-content: space-between;
  color: var(--muted-foreground);
  font-size: 11px;
  margin-top: 32px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (hover: hover) and (pointer: fine) {
  .primary:hover:not(:disabled) {
    background: var(--primary-hover);
  }
  .secondary:hover:not(:disabled) {
    background: var(--background);
  }
  .text-button:hover:not(:disabled) {
    color: var(--primary);
  }
}
@media (max-width: 720px) {
  .topbar {
    height: 64px;
    padding: 0 20px;
  }
  main {
    padding: 40px 16px 24px;
  }
  .heading {
    margin-bottom: 24px;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 24px;
  }
  .create-row {
    flex-wrap: wrap;
  }
  .create-row .button {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .button {
    transition: none;
  }
  .button:active:not(:disabled) {
    transform: none;
  }
}
