/* ==========================================================================
   DeskPan 账号中心
   复用 app.css 的 token 与基础组件（.btn / .pill / .field / table.data），
   这里只补布局与账号中心特有的展示块
   ========================================================================== */

body.acct {
  background: var(--bg);
  font-size: 14px;
  min-height: 100vh;
}

.acct-wrap {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 顶栏 ---------- */
.acct-top {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.acct-top-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 60px;
}

.acct-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 600;
  font-size: 14.5px;
  flex: 0 0 auto;
}

.acct-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3f78f7, #2459d4);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.acct-tabs {
  display: flex;
  gap: 4px;
  margin-left: 8px;
  flex: 1;
  min-width: 0;
}

.acct-tabs a {
  padding: 6px 11px;
  border-radius: 7px;
  font-size: 13.5px;
  color: var(--text-2);
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease;
}

.acct-tabs a:hover {
  background: var(--surface-sunken);
  color: var(--text);
}

.acct-tabs a.on {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.acct-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.acct-link {
  font-size: 13px;
  color: var(--text-2);
}
.acct-link:hover { color: var(--text); }

.acct-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.acct-logout button {
  border: 0;
  background: transparent;
  color: var(--text-3);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}
.acct-logout button:hover { background: var(--surface-sunken); color: var(--text-2); }

/* ---------- 主体 ---------- */
.acct-main { padding: 34px 0 64px; }

/* 页头与内容块的间距统一由 .acct-body-inner 的 gap 控制，避免叠加成 40px */
.acct-head { margin-bottom: 0; }
.acct-head h1 {
  font-size: 22px;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.acct-head p { color: var(--text-2); font-size: 13.5px; }

/* ---------- 卡片 ---------- */
.acct-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}

.acct-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.acct-card-head h2 {
  font-size: 13.5px;
  font-weight: 600;
}

.acct-card-head .spacer { flex: 1; }

.acct-card-body { padding: 16px 18px; }
.acct-card-body.tight { padding: 0; }

/* 两列布局：列间距与内容区纵向节奏保持一致 */
.acct-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.acct-grid .acct-card { margin-bottom: 0; }

@media (max-width: 720px) {
  .acct-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 会员卡 ---------- */
.acct-plan {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.acct-plan-sub {
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 2px;
}

.acct-meta {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.7;
}

.acct-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

/* 进度条：会员剩余天数 */
.acct-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-sunken);
  overflow: hidden;
  margin: 12px 0 6px;
}
.acct-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #5d8bf9, var(--brand));
}

/* ---------- 键值表 ---------- */
.acct-kv {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px 14px;
  margin: 0;
  font-size: 13.5px;
}
.acct-kv dt { color: var(--text-3); font-size: 12.5px; }
.acct-kv dd { margin: 0; color: var(--text); word-break: break-all; }

@media (max-width: 560px) {
  .acct-kv { grid-template-columns: 84px minmax(0, 1fr); }
}

/* ---------- 权益清单 ---------- */
.acct-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
}

.acct-feature {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}
.acct-feature .k { color: var(--text-3); font-size: 12.5px; }
.acct-feature .v { color: var(--text); font-weight: 500; margin-left: auto; }

