/* ==========================================================================
   会员自助门户 · 页面级样式（依赖 portal.css 的令牌与基础组件）
   ========================================================================== */

body { --member-gutter: 20px; }

.member-header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-inline: 0;
  padding-block: 0;
}

.member-header-inner strong { flex-shrink: 0; }

#workspace {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}

.member-nav {
  position: sticky;
  inset-block-start: 80px;
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
}

.member-nav button {
  justify-content: flex-start;
  min-height: 38px;
  padding: 0 12px 0 14px;
  border: 0;
  border-inline-start: 2px solid transparent;
  border-radius: 0 var(--r-s) var(--r-s) 0;
  background: transparent;
  color: var(--ink-2);
  text-align: start;
  font-size: 14px;
}

.member-nav button:hover { background: var(--surface); color: var(--ink); border-inline-start-color: var(--line-strong); }
.member-nav button[aria-current] {
  background: var(--accent-soft);
  border-inline-start-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.member-content {
  min-width: 0;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-1);
}

.member-content .workspace-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-block-end: 16px;
}

.member-content #heading { margin: 0; font-size: 20px; }

#all-licenses { min-height: 32px; padding: 0 10px; font-size: 13px; }

#notice:empty { display: none; }
#notice { background: var(--accent-soft); border-color: #dbe5ff; color: #1b3f8f; }

/* ---------- 登录 / 注册 ---------- */

.entry {
  width: min(420px, 100%);
  margin: clamp(28px, 8vw, 72px) auto;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-1);
}

.entry h1 { margin-block-end: 6px; font-size: 24px; }
.entry .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.entry .actions .plan-primary { flex: 1 1 140px; }
.entry #toggle-auth { border: 0; background: transparent; color: var(--accent); padding-inline: 4px; }
.entry #toggle-auth:hover { text-decoration: underline; }

/* ---------- 筛选 ---------- */

.member-content .filters { margin: 0 0 16px; padding: 12px; }
.member-content .filters label { flex: 0 1 220px; }
.member-content .filters #reset-filter { background: var(--surface); }

/* ---------- 套餐 ---------- */

#pricing-intro { max-width: 52ch; margin: 0 0 24px; color: var(--muted); }

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

.pricing-page { container-type: inline-size; }

@container (max-width: 760px) {
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container (max-width: 510px) {
  .plans { grid-template-columns: minmax(0, 1fr); }
}

.plan {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  transition: border-color var(--dur) var(--ease);
}

.plan:hover { border-color: var(--line-strong); }
.plan h2 { margin: 0 0 8px; font-size: 16px; color: var(--ink); overflow-wrap: anywhere; }
.plan-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px; margin: 0 0 16px; color: var(--muted); }
.plan-price strong { color: var(--accent); font-size: clamp(26px, 4cqi, 34px); line-height: 1.1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.plan-price span { font-size: 13px; }

.plan-features { margin: 0 0 16px; padding: 8px 12px; border-radius: var(--r-s); background: var(--accent-soft); font-size: 13px; }
.plan-features > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); align-items: baseline; gap: 8px; padding: 5px 0; }
.plan-features dt { color: var(--muted); }
.plan-features dd { margin: 0; color: var(--ink); font-weight: 500; text-align: end; overflow-wrap: anywhere; }
.plan-features .included { color: var(--ok); }
.plan-features .muted { color: var(--muted); }
.plan-notes { margin-block-end: 18px; padding-block-start: 12px; border-block-start: 1px solid var(--line); }
.plan-notes h3 { margin: 0 0 4px; color: var(--ink-2); font-size: 13px; }
.plan-notes .plan-description { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.plan > button { width: 100%; min-height: 40px; margin-block-start: auto; }

/* ---------- 我的授权 / 我的订单 ---------- */

.license-cards, .order-cards { display: grid; gap: 12px; }

.license-card, .order-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--surface);
}

