/* 账号页与订阅页。只使用 styles.css 里的 token，不引入第二套配色。 */

.acc-wrap { max-width: 760px; }

.acc-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin: 0 0 18px;
}
.acc-card-title { font: 700 20px/1.3 Georgia, serif; margin: 0 0 8px; }
.acc-card-body { color: var(--muted); margin: 0 0 18px; font-size: 15px; line-height: 1.65; }

.acc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font: 650 14px/1 inherit; text-decoration: none; cursor: pointer;
  transition: border-color .16s, background .16s, color .16s, opacity .16s;
}
.acc-btn:hover { border-color: var(--accent); }
.acc-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.acc-btn[disabled] { opacity: .55; cursor: not-allowed; }
.acc-btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.acc-btn--primary:hover { background: #4338ca; border-color: #4338ca; }
.acc-btn--ghost { background: #fff; }
.acc-btn--text {
  background: none; border: 0; color: var(--accent);
  padding: 0 4px; min-height: 32px; font-weight: 650;
}
.acc-btn--danger { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.acc-btn--danger:hover { background: #991b1b; border-color: #991b1b; }
.acc-btn img { display: block; flex: 0 0 auto; }

.acc-signin-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.acc-hint { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.6; }

.acc-identity {
  display: flex; align-items: center; gap: 16px;
  padding-bottom: 18px; margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.acc-avatar {
  width: 56px; height: 56px; border-radius: 50%; flex: 0 0 auto;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; overflow: hidden;
  font: 700 20px/1 Georgia, serif;
}
.acc-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acc-identity-text { flex: 1; min-width: 0; }
.acc-name {
  font: 700 18px/1.3 Georgia, serif; margin: 0 0 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.acc-meta { font-size: 13px; color: var(--muted); margin: 0 0 2px; }

.acc-member-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.acc-member-title { font: 700 15px/1.3 inherit; margin: 0; }
.acc-badge {
  font: 700 11px/1 var(--mono); letter-spacing: .04em;
  padding: 6px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); white-space: nowrap;
}
.acc-badge--good { background: #ecfdf5; color: var(--good); }
.acc-badge--warm { background: #fff7ed; color: var(--warm); }
.acc-badge--none { background: #f4f1ea; color: var(--muted); }

.acc-member-plan { margin: 0 0 4px; font-weight: 650; }
.acc-member-date { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
.acc-member-note { margin: 0 0 14px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.acc-member-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.acc-confirm {
  margin-top: 16px; padding: 16px;
  border: 1px solid var(--line); border-left: 3px solid var(--warm);
  border-radius: 12px; background: #fffdf8;
}
.acc-confirm-title { font-weight: 700; margin: 0 0 6px; }
.acc-confirm-body { color: var(--muted); font-size: 14px; margin: 0 0 14px; line-height: 1.65; }
.acc-confirm-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.acc-status {
  padding: 16px; border: 1px solid #fecaca; background: #fef2f2;
  color: #b91c1c; border-radius: 12px; margin: 0;
}
.acc-loading { color: var(--muted); font-size: 14px; margin: 0; }
.acc-legal { font-size: 13px; color: var(--muted); margin: 18px 0 0; line-height: 1.7; }
.acc-legal a { margin-left: 8px; }
.acc-flash { animation: acc-flash 1.2s ease; }
@keyframes acc-flash {
  0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, .35); }
  100% { box-shadow: 0 0 0 12px rgba(79, 70, 229, 0); }
}

/* 订阅页 */
.sub-plans {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 16px; margin: 0 0 14px;
}
.sub-plan {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 22px 22px;
}
.sub-plan--reco { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft); }
.sub-plan-badge {
  position: absolute; top: -11px; right: 18px;
  background: var(--warm); color: #fff;
  font: 700 11px/1 var(--mono); letter-spacing: .04em;
  padding: 6px 9px; border-radius: 999px;
}
.sub-plan-name { font: 700 13px/1 var(--mono); letter-spacing: .06em; color: var(--muted); margin: 0; text-transform: uppercase; }
.sub-plan-price { font: 700 34px/1.1 Georgia, serif; margin: 0; }
.sub-plan-price span { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.sub-plan-note { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.6; flex: 1; }
.sub-plan-btn { width: 100%; margin-top: 6px; }
.sub-plan-btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
/* 月付会员才会看到：升级到年付的计费方式说明 */
.sub-upgrade-note {
  margin: 0 0 14px; padding: 10px 13px;
  font-size: 13px; line-height: 1.6; color: var(--ink);
  background: var(--accent-soft); border-radius: 10px;
}
/* 支付审核要求在结账路径上能看到条款与退款政策 */
.sub-legal { margin: 0 0 38px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.sub-legal a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.sub-legal a:hover { color: var(--accent); }

.sub-h2 { font: 700 22px/1.3 Georgia, serif; margin: 0 0 14px; }
.sub-benefits ul { margin: 0 0 38px; padding-left: 20px; color: var(--muted); line-height: 1.85; }
.sub-compare table { width: 100%; border-collapse: collapse; margin-bottom: 38px; font-size: 14px; }
.sub-compare th, .sub-compare td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; }
.sub-compare thead th {
  font: 700 11px/1 var(--mono); letter-spacing: .07em;
  color: var(--muted); text-transform: uppercase;
}
.sub-compare thead td { border-bottom: 1px solid var(--line); }
.sub-compare tbody th { font-weight: 650; }
.sub-faq { margin-bottom: 38px; }
.sub-faq-item { border-bottom: 1px solid var(--line); padding: 13px 0; }
.sub-faq-item summary { cursor: pointer; font-weight: 650; list-style: none; }
.sub-faq-item summary::-webkit-details-marker { display: none; }
.sub-faq-item summary::after { content: "+"; float: right; color: var(--muted); font-weight: 400; }
.sub-faq-item[open] summary::after { content: "–"; }
.sub-faq-item p { margin: 10px 0 0; color: var(--muted); line-height: 1.7; }

.sub-msg {
  margin: 0 0 18px; padding: 12px 14px;
  border-radius: 10px; font-size: 14px; line-height: 1.6;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
}
.sub-msg[data-tone="ok"] { border-color: #99f6e4; background: #ecfdf5; color: var(--good); }
.sub-msg[data-tone="error"] { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }

@media (max-width: 620px) {
  .acc-card { padding: 18px; }
  .acc-identity { flex-wrap: wrap; }
  .acc-identity .acc-btn--text { margin-left: auto; }
  .acc-signin-actions .acc-btn { width: 100%; }
  .acc-member-actions .acc-btn { width: 100%; }
  .sub-plans { grid-template-columns: 1fr; }
  .sub-compare th, .sub-compare td { padding: 10px 8px; font-size: 13px; }
  .sub-plan-price { font-size: 30px; }
}

/* 首屏状态：中间件把登录态写进 <html data-auth>，
   已登录时直接显示骨架，不会先闪一下登录按钮 */
.acc-skeleton { display: none; }
html[data-auth="in"] .acc-skeleton { display: block; }
html[data-auth="in"] [data-view="signed-out"] { display: none !important; }

.acc-skel-row { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.acc-skel-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent-soft, #eef2ff);
  flex: none;
}
.acc-skel-lines { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.acc-skel-lines i {
  display: block; height: 12px; border-radius: 6px;
  background: var(--accent-soft, #eef2ff);
}
.acc-skel-lines i:first-child { width: 42%; }
.acc-skel-lines i:last-child { width: 24%; }
.acc-skel-block {
  height: 132px; border-radius: var(--radius, 12px);
  background: var(--accent-soft, #eef2ff);
}
@media (prefers-reduced-motion: no-preference) {
  .acc-skeleton { animation: acc-skel-in .12s ease-out; }
  @keyframes acc-skel-in { from { opacity: .4 } to { opacity: 1 } }
}
