/* 账号中心 —— 类名统一 ac- 前缀，颜色只用 tokens.css 变量；
   金色 tokens 里没有，按约定在 .ac 作用域里声明局部变量 */

.ac {
  --ac-gold: #ffc442;
  --ac-gold-deep: #f59f00;
  --ac-gold-ink: #1a1200;

  max-width: 860px;
  margin: 0 auto;
  padding: 14px 16px 56px;
  background: var(--bg-page);
  color: var(--text);
  font-family: var(--font);
}

/* ============ 未登录：登录 / 注册 ============ */
.ac-auth {
  display: flex;
  justify-content: center;
  padding: 20px 0 40px;
}

.ac-auth__card {
  width: 100%;
  max-width: 420px;
  padding: 26px 24px 22px;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--bg-page);
}

.ac-auth__title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.3px;
}

.ac-auth__sub {
  margin: 0 0 18px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

.ac-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-surface);
}

.ac-tab {
  flex: 1 1 0;
  padding: 8px 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-muted);
  border-radius: var(--r-pill);
  transition: color 0.15s ease, background 0.15s ease;
}

.ac-tab:hover { color: var(--text); }

.ac-tab.is-on {
  color: var(--text-on-primary);
  background: var(--primary);
}

.ac-form {
  display: grid;
  gap: 12px;
}

.ac-field {
  display: grid;
  gap: 6px;
}

.ac-field__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ac-input {
  height: 40px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-input);
  background: var(--bg-surface);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s ease;
}

.ac-input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
}

.ac-input:hover { border-color: var(--border-strong); }

.ac-input:focus { border-color: var(--primary); }

.ac-err {
  margin: -6px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--primary);
}

.ac-submit {
  height: 42px;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-on-primary);
  border-radius: var(--r-pill);
  background: var(--primary);
  transition: background 0.15s ease;
}

.ac-submit:hover { background: var(--primary-hover); }

.ac-fine {
  margin: 2px 0 0;
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
  color: var(--text-muted);
}

/* ============ 已登录：头部 ============ */
.ac-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 0 18px;
}

.ac-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  color: var(--text-on-primary);
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.ac-id {
  flex: 1 1 auto;
  min-width: 0;
}

.ac-email {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ac-plan {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--text-muted);
}

.ac-badge {
  padding: 1px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ac-gold-ink);
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--ac-gold), var(--ac-gold-deep));
}

.ac-out {
  flex: 0 0 auto;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-surface-muted);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.ac-out:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

/* ============ 卡片 ============ */
.ac-card {
  margin-bottom: var(--gap);
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--bg-surface);
}

.ac-h {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ============ 积分 ============ */
.ac-credits__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.ac-balance {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 0;
}

.ac-balance__v {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
  color: var(--ac-gold);
}

.ac-balance__k {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ac-buy {
  flex: 0 0 auto;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ac-gold-ink);
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--ac-gold), var(--ac-gold-deep));
  transition: filter 0.15s ease, transform 0.15s ease;
}

.ac-buy:hover { filter: brightness(1.06); }

.ac-buy:active { transform: translateY(1px); }

.ac-note {
  margin: 12px 0 0;
  font-size: 11px;
  color: var(--text-muted);
}

/* ============ 订单表 ============ */
.ac-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.ac-table th {
  padding: 0 0 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.ac-table td {
  padding: 11px 0;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
}

.ac-table tbody tr:last-child td { border-bottom: 0; }

.ac-table td:first-child {
  color: var(--text);
  white-space: nowrap;
}

.ac-table__num { text-align: right; }

.ac-status {
  display: inline-block;
  padding: 2px 9px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.6;
  border-radius: var(--r-pill);
}

.ac-status--ok {
  color: var(--text);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface-muted);
}

.ac-status--muted {
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ============ 设置 ============ */
.ac-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.ac-row:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.ac-row__text { min-width: 0; }

.ac-row__label {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

.ac-row__hint {
  margin: 3px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-muted);
}

.ac-toggle {
  position: relative;
  flex: none;
  width: 42px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-surface-muted);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.ac-toggle.is-on {
  border-color: var(--primary);
  background: var(--primary);
}

.ac-toggle__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: var(--r-pill);
  background: var(--text);
  transition: transform 0.18s ease;
}

.ac-toggle.is-on .ac-toggle__knob { transform: translateX(18px); }

/* ============ 支付提示 ============ */
.ac-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
}

.ac-modal__panel {
  width: 100%;
  max-width: 360px;
  padding: 24px 22px 20px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-surface);
}

.ac-modal__title {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.ac-modal__text {
  margin: 0 0 18px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
}

.ac-modal__ok {
  width: 100%;
  padding: 11px 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-on-primary);
  border-radius: var(--r-pill);
  background: var(--primary);
  transition: background 0.15s ease;
}

.ac-modal__ok:hover { background: var(--primary-hover); }

/* ============ 窄屏 ============ */
@media (max-width: 760px) {
  .ac {
    padding: 10px 12px 40px;
  }

  .ac-auth { padding: 8px 0 24px; }

  .ac-auth__card { padding: 20px 16px 18px; }

  .ac-card { padding: 16px 14px; }

  .ac-top { flex-wrap: wrap; }

  .ac-table { font-size: 11px; }

  .ac-table td { padding: 10px 0; }

  .ac-credits__row {
    align-items: flex-start;
    flex-direction: column;
  }

  .ac-buy { width: 100%; }
}

/* 验证码登录 */
.ac-code-send {
  width: 100%;
  height: 40px;
  margin: 4px 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border-radius: var(--r-pill);
}
.ac-code-send:hover { background: var(--primary-hover); }
.ac-code-send:disabled { opacity: .5; }

.ac-input--code {
  letter-spacing: .4em;
  text-align: center;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.ac-hint { margin: 8px 0 0; font-size: 11.5px; color: var(--text-muted); }
.ac-hint--dev { color: var(--primary); font-family: ui-monospace, monospace; }

.ac-switch { margin: 14px 0 0; text-align: center; font-size: 12px; color: var(--text-muted); }

.ac-link {
  padding: 0;
  font-size: inherit;
  color: var(--primary);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ac-link:disabled { color: var(--text-muted); cursor: not-allowed; text-decoration: none; }

/* Google 登录 */
.ac-or {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 0 10px; font-size: 11px; color: var(--text-muted);
}
.ac-or::before, .ac-or::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.ac-google {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 40px;
  font-size: 13px; font-weight: 700; color: var(--text);
  background: #fff; border-radius: var(--r-pill);
}
.ac-google:hover { background: #f0f0f0; }
