:root {
  color-scheme: light;
  --bg: #eef4fb;
  --panel: #ffffff;
  --panel-soft: #f7f9fc;
  --text: #152238;
  --muted: #64748b;
  --line: #d8e0eb;
  --blue: #2f75ff;
  --blue-soft: #e9f1ff;
  --violet: #8257e6;
  --green: #16b97a;
  --green-soft: #dff9ed;
  --amber: #f39a12;
  --amber-soft: #fff3d8;
  --red: #d94141;
  --red-soft: #ffe8e8;
  --shadow: 0 18px 50px rgba(34, 49, 77, 0.14);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(47, 117, 255, 0.08), transparent 34%),
    linear-gradient(180deg, #edf3fb 0%, #f8fbff 100%);
  color: var(--text);
  min-height: 100vh;
}

body[data-product="claude"] {
  background:
    linear-gradient(135deg, rgba(255, 138, 31, 0.1), transparent 34%),
    linear-gradient(180deg, #fff8e8 0%, #fffdf6 100%);
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.hidden {
  display: none !important;
}

.page-shell {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.brand {
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--green));
  box-shadow: 0 10px 28px rgba(47, 117, 255, 0.24);
}

body[data-product="claude"] .brand-mark {
  background: linear-gradient(135deg, #ff6b17, #f2a000);
  box-shadow: 0 10px 28px rgba(255, 107, 23, 0.2);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.switch-button,
.language-select,
.ghost-button,
.primary-button {
  min-height: 44px;
  border-radius: var(--radius);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.switch-button {
  padding: 0 18px;
  color: #d95b11;
  border: 1px solid #ffc986;
  background: #fff8ed;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

body[data-product="claude"] .switch-button {
  color: #155dca;
  border-color: #a8c7ff;
  background: #eef5ff;
}

.switch-button:hover,
.ghost-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
}

.switch-icon {
  font-size: 20px;
  line-height: 1;
}

.language-select {
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 0 42px 0 18px;
  box-shadow: 0 8px 18px rgba(34, 49, 77, 0.08);
}

.title-panel,
.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(216, 224, 235, 0.86);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.title-panel {
  min-height: 166px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 36px 48px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

body[data-product="claude"] .eyebrow {
  color: #ff6b17;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  -webkit-background-clip: text;
  color: transparent;
}

body[data-product="claude"] h1 {
  background: linear-gradient(135deg, #ff6b17, #f2a000);
  -webkit-background-clip: text;
}

h2 {
  font-size: 22px;
}

.title-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.status-pill {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 14px;
  border: 1px solid #7be5b6;
  color: #087d51;
  background: var(--green-soft);
  white-space: nowrap;
}

.status-pill.accent {
  border-color: #b9cdfc;
  color: #285fc7;
  background: var(--blue-soft);
}

body[data-product="claude"] .status-pill.accent {
  border-color: #ffd3a3;
  color: #b64a00;
  background: #fff2df;
}

.status-pill.warn {
  border-color: #ffd27b;
  color: #9a5d00;
  background: var(--amber-soft);
}

.status-pill.danger {
  border-color: #ffb6b6;
  color: #a42b2b;
  background: var(--red-soft);
}

.tabs {
  display: flex;
  gap: 10px;
  margin: 24px 0 16px;
}

.tab {
  min-height: 42px;
  padding: 0 20px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.tab.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(47, 117, 255, 0.22);
}

body[data-product="claude"] .tab.active {
  background: linear-gradient(135deg, #ff6b17, #f59a00);
  box-shadow: 0 12px 24px rgba(255, 107, 23, 0.18);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.workflow-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 30px;
}

.main-panel {
  min-height: 560px;
}

.narrow-panel {
  max-width: 760px;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.step {
  position: relative;
  min-height: 76px;
  border: 2px solid #c9d1dc;
  color: var(--muted);
  background: var(--panel-soft);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  gap: 6px;
}

.step::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -16px;
  width: 14px;
  height: 3px;
  background: #c9d1dc;
  transform: translateY(-50%);
}

.step:last-child::after {
  display: none;
}

.step span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: #b7c0cc;
  font-weight: 800;
}

.step strong {
  font-size: 15px;
}

.step.active {
  color: var(--blue);
  border-color: var(--blue);
  background: var(--blue-soft);
}

body[data-product="claude"] .step.active {
  color: #ff6b17;
  border-color: #ff6b17;
  background: #fff0e3;
}

.step.active span {
  background: var(--blue);
}

body[data-product="claude"] .step.active span {
  background: #ff6b17;
}

.form-stack {
  min-height: 380px;
}

.step-pane {
  display: none;
}

.step-pane.active {
  display: block;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  color: var(--text);
  background: #ffffff;
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field input {
  min-height: 50px;
  padding: 0 16px;
  font-size: 16px;
}

.field textarea {
  resize: vertical;
  min-height: 180px;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.6;
}

#accountInput {
  min-height: 96px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", "Microsoft YaHei", monospace;
  font-size: 14px;
  line-height: 1.5;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 117, 255, 0.14);
}

.button-row {
  display: flex;
  gap: 14px;
  margin-top: 18px;
}

.button-row.split {
  display: grid;
  grid-template-columns: minmax(180px, 0.36fr) 1fr;
}

.primary-button,
.ghost-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
}

.primary-button {
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  box-shadow: 0 14px 26px rgba(47, 117, 255, 0.24);
}

body[data-product="claude"] .primary-button {
  background: linear-gradient(135deg, #ff6b17, #f59a00);
  box-shadow: 0 14px 26px rgba(255, 107, 23, 0.2);
}

body[data-product="claude"] .confirm-button {
  background: linear-gradient(135deg, #ff6b17, #f59a00);
}

.confirm-button {
  background: #18ad52;
  box-shadow: 0 14px 26px rgba(24, 173, 82, 0.2);
}

.ghost-button {
  color: var(--text);
  background: #e7ebf1;
  border: 1px solid transparent;
}

.ghost-button.compact {
  width: auto;
  min-width: 108px;
  padding: 0 16px;
  font-size: 15px;
}

.notice,
.account-card,
.task-card {
  margin-top: 18px;
  border-radius: var(--radius);
  padding: 16px 18px;
  border: 1px solid #bad3ff;
  background: #eef5ff;
  color: #205dbb;
  line-height: 1.7;
}

.notice.success {
  border-color: #9fe9c5;
  background: var(--green-soft);
  color: #087d51;
}

.notice.warning {
  border-color: #ffd27b;
  background: var(--amber-soft);
  color: #8a5607;
}

.used-card-panel {
  display: grid;
  gap: 10px;
  color: #b85000;
}

.used-card-head {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #9b4b00;
}

.used-card-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 2px solid #ff9a00;
  border-radius: 50%;
  color: #ff8a00;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.used-card-email {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  padding-left: 32px;
}

.used-card-email span {
  color: #d56a00;
}

.used-card-email strong {
  color: #b64a00;
  font-weight: 800;
}

.used-card-panel p {
  margin: 0;
  padding-left: 32px;
  color: #df7300;
}

.used-card-button {
  width: calc(100% - 40px);
  min-height: 44px;
  margin: 10px 8px 0 32px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: #f59a00;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 12px 22px rgba(245, 154, 0, 0.18);
}

.notice.error {
  border-color: #ffb6b6;
  background: var(--red-soft);
  color: #9d2a2a;
}

.notice.info {
  margin: 0 0 18px;
}

.account-card,
.task-card {
  color: var(--text);
  background: #f6f9fd;
  border-color: var(--line);
}

.task-card.success {
  border-color: #8de8ba;
  background: #edfff5;
  color: #075f3c;
}

.task-card.warning {
  border-color: #ffd27b;
  background: #fff9e9;
  color: #8a5607;
}

.task-card.error {
  border-color: #ffb6b6;
  background: #fff0f0;
  color: #9d2a2a;
}

.task-card.success .kv-row span:first-child {
  color: #0d7a4d;
}

.task-card.success .kv-row strong {
  color: #064f33;
}

.cover-warning-card {
  display: grid;
  gap: 10px;
  color: #8a3f00;
}

.cover-warning-card strong {
  color: #a84300;
  font-size: 17px;
}

.cover-warning-card p {
  margin: 0;
  color: #b24b00;
  line-height: 1.65;
}

.cover-warning-actions {
  display: grid;
  grid-template-columns: minmax(120px, 0.32fr) 1fr;
  gap: 12px;
  margin-top: 8px;
}

.kv-grid,
.summary-list {
  display: grid;
  gap: 10px;
}

.recharge-confirm-card {
  display: grid;
  gap: 0;
  margin-bottom: 20px;
  padding: 24px 28px;
  border: 1px solid #94efbd;
  border-radius: var(--radius);
  background: #fbfefd;
}

body[data-product="claude"] .recharge-confirm-card {
  border-color: #ffd3a3;
  background: #fffdf8;
}

.recharge-confirm-card h3 {
  margin: 0 0 16px;
  color: var(--text);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0;
}

.confirm-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  align-items: center;
  min-height: 54px;
  border-top: 1px solid #dfe8ef;
}

.confirm-row span {
  color: #5c6677;
  font-size: 16px;
}

.confirm-row strong {
  color: #101828;
  font-size: 18px;
  font-weight: 500;
  text-align: right;
  overflow-wrap: anywhere;
}

.kv-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  align-items: start;
}

.kv-row span:first-child {
  color: var(--muted);
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  color: var(--text);
  font-weight: 700;
}

.check-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--blue);
}

.side-panel {
  display: grid;
  gap: 14px;
}

.side-block {
  padding: 18px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 8px;
}

.side-label {
  color: var(--muted);
  font-size: 13px;
}

.side-block strong {
  font-size: 17px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.table-wrap {
  margin-top: 20px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  background: var(--panel-soft);
}

td {
  color: var(--text);
}

tr:last-child td {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #285fc7;
  font-weight: 800;
  white-space: nowrap;
}

.badge.success {
  background: var(--green-soft);
  color: #087d51;
}

.badge.warning {
  background: var(--amber-soft);
  color: #8a5607;
}

.badge.error {
  background: var(--red-soft);
  color: #9d2a2a;
}

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--muted);
  padding: 28px 0 0;
}

