:root {
  color: #172033;
  background: #f4f7fb;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  --brand: #6366f1;
  --muted: #687386;
  --border: rgb(28 45 75 / 11%);
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 0%, color-mix(in srgb, var(--brand) 11%, transparent), transparent 35%),
    linear-gradient(180deg, #f8faff, #f1f5f9);
}

button { font: inherit; }

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 52px 0 36px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 460px);
  align-items: end;
  gap: 32px;
  margin-bottom: 24px;
}

.title-block { min-width: 0; }

.eyebrow {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1 {
  margin: 4px 0 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.08;
  letter-spacing: -.035em;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.notice {
  border: 1px solid color-mix(in srgb, #f59e0b 36%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, #f59e0b 9%, white);
  padding: 16px 18px;
}

.notice b { color: #92400e; }

.notice p {
  margin: 5px 0 0;
  color: #7c4a13;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-line;
}

.usage-guide {
  display: grid;
  gap: 16px;
  margin-top: 14px;
  border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent);
  border-radius: 18px;
  background: #ffffffd6;
  padding: 18px;
  box-shadow: 0 10px 30px #0f172a0a;
}

.usage-guide-heading { display: flex; align-items: center; gap: 12px; }
.usage-guide-heading h2, .usage-guide-heading p, .usage-guide-step p { margin: 0; }
.usage-guide-heading h2 { font-size: 16px; }
.usage-guide-heading p, .usage-guide-step p { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.55; }

.usage-guide-icon, .usage-guide-index {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 12%, white);
  color: var(--brand);
  font-weight: 800;
}

.usage-guide-icon { width: 36px; height: 36px; font-size: 18px; }

.usage-guide-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.usage-guide-step {
  display: grid;
  align-content: start;
  justify-items: start;
  border-radius: 14px;
  background: #f8fafc;
  padding: 14px;
}

.usage-guide-index { width: 26px; height: 26px; margin-bottom: 10px; font-size: 12px; }

.usage-guide-action {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-top: 12px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 750;
  padding: 9px 12px;
  text-decoration: none;
}

.usage-guide-action:hover { filter: brightness(.94); }
.usage-guide-action:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 28%, transparent); outline-offset: 2px; }

.usage-guide-config {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 12px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.usage-guide-config-label { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.usage-guide-config-code { min-width: 0; overflow: hidden; color: #172033; font-size: clamp(16px, 3vw, 21px); font-weight: 800; letter-spacing: .08em; text-overflow: ellipsis; white-space: nowrap; }

.usage-guide-copy, .refresh-button {
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--brand) 8%, white);
  color: var(--brand);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  padding: 8px 11px;
}

.usage-guide-copy:hover, .refresh-button:hover { background: color-mix(in srgb, var(--brand) 13%, white); }
.refresh-button:disabled { cursor: wait; opacity: .6; }

.toolbar {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}

.sync-time { margin-left: 10px; color: #8b96a7; }
.toolbar-actions { display: flex; align-items: center; gap: 10px; }
.copy-status { color: #15803d; font-weight: 750; }
.copy-status[data-tone="error"] { color: #b42318; }

.account-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

.account-card {
  display: grid;
  gap: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #ffffffe5;
  box-shadow: 0 12px 34px #0f172a0d;
  padding: 16px;
}

.card-meta, .credential-row { display: flex; align-items: center; gap: 9px; }
.card-meta { justify-content: flex-end; color: var(--muted); font-size: 12px; }
.status { flex: 0 0 auto; border-radius: 999px; background: #f1f5f9; padding: 4px 8px; font-weight: 750; }
.status.is-available { background: #e8f8ed; color: #147a2f; }
.status.is-unavailable { background: #fff0ef; color: #b42318; }
.status.is-unknown { background: #f1f5f9; color: #596579; }
.field-label { width: 30px; flex: 0 0 auto; color: var(--muted); font-size: 12px; }

.masked-value {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  border: 1px solid rgb(15 23 42 / 6%);
  border-radius: 10px;
  background: #f8fafc;
  padding: 9px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-button, .retry-button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  padding: 9px 11px;
  font-size: 12px;
  font-weight: 750;
}

.copy-button:hover, .retry-button:hover { filter: brightness(.94); }
.safe-label { flex: 0 0 auto; color: #8b96a7; font-size: 11px; }
.card-foot, .footer { color: var(--muted); }
.footer { padding: 28px 0 0; text-align: center; font-size: 12px; }

.empty, .failure, .loading-panel {
  display: grid;
  min-height: 320px;
  place-items: center;
  align-content: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: #ffffffd1;
  color: var(--muted);
  text-align: center;
  padding: 28px;
}

.failure p, .loading-panel p { margin: 0; }
.grid-message { grid-column: 1 / -1; }
.loading-panel span { width: 36px; height: 36px; border: 3px solid color-mix(in srgb, var(--brand) 18%, transparent); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
.noscript { margin-top: 14px; min-height: 120px; }
.clipboard-helper { position: fixed; left: -9999px; top: 0; opacity: 0; pointer-events: none; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .account-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .page-shell { width: min(100% - 22px, 1120px); padding-top: 28px; }
  .hero { grid-template-columns: 1fr; gap: 15px; }
  .account-grid, .usage-guide-steps, .usage-guide-config { grid-template-columns: 1fr; }
  .usage-guide-copy { justify-self: start; }
  .toolbar { align-items: flex-start; flex-direction: column; justify-content: center; gap: 8px; padding: 12px 0; }
  .toolbar-actions { width: 100%; justify-content: space-between; }
  .credential-row { flex-wrap: wrap; }
  .masked-value { min-width: calc(100% - 39px); }
  .copy-button, .safe-label { margin-left: 39px; }
}