.license-card-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-block-end: 6px; }
.license-card-heading h2 { min-width: 0; margin: 0; font-family: var(--mono); font-size: 15px; font-weight: 600; }
.license-card .license-identity, .license-card .license-expiry, .order-card .order-meta { color: var(--muted); font-size: 13px; }
.license-card .license-identity + .license-expiry { margin-block-start: 2px; }

.license-card-benefits { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 0; padding: 0; list-style: none; }
.license-card-benefits li {
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink-2);
  font-size: 12px;
}

.license-parent { min-height: 28px; padding: 0 7px; font-size: 12px; }
.license-parent:disabled { opacity: 1; color: var(--muted); }

.license-card > .actions, .order-card > .actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.license-card > .actions button, .order-card > .actions button { min-height: 32px; padding: 0 10px; font-size: 13px; }

.order-card .order-checkout { display: grid; justify-items: end; gap: 8px; }
.order-total { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.order-total span { color: var(--muted); font-size: 12px; }
.order-total strong { color: var(--ink); font-size: 20px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.order-card .order-domains { color: var(--muted); font-size: 13px; }
.order-card .order-domains ul { max-height: 150px; overflow: auto; margin: 4px 0; padding-inline-start: 20px; }
.order-card .actions { justify-content: flex-end; }

/* ---------- 账号设置 ---------- */

#password-form { max-width: 420px; }
#password-form button { justify-self: start; }

/* ---------- 操作弹窗 ---------- */

#operation { width: min(520px, calc(100% - 28px)); }
#operation-fields { display: grid; gap: 12px; }
#operation-fields p { color: var(--ink-2); }
#operation-fields .muted { color: var(--muted); font-size: 13px; }
#operation-status:not(:empty) { margin: 0; color: var(--danger); font-size: 13px; }
#operation output { margin: 0; }
#operation textarea { font-family: var(--mono); font-size: 12px; }

.dns-record { min-width: 0; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface-2); }
.dns-record-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 10px 12px;
  color: var(--ink-2);
  font-size: 12px;
}
.dns-record-meta p { flex-basis: 100%; margin: 0; }
.dns-record .license-copy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 12px; border-block-start: 1px solid var(--line); background: var(--surface); }
.dns-record .license-copy-row:last-child { border-radius: 0 0 var(--r-s) var(--r-s); }
.dns-record .license-copy-row strong { font-size: 12px; color: var(--muted); font-weight: 500; }
.dns-record-meta strong { font-size: 13px; color: var(--ink); font-weight: 600; }
.dns-record .license-copy-row code { grid-row: 2; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: 12px; overflow-wrap: anywhere; user-select: all; }
.dns-record .license-copy-row button { grid-column: 2; grid-row: 1 / span 2; align-self: center; min-height: 32px; font-size: 12px; }

.dns-refresh {
  justify-self: start;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
}

.dns-refresh:hover { color: var(--accent-hover); text-decoration: underline; }

/* ---------- 响应式 ---------- */

@media (max-width: 860px) {
  body { --member-gutter: 12px; }
  .member-header-inner { padding-block: 0; }
  #workspace { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .member-nav {
    position: static;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    border-block-end: 1px solid var(--line);
  }
  .member-nav button { flex: 0 0 auto; border: 1px solid transparent; border-radius: var(--r-s); text-align: center; padding: 0 12px; }
  .member-content { padding: 16px; border-radius: var(--r-m); }
  .member-content #heading { font-size: 18px; }
}

@media (max-width: 560px) {
  .entry { padding: 22px; margin-block: 24px; }
  .license-card, .order-card { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .license-card > .actions, .order-card > .actions {
    justify-content: flex-start;
    padding-block-start: 10px;
    border-block-start: 1px solid var(--line);
  }
  .license-card > .actions > button, .order-card > .actions > button { flex: 1 1 auto; }
  .order-card .order-checkout { justify-items: start; padding-block-start: 10px; border-block-start: 1px solid var(--line); }
  .filters label { flex: 1 1 140px; }
}

.plan-description { white-space: pre-line; overflow-wrap: anywhere; }