@media (max-width: 560px) {
  .acct-features { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 快捷操作 ---------- */
.acct-quick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.acct-quick a {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  color: var(--text);
  font-size: 13px;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.acct-quick a:hover {
  background: var(--surface);
  border-color: var(--border-strong);
  transform: translateY(-1px);
  color: var(--text);
}

.acct-quick a span {
  font-size: 11.5px;
  color: var(--text-3);
}

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

/* ---------- 套餐对比 ---------- */
/* 卡片样式在 static/css/plan-tiers.css，与官网价格页共用；这里不再重复定义。 */

/* ---------- 表单 ---------- */
.acct-form { max-width: 380px; }

.acct-form .field:last-of-type { margin-bottom: 16px; }

.acct-inline-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.acct-inline-form .field { flex: 1 1 240px; margin-bottom: 0; }

/* ---------- 空态 ---------- */
.acct-empty {
  text-align: center;
  padding: 34px 16px;
  color: var(--text-3);
  font-size: 13px;
}
.acct-empty strong {
  display: block;
  color: var(--text-2);
  font-size: 13.5px;
  margin-bottom: 4px;
  font-weight: 500;
}

/* ---------- 提示条 ---------- */
.acct-note {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: #2a4fa8;
  font-size: 12.5px;
  line-height: 1.6;
}

.acct-note.warn { background: var(--warning-soft); color: #92560a; }

/* 授权页设备信息：键值两列，避免 acct-note 的 flex 把六项挤成一行 */
.acct-device {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 14px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.6;
}

.acct-device dt { color: var(--text-3); }
.acct-device dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- 移动端顶栏 ---------- */
@media (max-width: 760px) {
  .acct-top-inner {
    height: auto;
    padding-top: 10px;
    padding-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px 14px;
  }
  .acct-tabs {
    order: 3;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .acct-brand-name { display: none; }
  .acct-main { padding: 22px 0 48px; }
}


/* ---------- 账号中心登录页 ---------- */
.acct-auth {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  /* 上下留白随视口高度伸缩：矮屏不挤、高屏不贴顶 */
  padding: clamp(32px, 7vh, 76px) 20px;
  background:
    radial-gradient(50% 40% at 50% 0%, rgba(47, 107, 246, 0.08), transparent 70%),
    var(--bg);
}

.acct-auth-brand { margin-bottom: 2px; color: var(--text); }

.acct-auth-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 26px 24px 22px;
}

/* 登录 / 注册 页签 */
.acct-auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-sunken);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
}

.acct-auth-tabs button {
  flex: 1;
  height: 32px;
  border: 0;
  background: transparent;
  border-radius: 7px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text-2);
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}

.acct-auth-tabs button:hover { color: var(--text); }

.acct-auth-tabs button.on {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

.acct-auth-card h1 {
  font-size: 19px;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.acct-auth-sub {
  font-size: 12.5px;
  color: var(--text-3);
  margin-bottom: 22px;
}

.acct-auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
}

.acct-auth-links a { color: var(--text-2); }
.acct-auth-links a:hover { color: var(--brand); }

.acct-auth-foot { font-size: 11.5px; color: var(--text-3); }

/* 覆盖授权确认弹窗：授权卡只有 360px，弹窗不要比卡片宽太多 */
.acct-auth-modal { max-width: 400px; }
.acct-overwrite-device { margin-bottom: 10px; }
.acct-overwrite-device:last-of-type { margin-bottom: 0; }


/* ---------- 左侧导航布局（P1） ---------- */
.acct-shell { display: flex; min-height: 100vh; }

.acct-side {
  width: 236px;
  flex: 0 0 236px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.acct-side-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 20px 18px 16px;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text);
}

.acct-nav { padding: 4px 10px; flex: 1; overflow-y: auto; }

.acct-nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-2);
  margin-bottom: 2px;
  transition: background .16s ease, color .16s ease;
}
.acct-nav a:hover { background: var(--surface-sunken); color: var(--text); }
.acct-nav a.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

.acct-nav-ico { width: 16px; text-align: center; opacity: .82; font-size: 13px; }

.acct-nav-title {
  font-size: 11.5px;
  color: var(--text-3);
  padding: 16px 11px 6px;
  letter-spacing: .04em;
}

.acct-side-foot {
  border-top: 1px solid var(--border);
  padding: 14px 16px 16px;
  display: grid;
  gap: 8px;
}