.operation-guide {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid #d7e5ff;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f7fbff, #ffffff);
}

.claude-guide {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid #ffe0bd;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff9ed, #ffffff);
}

.operation-row {
  display: grid;
  grid-template-columns: 24px 76px minmax(160px, 220px);
  align-items: center;
  gap: 8px;
}

.operation-row.compact-row {
  grid-template-columns: 24px 1fr;
}

.operation-icon {
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
}

.operation-icon.blue {
  color: var(--blue);
}

.operation-icon.violet {
  color: var(--violet);
}

.paste-badge {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  color: #7c4dff;
  background: linear-gradient(135deg, #f1eaff, #e9f1ff);
  box-shadow: inset 0 0 0 1px rgba(124, 77, 255, 0.22), 0 6px 14px rgba(124, 77, 255, 0.14);
}

.paste-badge svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.operation-label {
  font-size: 16px;
  color: var(--text);
}

.operation-label em {
  color: var(--red);
  font-style: normal;
}

.action-button {
  min-height: 44px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #ffffff;
  text-decoration: none;
  font-size: 16px;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

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

.login-button {
  background: #20c563;
  box-shadow: 0 12px 22px rgba(32, 197, 99, 0.18);
}

.key-button {
  background: var(--blue);
  box-shadow: 0 12px 22px rgba(47, 117, 255, 0.18);
}

.claude-key-button {
  background: #ff6b17;
  box-shadow: 0 12px 22px rgba(255, 107, 23, 0.18);
}

.claude-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid #ff8a8a;
  border-radius: var(--radius);
  background: #fff1f1;
  color: #c82323;
  line-height: 1.55;
}

.claude-alert span {
  color: #ff6b17;
}

.claude-tip {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #667085;
  line-height: 1.5;
}

.claude-tip span {
  color: #ff6b17;
}

.user-badge {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  color: #8b5cf6;
  background: linear-gradient(135deg, #f4ecff, #fff7ed);
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.22), 0 6px 14px rgba(139, 92, 246, 0.12);
}

.user-badge svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.field-hint {
  color: #98a2b3;
  font-size: 13px;
  line-height: 1.45;
}

.operation-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d98900;
  font-size: 14px;
  line-height: 1.5;
}