.acct-user-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.acct-user-meta { min-width: 0; display: grid; }
.acct-user-meta strong { font-size: 13px; }
.acct-user-meta span {
  font-size: 11.5px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acct-side-link { font-size: 12.5px; color: var(--text-2); }
.acct-side-link:hover { color: var(--brand); }

.acct-side-logout button {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
}
.acct-side-logout button:hover { color: var(--danger); }

.acct-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.acct-body-head {
  height: 56px;
  flex: 0 0 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  /* 内容区改为左对齐后，顶栏只需与它保持同样的左内边距 */
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.acct-breadcrumb { font-size: 12.5px; color: var(--text-3); }
.acct-body-actions { margin-left: auto; display: flex; gap: 8px; }

.acct-body-inner {
  /* 不设 max-width / margin auto：内容整体靠左，只留固定左内边距。
     原先 max-width:940px + margin:0 auto 会让宽屏下内容被推到中间，
     右侧空出一大片，和后台控制台的左对齐布局不一致。 */
  padding: 26px 40px 56px 28px;
  width: 100%;
  /* 统一纵向节奏：区块间距由 gap 控制，
     避免「并排卡片（.acct-grid）后紧跟卡片」时两边间距为 0 */
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* 间距统一由父容器 gap 控制，清掉子块自身的下外边距，避免叠加；
   同时禁止压缩高度，否则内容较高时卡片底边会被裁掉 */
.acct-body-inner > * { margin-bottom: 0; flex: 0 0 auto; }

/* ---------- 概览：问候 + 会员卡 + 行式信息 ---------- */
/* 纵向间距统一由 .acct-body-inner 的 gap 控制，这里不再自带下外边距 */
.acct-hello { margin-bottom: 0; }
.acct-hello h1 { font-size: 24px; letter-spacing: -0.02em; margin-bottom: 6px; }
.acct-hello p { color: var(--text-2); font-size: 13.5px; }

.acct-member {
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  /* 纵向节奏统一由 .acct-body-inner 的 gap 控制，这里不再叠加下外边距 */
  margin-bottom: 0;
  color: #fff;
  background: linear-gradient(135deg, #2f6bf6 0%, #2450d8 100%);
  box-shadow: 0 18px 40px -28px rgba(47, 107, 246, 0.85);
}

.acct-member.off {
  background: linear-gradient(135deg, #8a94a6, #6b7688);
  box-shadow: none;
}

.acct-member-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.acct-member-name { font-size: 16px; font-weight: 650; display: flex; align-items: center; gap: 7px; }

.acct-member-cta {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 12.5px;
  padding: 6px 13px;
  border-radius: 999px;
  transition: background .16s ease;
}
.acct-member-cta:hover { background: rgba(255, 255, 255, 0.3); color: #fff; }

.acct-member-meta { font-size: 12.5px; opacity: 0.92; margin-bottom: 14px; line-height: 1.7; }
.acct-member-row { font-size: 13px; margin-bottom: 6px; }
.acct-member-note { font-size: 12.5px; opacity: 0.82; margin-bottom: 14px; }

.acct-member-refresh {
  display: inline-block;
  background: #fff;
  color: #2450d8;
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
}
.acct-member-refresh:hover { background: #f2f6ff; color: #2450d8; }

/* ---------- 每日额度卡 ----------
   单行结构：功能名（定宽） + 通栏进度条 + 「剩余 / 上限 次」；
   进度条吃掉所有弹性宽度，宽屏下不会像两列并排那样中间空一大段。 */
.acct-quota-upgrade {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--brand);
}
.acct-quota-upgrade:hover { color: var(--brand-hover); }

.acct-quotas {
  display: flex;
  flex-direction: column;
}

/* 功能名 84px + 间距 14px：底部说明按同样缩进对齐进度条起点 */
.acct-quotas { --quota-label-w: 84px; --quota-gap: 14px; }

.acct-quota {
  padding: 12px 0;
}
.acct-quota + .acct-quota { border-top: 1px dashed var(--border); }
.acct-quota:first-child { padding-top: 2px; }
.acct-quota:last-child { padding-bottom: 2px; }

.acct-quota-row {
  display: flex;
  align-items: center;
  gap: var(--quota-gap);
}

.acct-quota-label {
  flex: 0 0 var(--quota-label-w);
  font-size: 13px;
  color: var(--text-2);
}

.acct-quota-row .acct-bar {
  flex: 1 1 auto;
  height: 6px;
  margin: 0;
  background: var(--surface-sunken);
}

/* 进度条长度 = 剩余比例，和右侧数字同向：越短越该注意 */
.acct-quota .acct-bar i { background: var(--brand); }
.acct-quota.warn .acct-bar i { background: var(--warning); }
.acct-quota.empty .acct-bar i { background: var(--danger); }

.acct-quota-value {
  flex: 0 0 auto;
  min-width: 92px;
  text-align: right;
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.acct-quota-value b {
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
  margin-right: 1px;
}
.acct-quota.warn .acct-quota-value b { color: var(--warning); }
.acct-quota.empty .acct-quota-value b { color: var(--danger); }

.acct-quota-foot {
  margin: 6px 0 0 calc(var(--quota-label-w) + var(--quota-gap));
  font-size: 12px;
  color: var(--text-3);
}
.acct-quota.empty .acct-quota-foot { color: var(--danger); }

@media (max-width: 560px) {
  .acct-quotas { --quota-label-w: 72px; --quota-gap: 10px; }
  .acct-quota-value { min-width: 76px; }
}

.acct-rows { margin: 0; padding: 0 18px; }
.acct-rows > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.acct-rows > div:last-child { border-bottom: 0; }
.acct-rows dt { font-size: 13px; color: var(--text-2); }
.acct-rows dd { margin: 0; font-size: 13px; color: var(--text); text-align: right; word-break: break-all; }

.acct-mini { display: flex; align-items: center; gap: 16px; padding: 18px; }
.acct-mini h2 { font-size: 14px; margin-bottom: 5px; }
.acct-mini p { font-size: 12.5px; color: var(--text-3); line-height: 1.6; }
.acct-mini .btn { margin-left: auto; flex: 0 0 auto; }

@media (max-width: 860px) {
  .acct-shell { flex-direction: column; }
  .acct-side {
    width: 100%;
    flex: 0 0 auto;
    height: auto;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .acct-nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 8px 12px;
  }
  .acct-nav a { white-space: nowrap; margin-bottom: 0; }
  .acct-nav-title, .acct-side-foot { display: none; }
  .acct-body-head { padding: 0 18px; }
  /* 窄屏收窄纵向节奏，避免一行卡片占满整屏高度 */
  .acct-body-inner { padding: 20px 18px 44px; gap: 14px; }
  .acct-member { padding: 18px; }
}


/* 登录/验证结果页的状态图标 */
.acct-auth-ico {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 14px;
}
.acct-auth-ico.ok { background: var(--success-soft); color: var(--success); }
.acct-auth-ico.bad { background: var(--danger-soft); color: var(--danger); }