.operation-warning span {
  font-size: 17px;
}

.verified-card-box {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(220px, 1fr);
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid #b9d4ff;
  border-radius: var(--radius);
  background: #eef6ff;
  color: var(--text);
}

.verified-card-box[hidden] {
  display: none;
}

.verified-card-box div {
  display: grid;
  gap: 6px;
}

.verified-label {
  color: #47617d;
  font-size: 13px;
}

.verified-card-box strong,
.verified-card-box code {
  color: #1f5fd4;
  font-size: 16px;
  font-weight: 800;
}

.verified-card-box code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .page-shell {
    width: min(100% - 24px, 760px);
    padding-top: 18px;
  }

  .topbar,
  .title-panel,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .title-panel {
    padding: 28px 22px;
  }

  .title-status {
    justify-content: flex-start;
  }

  .workflow-grid {
    grid-template-columns: 1fr;
  }

  .stepper {
    grid-template-columns: 1fr;
  }

  .step::after {
    display: none;
  }

  .button-row.split {
    grid-template-columns: 1fr;
  }

  .cover-warning-actions {
    grid-template-columns: 1fr;
  }

  .operation-row {
    grid-template-columns: 24px 70px 1fr;
  }

  .operation-label {
    font-size: 15px;
  }

  .action-button {
    min-height: 44px;
    font-size: 15px;
  }

  .verified-card-box {
    grid-template-columns: 1fr;
  }

  .confirm-row {
    grid-template-columns: 1fr;
    gap: 4px;
    align-items: start;
    padding: 12px 0;
  }

  .confirm-row strong {
    text-align: left;
    font-size: 16px;
  }

  .used-card-email,
  .used-card-panel p {
    padding-left: 0;
  }

  .used-card-button {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .panel {
    padding: 22px;
  }
}

@media (max-width: 560px) {
  .top-actions,
  .tabs {
    grid-template-columns: 1fr;
    display: grid;
  }

  h1 {
    font-size: 38px;
  }

  .field input {
    font-size: 15px;
  }

  #accountInput {
    font-size: 13px;
  }

  .kv-row {
    grid-template-columns: 1fr;
  }

  .operation-row {
    grid-template-columns: 24px 1fr;
  }

  .operation-row .action-button {
    grid-column: 2;
  }

  .operation-row.compact-row {
    grid-template-columns: 24px 1fr;
  }

  footer {
    align-items: flex-start;
    justify-content: flex-start;
  }
}
