:root {
  --ink: #18212b;
  --muted: #617080;
  --line: #d9e0e6;
  --surface: #ffffff;
  --canvas: #f4f6f8;
  --navy: #17324d;
  --blue: #1769aa;
  --blue-dark: #0f5188;
  --green: #1f7a53;
  --green-soft: #e7f4ed;
  --amber: #9a5a00;
  --amber-soft: #fff2d7;
  --red: #a83232;
  --red-soft: #fbe9e9;
  --shadow: 0 8px 24px rgba(23, 50, 77, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 6px;
  font-size: 19px;
  letter-spacing: 0;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.header-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  font-weight: 700;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: var(--navy);
  font-size: 13px;
  letter-spacing: 0;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-nav > a {
  padding: 8px 10px;
  border-radius: 6px;
  color: #334252;
  font-weight: 600;
}

.main-nav > a:hover {
  background: #eef2f5;
  text-decoration: none;
}

.page {
  min-height: calc(100vh - 118px);
  padding-top: 36px;
  padding-bottom: 56px;
}

.site-footer {
  padding: 18px 0 26px;
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.lead {
  max-width: 620px;
  color: var(--muted);
  font-size: 17px;
}

.auth-layout {
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  align-items: center;
  gap: 72px;
}

.auth-copy h1 {
  max-width: 650px;
  font-size: 44px;
}

.form-panel,
.section-panel,
.gate-panel,
.callout {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.form-panel {
  padding: 28px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field label {
  color: #2c3b49;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #bcc8d2;
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(23, 105, 170, 0.14);
}

.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.form-switch {
  margin: 18px 0 0;
  color: var(--muted);
  text-align: center;
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
}

.button:hover {
  text-decoration: none;
}

.button-primary {
  color: #fff;
  background: var(--blue);
}

.button-primary:hover {
  background: var(--blue-dark);
}

.button-secondary {
  color: var(--navy);
  border-color: #b9c6d2;
  background: #fff;
}

.button-secondary:hover {
  background: #eef3f6;
}

.button-quiet {
  min-height: 36px;
  color: #415161;
  background: transparent;
}

.button-quiet:hover {
  background: #eef2f5;
}

.button-danger {
  color: var(--red);
  border-color: #e4b8b8;
  background: #fff;
}

.button-danger:hover {
  background: var(--red-soft);
}

.button-disabled,
.button:disabled {
  color: #778492;
  border-color: #d5dce2;
  background: #eef1f4;
  cursor: not-allowed;
}

.button-wide {
  width: 100%;
}

.button-small {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

.inline-form {
  display: inline;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.flash {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.flash-success {
  color: #155e40;
  border-color: #b9ddca;
  background: var(--green-soft);
}

.flash-error {
  color: #7d2929;
  border-color: #edc5c5;
  background: var(--red-soft);
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.status-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  overflow: hidden;
}

.status-item {
  min-width: 0;
  padding: 20px 22px;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
}

.status-item:last-child {
  border-right: 0;
}

.status-label {
  display: block;
  margin-bottom: 4px;
  color: #bfd0de;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-item strong {
  overflow-wrap: anywhere;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.content-grid-wide {
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  margin-bottom: 20px;
}

.section-panel {
  margin-bottom: 20px;
  padding: 22px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.inline-action-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.compact-form {
  display: grid;
  grid-template-columns: minmax(90px, 0.7fr) minmax(110px, 0.8fr) auto;
  align-items: end;
  gap: 12px;
}

.compact-form .field,
.stacked-form .field {
  margin-bottom: 0;
}

.stacked-form {
  display: grid;
  gap: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
}

.status-active {
  color: #155e40;
  background: var(--green-soft);
}

.status-inactive {
  color: #7d4a00;
  background: var(--amber-soft);
}

.status-blocked {
  color: #7d2929;
  background: var(--red-soft);
}

.status-neutral {
  color: #34495c;
  background: #e9eef2;
}

.gate-panel {
  max-width: 760px;
  padding: 40px;
}

.gate-panel .lead {
  margin-bottom: 24px;
}

.callout {
  margin-bottom: 20px;
  padding: 20px;
}

.callout-warning {
  border-color: #e5c477;
  background: #fffaf0;
}

.callout-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.callout-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.code-list {
  min-height: 170px;
  font-family: Consolas, "Courier New", monospace;
  resize: vertical;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric span {
  color: var(--muted);
  font-weight: 700;
}

.metric strong {
  color: var(--navy);
  font-size: 26px;
}

.table-section {
  padding: 0;
}

.table-section .section-heading {
  padding: 22px 22px 0;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 11px 12px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #4d5d6c;
  background: #f8fafb;
  font-size: 12px;
  text-transform: uppercase;
}

td strong {
  display: block;
  overflow-wrap: anywhere;
}

.table-note {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.table-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-small {
  width: 76px;
  min-height: 34px;
  padding: 6px 8px;
}

.input-medium {
  width: 104px;
  min-height: 34px;
  padding: 6px 8px;
}

.metadata-cell {
  max-width: 380px;
  overflow-wrap: anywhere;
  color: #4d5d6c;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

.empty-state {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.detail-list div {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.detail-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.detail-list dd {
  margin: 3px 0 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.sr-only {
  width: 1px;
  height: 1px;
  position: absolute;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

code {
  color: #31475c;
  font-family: Consolas, "Courier New", monospace;
}

@media (max-width: 900px) {
  .auth-layout {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .auth-copy h1 {
    font-size: 36px;
  }

  .content-grid,
  .content-grid-wide {
    grid-template-columns: 1fr;
  }

  .status-band,
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .status-item {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  }

  .status-item:last-child {
    border-bottom: 0;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(100% - 22px, 1180px);
  }

  .header-inner {
    min-height: auto;
    align-items: flex-start;
    flex-direction: column;
    padding: 13px 0;
    gap: 8px;
  }

  .main-nav {
    width: 100%;
    flex-wrap: wrap;
  }

  .page {
    padding-top: 24px;
  }

  h1 {
    font-size: 28px;
  }

  .auth-copy h1 {
    font-size: 31px;
  }

  .form-panel,
  .gate-panel {
    padding: 20px;
  }

  .page-heading,
  .section-heading,
  .callout-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .inline-action-form,
  .compact-form {
    grid-template-columns: 1fr;
  }

  .compact-form .button,
  .inline-action-form .button {
    width: 100%;
  }

  .table-form {
    align-items: stretch;
    flex-direction: column;
  }

  .input-small,
  .input-medium {
    width: 100%;
  }
}

.main-nav > a[aria-current="page"] {
  color: var(--navy);
  background: #e8eff4;
}

.member-page {
  display: grid;
  gap: 22px;
}

.member-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  align-items: center;
  gap: 40px;
  padding: 38px 40px;
  border: 1px solid #274d6b;
  border-radius: 8px;
  color: #fff;
  background: #173b59;
  box-shadow: 0 18px 40px rgba(15, 42, 63, 0.16);
}

.member-hero .eyebrow {
  color: #76d4c7;
}

.member-hero h1 {
  max-width: 660px;
  margin-bottom: 12px;
  font-size: 38px;
}

.member-hero .lead {
  max-width: 660px;
  margin-bottom: 24px;
  color: #c9d9e5;
}

.member-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button-ghost-light {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.07);
}

.button-ghost-light:hover {
  background: rgba(255, 255, 255, 0.14);
}

.member-hero .button-disabled {
  color: #bdcbd6;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

.membership-pass {
  min-width: 0;
  padding: 22px 24px 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-top: 3px solid #55c6b8;
  border-radius: 8px;
  background: #102d45;
  box-shadow: 0 14px 30px rgba(5, 24, 38, 0.28);
}

.membership-pass-blocked {
  border-top-color: #df7b7b;
}

.membership-pass-inactive {
  border-top-color: #e0aa52;
}

.membership-pass-head,
.membership-pass-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.membership-pass-brand {
  color: #9fb5c6;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.membership-pass .status-pill {
  min-height: 26px;
  padding: 3px 9px;
  font-size: 12px;
}

.membership-pass .status-active {
  color: #c9fff7;
  background: rgba(85, 198, 184, 0.17);
}

.membership-pass .status-inactive {
  color: #ffe4b2;
  background: rgba(224, 170, 82, 0.18);
}

.membership-pass .status-blocked {
  color: #ffd0d0;
  background: rgba(223, 123, 123, 0.18);
}

.membership-pass-plan {
  display: grid;
  gap: 4px;
  margin: 24px 0 22px;
}

.membership-pass-plan span,
.membership-pass-meta dt,
.membership-pass-foot span {
  color: #91a9bc;
  font-size: 12px;
  font-weight: 700;
}

.membership-pass-plan strong {
  color: #fff;
  font-size: 28px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.membership-pass-meta {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  gap: 18px;
  margin: 0;
}

.membership-pass-meta div {
  min-width: 0;
}

.membership-pass-meta dd {
  margin: 4px 0 0;
  color: #e6eef4;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.membership-pass-foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.membership-pass-foot strong {
  color: #7be0d2;
  font-size: 20px;
}

.member-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: start;
  gap: 20px;
}

.member-content-grid .section-panel {
  margin-bottom: 0;
}

.section-kicker {
  margin-bottom: 5px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.redeem-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.redeem-form .field {
  margin-bottom: 0;
}

.redeem-form .button {
  min-width: 116px;
}

.redeem-guidance {
  margin-top: 16px;
  padding: 14px 16px;
  border-left: 3px solid #3b9c90;
  background: #f1f7f6;
}

.redeem-guidance strong {
  color: #245c56;
}

.redeem-guidance p {
  margin: 3px 0 0;
  color: #526d69;
  font-size: 13px;
}

.benefit-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.benefit-list li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.benefit-list li:first-child {
  padding-top: 0;
  border-top: 0;
}

.benefit-dot {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: #b9c4cd;
}

.benefit-dot.is-ready {
  background: #2e9a87;
  box-shadow: 0 0 0 4px rgba(46, 154, 135, 0.1);
}

.benefit-dot.is-next {
  background: #d29a3d;
  box-shadow: 0 0 0 4px rgba(210, 154, 61, 0.1);
}

.benefit-copy {
  min-width: 0;
}

.benefit-copy strong {
  color: #293a49;
}

.benefit-copy p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.benefit-state {
  color: #7a8792;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.benefit-state.is-ready {
  color: #247362;
}

.benefit-state.is-next {
  color: #986719;
}

@media (max-width: 900px) {
  .member-hero,
  .member-content-grid {
    grid-template-columns: 1fr;
  }

  .member-hero {
    gap: 28px;
  }
}

@media (max-width: 680px) {
  .member-hero {
    padding: 24px 20px;
  }

  .member-hero h1 {
    font-size: 30px;
  }

  .member-actions,
  .member-actions .button {
    width: 100%;
  }

  .membership-pass {
    padding: 20px;
  }

  .membership-pass-plan strong {
    font-size: 24px;
  }

  .membership-pass-meta {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .redeem-form {
    grid-template-columns: 1fr;
  }

  .redeem-form .button {
    width: 100%;
  }

  .benefit-list li {
    grid-template-columns: 10px minmax(0, 1fr);
  }

  .benefit-state {
    grid-column: 2;
  }
}

.admin-auth-page {
  color: #e8ecef;
  background: #171c21;
}

.admin-auth-page .site-header {
  border-color: #30373f;
  background: #11161a;
}

.admin-auth-page .brand {
  color: #f4f6f7;
}

.admin-auth-page .brand-mark {
  background: #b8582f;
}

.admin-auth-page .page {
  padding-top: 28px;
}

.admin-auth-page .site-footer {
  color: #8f99a1;
}

.admin-auth-page .flash-stack {
  width: min(1040px, 100%);
  margin: 0 auto 18px;
}

.admin-auth-page .flash {
  color: #ffe2d5;
  border-color: #74432e;
  background: #35251e;
}

.admin-login-layout {
  width: min(1040px, 100%);
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  margin: 0 auto;
  border: 1px solid #353d45;
  border-radius: 8px;
  background: #20262d;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.admin-login-intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  background: #20262d;
}

.admin-login-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-login-identity > span:last-child {
  display: grid;
  gap: 1px;
}

.admin-login-identity strong {
  color: #f3f5f6;
  font-size: 14px;
}

.admin-login-identity small {
  color: #8f9aa3;
  font-size: 12px;
}

.admin-login-mark {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: #b8582f;
  font-size: 13px;
  font-weight: 800;
}

.admin-login-copy {
  max-width: 540px;
  margin: 54px 0;
}

.admin-only-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 18px;
  padding: 3px 9px;
  border: 1px solid #8e4b2d;
  border-radius: 4px;
  color: #ffc2a5;
  background: rgba(184, 88, 47, 0.12);
  font-size: 12px;
  font-weight: 800;
}

.admin-login-copy h1 {
  margin-bottom: 14px;
  color: #fff;
  font-size: 44px;
}

.admin-login-copy p {
  margin-bottom: 0;
  color: #bfc7ce;
  font-size: 17px;
}

.admin-login-scope {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  border: 1px solid #394149;
  border-radius: 6px;
  background: #394149;
  overflow: hidden;
}

.admin-login-scope div {
  min-width: 0;
  padding: 14px;
  background: #191f24;
}

.admin-login-scope dt {
  color: #eef1f3;
  font-size: 12px;
  font-weight: 800;
}

.admin-login-scope dd {
  margin: 5px 0 0;
  color: #939da6;
  font-size: 12px;
  line-height: 1.45;
}

.admin-login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
  color: #20252a;
  background: #f4f5f5;
}

.admin-login-card-heading {
  margin-bottom: 26px;
}

.admin-card-label {
  display: block;
  margin-bottom: 8px;
  color: #a74e2a;
  font-size: 11px;
  font-weight: 800;
}

.admin-login-card-heading h2 {
  margin-bottom: 6px;
  color: #20252a;
  font-size: 26px;
}

.admin-login-card-heading p {
  margin-bottom: 0;
  color: #69737b;
}

.admin-login-form .field {
  margin-bottom: 17px;
}

.admin-login-form .field label {
  color: #3d454c;
}

.admin-login-form input {
  border-color: #b8bec3;
  background: #fff;
}

.admin-login-form input:focus {
  border-color: #b8582f;
  outline-color: rgba(184, 88, 47, 0.16);
}

.admin-login-button {
  color: #fff;
  background: #252c32;
}

.admin-login-button:hover {
  background: #11161a;
}

.admin-login-security {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: #737d85;
  font-size: 12px;
}

.admin-login-security p {
  margin: 0;
}

.admin-security-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #b8582f;
}

.admin-page {
  color: #242a30;
  background: #eceff1;
}

.admin-page .site-header {
  border-color: #30363c;
  background: #171c21;
}

.admin-page .brand {
  color: #f4f6f7;
}

.admin-page .brand-mark {
  background: #b8582f;
}

.admin-page .main-nav > a {
  color: #ced5da;
}

.admin-page .main-nav > a:hover,
.admin-page .main-nav > a[aria-current="page"] {
  color: #fff;
  background: #2b333a;
}

.admin-page .button-quiet {
  color: #cbd2d7;
}

.admin-page .button-quiet:hover {
  background: #2b333a;
}

.admin-page .eyebrow,
.error-page .eyebrow {
  color: #a74e2a;
}

.admin-page-heading {
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid #ccd2d6;
}

.admin-page-summary {
  margin-bottom: 0;
  color: #65717a;
}

.admin-page-badge {
  min-width: 150px;
  display: grid;
  gap: 3px;
  padding: 13px 16px;
  border: 1px solid #c7ccd0;
  border-left: 4px solid #b8582f;
  border-radius: 6px;
  background: #fff;
}

.admin-page-badge span {
  color: #9c4d2c;
  font-size: 11px;
  font-weight: 800;
}

.admin-page-badge strong {
  color: #293139;
}

.admin-page .metric {
  border-color: #d0d5d9;
  border-top: 3px solid #b8582f;
  box-shadow: 0 5px 14px rgba(31, 38, 44, 0.05);
}

.admin-page .metric strong {
  color: #293139;
}

.admin-page .section-panel {
  border-color: #d1d6da;
  box-shadow: 0 7px 18px rgba(31, 38, 44, 0.06);
}

.admin-page .button-primary {
  background: #2c343b;
}

.admin-page .button-primary:hover {
  background: #151a1f;
}

.admin-page .button-secondary {
  color: #343c43;
  border-color: #bdc4ca;
  background: #f8f9fa;
}

.admin-page .button-secondary:hover {
  background: #e9ecee;
}

.admin-page .section-kicker {
  color: #a74e2a;
}

.error-page {
  background: #eceff1;
}

.error-panel {
  max-width: 860px;
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  align-items: center;
  gap: 36px;
  margin: 64px auto 0;
  padding: 40px;
  border: 1px solid #cbd1d5;
  border-top: 4px solid #283139;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(31, 38, 44, 0.08);
}

.error-code {
  color: #283139;
  font-size: 68px;
  font-weight: 800;
  line-height: 1;
}

.error-copy h1 {
  margin-bottom: 8px;
}

.error-copy p:not(.eyebrow) {
  margin-bottom: 22px;
  color: #65717a;
}

@media (max-width: 900px) {
  .admin-login-layout {
    grid-template-columns: 1fr;
  }

  .admin-login-intro {
    gap: 34px;
  }

  .admin-login-copy {
    margin: 0;
  }
}

@media (max-width: 680px) {
  .admin-auth-page .page {
    padding-top: 18px;
  }

  .admin-login-intro,
  .admin-login-card {
    padding: 28px 22px;
  }

  .admin-login-copy h1 {
    font-size: 34px;
  }

  .admin-login-copy p {
    font-size: 15px;
  }

  .admin-login-scope {
    grid-template-columns: 1fr;
  }

  .admin-page-heading {
    align-items: flex-start;
  }

  .admin-page-badge {
    width: 100%;
  }

  .error-panel {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-top: 24px;
    padding: 26px 22px;
  }

  .error-code {
    font-size: 52px;
  }
}

/* ============================================================
   用户端门户的少量补充样式（阶段 6）
   本段会被拼进 styles.css（在 _styles.base.css 之后、ch-console/ch-admin 之前）。

   只做两件事，不新造视觉体系：
     1) 站点公告横幅（内容来自后台「公告与免责声明」）
     2) 页脚：品牌页脚文案 + 客服联系 + 可折叠免责声明
   沿用 base 里已有的 --ink/--muted/--line/--surface/--amber-soft 等变量。
   ============================================================ */

/* ── 公告横幅 ── */
/* 结构是 <div class="site-announcement"><div class="shell">…</div></div>，
   所以外层做通栏色带、内层用 .shell 对齐正文宽度。 */
.site-announcement {
  margin-top: 14px;
  padding: 11px 0;
  border-top: 1px solid #e6cf9a;
  border-bottom: 1px solid #e6cf9a;
  border-left: 0;
  background: var(--amber-soft);
  color: #6b4a12;
}

.site-announcement .shell {
  border-left: 4px solid var(--amber);
  padding-left: 12px;
}

.site-announcement-title {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 700;
}

.site-announcement-body {
  font-size: 13.5px;
  line-height: 1.55;
  /* 后台是 textarea，换行要保留（不能塞 HTML，所以用 pre-line） */
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* 管理员页面不显示公告，但保险起见也留一条 */
.admin-page .site-announcement,
.admin-auth-page .site-announcement {
  display: none;
}

/* ── 页脚 ── */
.site-footer .footer-line {
  margin: 0;
}

.site-footer .footer-contact {
  margin-top: 4px;
}

.footer-disclaimer {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.footer-disclaimer > summary {
  cursor: pointer;
  list-style: none;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
}

.footer-disclaimer > summary::-webkit-details-marker {
  display: none;
}

.footer-disclaimer > summary::after {
  content: " ▾";
}

.footer-disclaimer[open] > summary::after {
  content: " ▴";
}

.footer-disclaimer-body {
  margin-top: 8px;
  max-width: 760px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* 管理后台是深色页脚，别用浅色变量里的蓝色链接 */
.admin-page .footer-disclaimer > summary,
.admin-auth-page .footer-disclaimer > summary {
  color: #d99a7c;
}

.admin-page .footer-disclaimer {
  border-top-color: #3a4249;
}

.admin-page .footer-disclaimer-body,
.admin-auth-page .footer-disclaimer-body {
  color: #9aa4ac;
}

/* ── 用户端「群发服务」术语统一后的少量排版修正 ── */
.member-hero-copy .lead {
  max-width: 620px;
}

@media (max-width: 680px) {
  .site-announcement {
    margin-top: 10px;
    padding: 10px 12px;
  }
}

/* ============================================================
   圆头云端控制台（阶段 2 接入）
   本段会被追加到 styles.css 末尾；只用已有的设计变量，不重复定义。
   移动端竖屏优先：一屏放得下发送按钮。
   ============================================================ */

/* ★ 关键：本段的类里有用到 display（.ch-sendbar / .button 等），
   作者样式会盖掉浏览器默认的 [hidden]{display:none}，导致"该隐藏的没隐藏"。
   实测踩到过：未绑定时底部的「一键群发」条、已连接时的「重新连接」按钮都露出来了。 */
[hidden] {
  display: none !important;
}

.ch-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 84px;            /* 给底部固定的发送按钮留位置 */
}

.ch-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ch-head h1 {
  font-size: 26px;
  margin-bottom: 4px;
}

.ch-member {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

.ch-member strong {
  color: var(--ink);
  font-weight: 600;
}

.ch-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.ch-card h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

.ch-card > p.ch-hint {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}

/* ── 连接状态条 ── */
.ch-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 12px;
}

.ch-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(97, 112, 128, 0.12);
}

.ch-dot-green {
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
  animation: ch-pulse 2.4s ease-in-out infinite;
}

.ch-dot-amber {
  background: var(--amber);
  box-shadow: 0 0 0 4px var(--amber-soft);
  animation: ch-pulse 1.2s ease-in-out infinite;
}

.ch-dot-red {
  background: var(--red);
  box-shadow: 0 0 0 4px var(--red-soft);
}

@keyframes ch-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  .ch-dot-green,
  .ch-dot-amber { animation: none; }
}

.ch-status-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.ch-status-copy strong {
  display: block;
  font-size: 16px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ch-muted {
  color: var(--muted);
  font-size: 13px;
}

.ch-counts {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 12px;
}

.ch-counts strong {
  color: var(--ink);
}

/* ── 表单 ── */
.ch-form .field {
  margin-bottom: 12px;
}

.ch-composer textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  font: inherit;
  color: var(--ink);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.ch-composer textarea:focus,
.ch-form input:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.ch-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.ch-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* 多图缩略图：样式统一在文件末尾的阶段 5 段里定义（此处不再重复，
   否则旧的 `.ch-thumb button` 会盖掉新删除按钮的配色）。 */

/* ── 目标选择 ── */
.ch-targets {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.ch-targets-title {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.ch-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 14px;
  cursor: pointer;
  background: var(--surface);
}

.ch-check-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.ch-check-row strong {
  font-weight: 600;
}

.ch-details {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
  background: var(--surface);
}

.ch-details > summary {
  padding: 9px 10px;
  font-size: 14px;
  cursor: pointer;
  list-style: none;
}

.ch-details > summary::-webkit-details-marker {
  display: none;
}

.ch-details > summary::after {
  content: "▾";
  float: right;
  color: var(--muted);
}

.ch-details[open] > summary::after {
  content: "▴";
}

.ch-details-body {
  max-height: 220px;
  overflow-y: auto;
  padding: 0 10px 10px;
  border-top: 1px solid var(--line);
}

.ch-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--canvas);
}

.ch-pick:last-child {
  border-bottom: 0;
}

.ch-pick input {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.ch-pick span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ch-interval {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
}

.ch-interval input {
  width: 72px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  color: var(--ink);
}

/* ── 底部固定发送条 ── */
.ch-sendbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(6px);
}

.ch-prep-progress {
  flex: 1 0 100%;
  display: grid;
  gap: 4px;
  padding: 7px 0 0;
  border-top: 1px solid var(--line);
}

.ch-prep-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #40596d;
  font-size: 11.5px;
}

.ch-prep-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ch-prep-head span {
  flex: 0 0 auto;
  color: #6c8191;
  font-variant-numeric: tabular-nums;
}

.ch-prep-bar {
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce6ed;
}

.ch-prep-bar span {
  width: 0%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--blue);
  transition: width 180ms ease;
}

.ch-prep-progress p {
  margin: 0;
  color: #6c8191;
  font-size: 10.5px;
  line-height: 1.35;
}

.ch-sendbar .ch-send-summary {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.ch-sendbar .button {
  flex: 0 0 auto;
}

/* ── 结果 / 提示 ── */
.ch-alert {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.45;
}

.ch-alert-error {
  background: var(--red-soft);
  color: var(--red);
}

.ch-alert-warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.ch-alert-ok {
  background: var(--green-soft);
  color: var(--green);
}

.ch-result {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.ch-result-nums {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 14px;
  margin-bottom: 8px;
}

.ch-result-nums b {
  font-size: 20px;
  font-weight: 700;
  margin-right: 2px;
}

.ch-num-ok { color: var(--green); }
.ch-num-bad { color: var(--red); }
.ch-num-time { color: var(--blue); }

.ch-result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
  max-height: 240px;
  overflow-y: auto;
}

.ch-result-list li {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--canvas);
  color: var(--muted);
}

.ch-result-list li:last-child {
  border-bottom: 0;
}

.ch-result-list em {
  font-style: normal;
  flex: 0 0 auto;
  font-weight: 600;
}

.ch-result-list .is-ok em { color: var(--green); }
.ch-result-list .is-bad em { color: var(--red); }

.ch-skeleton {
  color: var(--muted);
  font-size: 14px;
  padding: 8px 0;
}

/* ── 发送进度（阶段 4：异步任务）── */
.ch-progress {
  border-color: var(--blue);
  box-shadow: 0 8px 24px rgba(23, 105, 170, 0.14);
}

.ch-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.ch-progress-head strong {
  font-size: 17px;
}

.ch-progress-count {
  font-variant-numeric: tabular-nums;
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.5px;
}

.ch-bar {
  height: 12px;
  border-radius: 999px;
  background: var(--canvas);
  border: 1px solid var(--line);
  overflow: hidden;
}

.ch-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), #2e9fd8);
  transition: width 0.4s ease;
}

.ch-bar-fill.is-done {
  background: linear-gradient(90deg, var(--green), #34a06f);
}

.ch-bar-fill.is-failed {
  background: linear-gradient(90deg, var(--red), #c85656);
}

.ch-bar-fill.is-cancelled {
  background: linear-gradient(90deg, var(--amber), #c8871f);
}

.ch-prog-nums {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.ch-prog-nums b {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  margin-left: 4px;
  color: var(--ink);
}

.ch-num-pct { color: var(--blue) !important; }

.ch-prog-err {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 13px;
  line-height: 1.4;
  word-break: break-all;
}

.ch-task-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--canvas);
  font-size: 13px;
  color: var(--muted);
}

.ch-task-row:last-child {
  border-bottom: 0;
}

.ch-task-badge {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.ch-task-badge.is-ok { background: var(--green-soft); color: var(--green); }
.ch-task-badge.is-bad { background: var(--red-soft); color: var(--red); }
.ch-task-badge.is-running { background: var(--amber-soft); color: var(--amber); }
.ch-task-badge.is-cancel { background: var(--canvas); color: var(--muted); }

.ch-task-row span.ch-task-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── 桌面端 ── */
@media (min-width: 720px) {
  .ch-page {
    max-width: 720px;
  }

  .ch-composer textarea {
    min-height: 120px;
  }

  .ch-sendbar {
    left: 50%;
    transform: translateX(-50%);
    max-width: 720px;
    border: 1px solid var(--line);
    border-radius: 14px 14px 0 0;
  }
}

/* ============================================================
   阶段 5 新增：首页「一键群发」主入口 / 列表搜索 / 多图 / 进度
   仍然只用 styles.css 里已有的设计变量，不新造配色。
   ============================================================ */

/* ── 第一屏：一键群发 ── */
.ch-hero {
  padding: 18px;
  border: 1px solid var(--blue);
  border-radius: 14px;
  background: linear-gradient(180deg, #eef5fb 0%, var(--surface) 62%);
  box-shadow: 0 10px 26px rgba(23, 105, 170, 0.14);
}

.ch-hero h2 {
  margin-bottom: 4px;
  font-size: 21px;
  line-height: 1.25;
  color: var(--navy);
}

.ch-hero-sub {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.ch-hero-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.button-hero {
  padding: 14px 18px;
  font-size: 16.5px;
  font-weight: 700;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(15, 81, 136, 0.22);
}

.ch-hero-sub-actions {
  display: flex;
  gap: 8px;
}

.ch-hero-sub-actions .button {
  flex: 1 1 0;
  min-width: 0;
}

.ch-hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.ch-hero-stats li {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  min-width: 0;
}

.ch-hero-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.ch-hero-stats strong {
  display: block;
  margin-top: 2px;
  color: var(--navy);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ch-hero-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

/* ── 高级功能折叠区 ── */
.ch-advanced {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.ch-advanced > summary {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  list-style: none;
}

.ch-advanced > summary::-webkit-details-marker {
  display: none;
}

.ch-advanced > summary::after {
  content: "展开 ▾";
  float: right;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.ch-advanced[open] > summary::after {
  content: "收起 ▴";
}

.ch-advanced-body {
  padding-top: 12px;
}

/* ── 列表工具栏（搜索 / 全选当前结果 / 清空）── */
.ch-pick-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 9px 0 8px;
  border-bottom: 1px solid var(--line);
}

.ch-pick-search {
  flex: 1 1 170px;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
}

.ch-pick-search:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.ch-pick-tools .button {
  padding: 6px 10px;
  font-size: 12.5px;
}

.ch-pick-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0 3px;
  color: var(--muted);
  font-size: 12.5px;
}

.ch-pick-meta b {
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}

.ch-pick-list {
  padding-bottom: 4px;
}

.ch-pick-empty {
  padding: 10px 0;
  color: var(--muted);
  font-size: 13.5px;
}

.ch-pick-main {
  display: block;
  font-weight: 500;
}

.ch-pick-sub {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.ch-pick.is-checked {
  background: #eef5fb;
}

/* ── 多图：缩略图网格（序号清晰可见）── */
.ch-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.ch-thumb {
  position: relative;
  width: auto;
  height: 84px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--canvas);
}

.ch-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 预览还在解码时给个可见占位，避免看起来像「白图」 */
.ch-thumb img.is-pending,
.ch-thumb img:not([src]) {
  background: repeating-linear-gradient(45deg, #e8ecf0 0 8px, #f4f6f8 8px 16px);
}

.ch-thumb-no {
  position: absolute;
  left: 3px;
  top: 3px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: rgba(23, 50, 77, 0.86);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.ch-thumb-del {
  position: absolute;
  right: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(168, 50, 50, 0.9);
  color: #fff;
  font-size: 13px;
  line-height: 20px;
  cursor: pointer;
}

.ch-thumb-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2px 4px;
  background: rgba(24, 33, 43, 0.68);
  color: #fff;
  font-size: 10.5px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ch-thumb-status {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 19px;
  overflow: hidden;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
}

.ch-thumb-status.is-ready {
  color: #dff7e8;
}

.ch-thumb-status.is-uploading {
  color: #e4f3ff;
}

.ch-thumb-status.is-error {
  color: #ffd9d6;
}

.ch-thumb-status.is-waiting {
  color: #eef2f5;
}

.ch-thumb-upload-bar {
  position: absolute;
  right: 0;
  bottom: 17px;
  left: 0;
  height: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.28);
}

.ch-thumb-upload-bar > span {
  width: 0%;
  height: 100%;
  display: block;
  background: #63b3ed;
  transition: width 150ms linear;
}

.ch-thumb-seq {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

/* ── 进度：速度 / 预计剩余 ── */
.ch-prog-nums {
  gap: 6px 14px;
}

.ch-prog-nums b {
  font-size: 17px;
}

.ch-num-speed { color: var(--blue) !important; }
.ch-num-eta { color: var(--navy) !important; font-size: 15px !important; }
.ch-num-calc { color: var(--muted) !important; font-size: 13px !important; }

.ch-hero-stats strong.is-live { color: var(--blue); }
.ch-hero-stats strong.is-done { color: var(--green); }
.ch-hero-stats strong.is-bad { color: var(--red); }

@media (min-width: 560px) {
  .ch-hero-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .button-hero {
    flex: 1 1 100%;
  }

  .ch-hero-sub-actions {
    flex: 1 1 100%;
  }

  .ch-hero-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
/* ============================================================
   阶段 7A：用户端四入口 UI 骨架
   只重组现有控制台模板，不引入前端框架，不改变发送接口契约。
   ============================================================ */

.portal-app-page {
  min-width: 0;
  background: #eef2f5;
}

.portal-app-page,
.portal-app-page body {
  overflow-x: hidden;
}

.portal-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
}

.portal-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 22px 16px 18px;
  color: #eaf2f8;
  background: #17324d;
  border-right: 1px solid #244965;
}

.portal-brand,
.portal-mobile-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}

.portal-brand:hover,
.portal-mobile-brand:hover {
  color: #fff;
  text-decoration: none;
}

.portal-brand-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: #fff;
  background: #b8582f;
  font-size: 13px;
  font-weight: 800;
}

.portal-brand-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.portal-brand-copy strong {
  overflow: hidden;
  color: #fff;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-brand-copy small {
  color: #9fb5c6;
  font-size: 11px;
}

.portal-nav {
  display: grid;
  gap: 6px;
}

.portal-nav a {
  position: relative;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 10px 12px 10px 17px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #cbd9e4;
  font-weight: 700;
  text-decoration: none;
}

.portal-nav a:hover {
  color: #fff;
  background: #204461;
  text-decoration: none;
}

.portal-nav a[aria-current="page"] {
  color: #fff;
  border-color: #355d7c;
  background: #234a6a;
}

.portal-nav a[aria-current="page"]::before {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: #d36d3d;
  content: "";
}

.portal-sidebar-foot {
  min-width: 0;
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.portal-account {
  overflow: hidden;
  color: #9fb5c6;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-logout {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #426783;
  border-radius: 7px;
  color: #d9e5ed;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.portal-logout:hover {
  color: #fff;
  background: #204461;
}

.portal-stage {
  min-width: 0;
}

.portal-mobile-head {
  display: none;
}

.portal-content {
  width: min(1040px, 100%);
  min-width: 0;
  margin: 0 auto;
  padding: 30px 32px 64px;
}

.portal-view {
  min-width: 0;
}

/* 发送页视觉顺序：编辑和发送按钮在前，历史/已结束任务在后。
   运行中的任务仍由前端主动滚动到进度卡，不依赖 DOM 顺序。 */
.portal-view[data-portal-view="send"] {
  display: flex;
  flex-direction: column;
}

.portal-view[data-portal-view="send"] .portal-view-head {
  order: 0;
}

.portal-view[data-portal-view="send"] #chHero,
.portal-view[data-portal-view="send"] #chBindCard {
  order: 1;
}

.portal-view[data-portal-view="send"] #chSendCard {
  order: 2;
}

.portal-view[data-portal-view="send"] #chProgressCard {
  order: 3;
}

.portal-view[data-portal-view="send"] #chTasksCard {
  order: 4;
}

.portal-view-head {
  margin-bottom: 18px;
}

.portal-view-head h1 {
  margin-bottom: 4px;
  color: var(--navy);
  font-size: 30px;
}

.portal-view-head > p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.portal-view .ch-card {
  margin-bottom: 14px;
  padding: 16px;
  border-radius: 10px;
  box-shadow: 0 5px 18px rgba(23, 50, 77, 0.06);
}

.portal-card-head,
.send-overview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.portal-card-head h2,
.send-overview-head h2 {
  margin-bottom: 0;
}

.portal-section-label {
  display: block;
  margin-bottom: 2px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

.send-overview {
  border-color: #bcd0df;
  background: #fff;
}

.send-overview-head strong {
  display: block;
  color: var(--navy);
  font-size: 14px;
  line-height: 1.4;
}

.send-stat-grid {
  margin-top: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.send-stat-grid li {
  padding: 9px 10px;
  background: #f8fafb;
}

.send-stat-grid strong {
  font-size: 18px;
}

.send-workbench {
  padding: 0 !important;
  overflow: hidden;
}

.send-target-block,
.send-content-block {
  min-width: 0;
  padding: 15px 16px;
}

.send-advanced {
  margin: 0 !important;
  padding: 0 !important;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
}

.send-advanced > summary {
  padding: 10px 16px;
  color: #33485b;
  font-size: 13px;
}

.send-advanced-body {
  padding: 12px 16px 14px;
}

.send-content-block {
  background: #fff;
}

.ch-target-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ch-target-mode {
  min-width: 0;
  min-height: 62px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px 7px;
  border: 1px solid #bcc9d4;
  border-radius: 8px;
  color: #33485b;
  background: #fff;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.ch-target-mode:hover {
  border-color: #7ea8c6;
  background: #f4f8fb;
}

.ch-target-mode.is-active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 4px 12px rgba(23, 105, 170, 0.18);
}

.ch-target-mode strong {
  min-width: 0;
  display: block;
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ch-target-mode span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.ch-target-mode.is-active span {
  color: #d7e9f7;
}

.send-content-block .ch-composer textarea {
  min-height: 96px;
}

.send-content-block .ch-tools {
  margin-top: 8px;
}

.ch-sendbar {
  position: static !important;
  inset: auto !important;
  z-index: auto;
  max-width: none !important;
  display: grid !important;
  gap: 7px;
  margin: 0;
  padding: 0 16px 15px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: none;
  transform: none !important;
  backdrop-filter: none;
}

.ch-send-primary {
  width: 100%;
  min-height: 52px;
  border-radius: 9px;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 7px 18px rgba(15, 81, 136, 0.22);
  font-size: 17px;
  font-weight: 800;
}

.ch-send-primary:hover {
  background: var(--blue-dark);
}

.ch-send-summary {
  min-height: 20px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
  text-align: center;
  overflow-wrap: anywhere;
}

.portal-empty-card {
  min-height: 330px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 34px 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(23, 50, 77, 0.06);
  text-align: center;
}

.portal-empty-mark {
  width: 54px;
  height: 54px;
  display: inline-grid;
  place-items: center;
  margin-bottom: 4px;
  border: 1px solid #c6d7e4;
  border-radius: 50%;
  color: var(--blue);
  background: #edf5fa;
  font-size: 18px;
  font-weight: 800;
}

.portal-empty-card h2 {
  margin-bottom: 0;
  color: var(--navy);
}

.portal-empty-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.portal-info-card,
.portal-redeem-card {
  max-width: 820px;
}

.portal-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}

.portal-detail-grid > div {
  min-width: 0;
  padding: 12px 10px 12px 0;
  border-bottom: 1px solid var(--line);
}

.portal-detail-grid > div:nth-child(2n) {
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.portal-detail-grid dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.portal-detail-grid dd {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.portal-muted-copy {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.portal-redeem-card .redeem-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.portal-bottom-nav {
  display: none;
}

@media (min-width: 720px) {
  .portal-content {
    padding-right: 36px;
    padding-left: 36px;
  }
}

@media (max-width: 900px) {
  html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body.portal-app-page {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .portal-layout {
    width: 100%;
    max-width: 100%;
    display: block;
  }

  .portal-sidebar {
    display: none;
  }

  .portal-stage,
  .portal-content,
  .portal-view {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .portal-mobile-head {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    color: #fff;
    background: var(--navy);
    border-bottom: 1px solid #284963;
  }

  .portal-mobile-brand {
    min-width: 0;
  }

  .portal-mobile-brand strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .portal-mobile-head .portal-brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    font-size: 12px;
  }

  .portal-mobile-account {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
  }

  .portal-mobile-user {
    max-width: 160px;
    overflow: hidden;
    color: #b9cbd8;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .portal-mobile-account form {
    flex: 0 0 auto;
  }

  .portal-mobile-logout {
    min-height: 30px;
    padding: 5px 8px;
    border: 1px solid #426783;
    border-radius: 6px;
    color: #d9e5ed;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
  }

  .portal-mobile-logout:hover {
    color: #fff;
    background: #204461;
  }

  .portal-content {
    width: 100%;
    padding: 18px 12px 90px;
  }

  .portal-bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #cdd6de;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -5px 16px rgba(23, 50, 77, 0.08);
  }

  .portal-bottom-nav a {
    position: relative;
    min-width: 0;
    min-height: 48px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    color: #617080;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
  }

  .portal-bottom-nav a[aria-current="page"] {
    color: var(--navy);
    background: #edf3f7;
  }

  .portal-bottom-nav a[aria-current="page"]::before {
    position: absolute;
    top: 1px;
    left: 28%;
    right: 28%;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: #d36d3d;
    content: "";
  }

  .portal-view-head {
    margin-bottom: 13px;
  }

  .portal-view-head h1 {
    font-size: 24px;
  }

  .portal-view-head > p:last-child {
    font-size: 13px;
  }
}

/* ── 阶段 7A.3：发送页显示“当前是谁 + 能发多少”，减少重复说明 ── */
.send-account-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.send-account-avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  font-size: 15px;
  font-weight: 800;
}

.send-account-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.send-account-copy strong,
.send-account-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.send-account-copy strong {
  color: var(--navy);
  font-size: 15px;
}

.send-account-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.send-account-state {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.send-account-state.is-ready {
  color: var(--green);
  background: var(--green-soft);
}

.send-account-state.is-wait {
  color: var(--amber);
  background: var(--amber-soft);
}

.send-account-counts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 11px;
}

.send-account-counts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8fafb;
}

.send-account-counts span {
  color: var(--muted);
  font-size: 11px;
}

.send-account-counts strong {
  color: var(--navy);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.send-target-block .ch-target-mode {
  min-height: 54px;
  align-content: center;
  text-align: center;
}

.send-content-block .portal-card-head {
  margin-bottom: 7px;
}

@media (max-width: 560px) {
  .portal-content {
    padding-top: 12px;
  }

  .portal-view .ch-card {
    margin-bottom: 8px;
    padding: 11px;
    border-radius: 9px;
  }

  .portal-card-head,
  .send-overview-head {
    margin-bottom: 6px;
  }

  .send-target-block,
  .send-content-block {
    padding: 10px 11px;
  }

  .send-stat-grid {
    gap: 6px;
  }

  .send-stat-grid li {
    padding: 7px 8px;
  }

  .send-stat-grid span {
    font-size: 11px;
  }

  .send-stat-grid strong {
    font-size: 16px;
  }

  .ch-target-modes {
    gap: 5px;
  }

  .ch-target-mode {
    min-height: 60px;
    padding: 6px 5px;
  }

  .ch-target-mode strong {
    font-size: 11.5px;
  }

  .ch-target-mode span {
    font-size: 10.5px;
  }

  .send-advanced > summary {
    padding: 8px 11px;
    font-size: 12.5px;
  }

  .send-advanced-body {
    padding: 9px 11px 11px;
  }

  .send-content-block .ch-composer textarea {
    min-height: 72px;
  }

  .ch-sendbar {
    gap: 4px;
    padding: 0 11px 10px !important;
  }

  .ch-send-primary {
    min-height: 48px;
    font-size: 16px;
  }

  .ch-send-summary {
    font-size: 12px;
    line-height: 1.3;
  }

  .portal-detail-grid {
    grid-template-columns: 1fr;
  }

  .portal-detail-grid > div:nth-child(2n) {
    padding-left: 0;
    border-left: 0;
  }

  .portal-redeem-card .redeem-form {
    grid-template-columns: 1fr;
  }

  .portal-redeem-card .redeem-form .button {
    width: 100%;
  }
}

/* ── 阶段 7A.1：手机首屏压缩，发送和续费入口必须直接可见 ── */
@media (max-width: 560px) {
  .portal-content {
    padding: 8px 10px calc(112px + env(safe-area-inset-bottom, 0px));
  }

  .portal-view-head {
    margin-bottom: 8px;
  }

  .portal-view-head .eyebrow {
    display: none;
  }

  .portal-view-head h1 {
    margin-bottom: 2px;
    font-size: 21px;
    line-height: 1.15;
  }

  .portal-view-head > p:last-child {
    font-size: 12px;
    line-height: 1.35;
  }

  .portal-view .ch-card {
    margin-bottom: 7px;
    padding: 9px;
  }

  .portal-card-head,
  .send-overview-head {
    margin-bottom: 5px;
  }

  .portal-card-head h2,
  .send-overview-head h2 {
    font-size: 16px;
    line-height: 1.2;
  }

  .portal-section-label {
    margin-bottom: 0;
    font-size: 10px;
  }

  .send-overview-head strong {
    font-size: 12.5px;
    line-height: 1.35;
  }

  .send-stat-grid {
    gap: 5px;
    margin-top: 6px;
  }

  .send-stat-grid li {
    padding: 6px 7px;
  }

  .send-stat-grid span {
    font-size: 10.5px;
  }

  .send-stat-grid strong {
    font-size: 15px;
  }

  .send-target-block,
  .send-content-block {
    padding: 8px 10px;
  }

  .ch-target-modes {
    gap: 5px;
  }

  .ch-target-mode {
    min-height: 48px;
    padding: 5px 4px;
  }

  .ch-target-mode strong {
    font-size: 10.8px;
  }

  .ch-target-mode span {
    font-size: 9.8px;
  }

  .send-advanced > summary {
    padding: 6px 10px;
    font-size: 11.5px;
    line-height: 1.25;
  }

  .send-content-block .ch-composer textarea {
    min-height: 56px;
    padding: 8px 9px;
  }

  .send-content-block .ch-tools {
    margin-top: 6px;
  }

  .ch-sendbar {
    padding: 0 10px 8px !important;
  }

  .ch-send-primary {
    min-height: 46px;
    font-size: 15.5px;
  }

  .ch-send-summary {
    min-height: 16px;
    font-size: 11px;
  }

  .portal-bottom-nav {
    padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px));
  }

  .portal-bottom-nav a {
    min-height: 44px;
    font-size: 12px;
  }

  .portal-view[data-portal-view="me"] {
    display: flex;
    flex-direction: column;
  }

  .portal-view[data-portal-view="me"] .portal-view-head {
    order: 0;
  }

  .portal-view[data-portal-view="me"] .me-service-card {
    order: 1;
  }

  .portal-view[data-portal-view="me"] .me-redeem-card {
    order: 2;
  }

  .portal-view[data-portal-view="me"] .me-bind-card {
    order: 3;
  }

  .portal-view[data-portal-view="me"] #chStatusCard {
    order: 4;
  }

  .me-service-card .portal-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .me-service-card .portal-detail-grid > div {
    padding: 8px 6px;
  }

  .me-service-card .portal-detail-grid > div:nth-child(2n) {
    padding-left: 8px;
    border-left: 1px solid var(--line);
  }

  .me-service-card .portal-detail-grid dt {
    font-size: 10.5px;
  }

  .me-service-card .portal-detail-grid dd {
    font-size: 13px;
  }

  .me-redeem-card .portal-muted-copy {
    margin-bottom: 8px;
    font-size: 12px;
  }

  .me-redeem-card .field {
    margin-bottom: 8px;
  }
}

/* ── 阶段 7A.2：指定列表点选修复 + 任务结果卡紧凑化 ── */
.send-advanced .ch-pick-tools {
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 2;
}

.send-advanced .ch-pick {
  min-height: 48px;
}

.ch-verify-row {
  align-items: flex-start;
  margin-top: 10px;
}

.ch-verify-row input {
  margin-top: 3px;
}

.ch-verify-row strong,
.ch-verify-row small {
  display: block;
}

.ch-verify-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.ch-progress.is-finished {
  border-color: var(--line);
  box-shadow: 0 4px 14px rgba(23, 50, 77, 0.05);
}

.ch-progress.is-finished .ch-progress-count {
  font-size: 16px;
}

.ch-progress.is-finished .ch-bar {
  height: 8px;
}

.ch-progress.is-finished .ch-prog-nums {
  gap: 5px 12px;
  margin-top: 8px;
}

.ch-progress.is-finished .ch-prog-nums b {
  font-size: 14px;
}

.ch-progress.is-finished .ch-tools {
  margin-top: 7px;
}

@media (max-width: 560px) {
  .ch-progress.is-finished {
    padding: 9px 10px;
  }

  .ch-progress.is-finished .ch-progress-head {
    margin-bottom: 6px;
  }

  .ch-progress.is-finished .ch-prog-err {
    margin-top: 6px;
    padding: 6px 8px;
    font-size: 11px;
  }
}

/* 苹果 Safari 底部工具栏安全距离：导航整体上提，避免点发送/定时时误触浏览器按钮。 */
@media (max-width: 900px) {
  .portal-content {
    padding-bottom: calc(138px + env(safe-area-inset-bottom, 0px));
  }

  .portal-bottom-nav {
    right: 8px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    left: 8px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    border-radius: 14px 14px 0 0;
  }
}
/* ============================================================
   阶段 7B：群发服务规则 / 套餐对比 / 使用教程 / FAQ 理解中心 / 未开通落地页

   沿用阶段 7A 的门户样式变量与卡片语言，不另造一套视觉。
   移动端 390px 原则：不出现横向溢出（长表格在窄屏拆成卡片）。
   ============================================================ */

/* 视觉隐藏但保留可访问性（搜索框 label 用） */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─────────── 当前群发服务 ─────────── */
.service-snapshot {
  margin-top: 14px;
}

.service-snapshot dt {
  font-weight: 600;
}

.service-snapshot dd {
  margin: 0;
}

.service-actions {
  margin-top: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.service-trial-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid #b9dcff;
  border-left: 4px solid #1a73e8;
  border-radius: 10px;
  background: #f2f8ff;
}

.service-trial-banner strong {
  display: block;
  font-size: 15px;
  color: #10305a;
}

.service-trial-banner span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.6;
  color: #41618a;
}

/* ─────────── 套餐对比 ─────────── */
.plan-table-wrap {
  margin-top: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.plan-table {
  /* 阶段14：套餐表精简为用户真正关心的 6 列，
     桌面端必须给一个最小宽度，否则列会被平摊、长文案逐字换行。
     宽度不够时由 .plan-table-wrap 横向滚动。
     手机端（≤640px）会重置 min-width 并改成卡片布局，不受影响。 */
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: auto;
}

.plan-table th,
.plan-table td {
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #e6ecf3;
  word-break: break-word;
}

/* V16：版本名是第一眼要看的信息，横向滚动时必须钉在左边，
   否则用户滑动看「核心权益」时版本列会被推出视野。 */
.plan-table tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
}

.plan-row.is-highlight tbody th,
.plan-table tr.is-highlight th {
  background: #fbfdff;
}

.plan-table tr.is-current th {
  background: #f2f8ff;
}

.plan-table thead th {
  font-size: 13px;
  font-weight: 600;
  color: #5a6b80;
  background: #f6f9fc;
  border-bottom: 1px solid #dbe4ee;
  white-space: nowrap;
}

.plan-table tbody th {
  font-weight: 600;
  color: #10233c;
}

.plan-row.is-highlight {
  background: #fbfdff;
}

.plan-row.is-current {
  background: #f2f8ff;
  box-shadow: inset 3px 0 0 #1a73e8;
}

.plan-name {
  display: inline-block;
  margin-right: 6px;
  font-size: 15px;
}

.plan-badge {
  display: inline-block;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  border-radius: 999px;
  color: #7a5a12;
  background: #fdf3d8;
  border: 1px solid #f0dfae;
  vertical-align: middle;
}

.plan-badge-current {
  color: #0f4c9c;
  background: #e6f1ff;
  border-color: #b9dcff;
}

.plan-price {
  color: #0f4c9c;
  font-weight: 600;
  white-space: nowrap;
}

.plan-accounts,
.plan-images,
.plan-schedules,
.plan-loop,
.plan-advanced {
  white-space: nowrap;
}

/* V16：高级功能列只有工作室版会有两行（严格校验 / 自动重试） */
.plan-advanced {
  line-height: 1.5;
  color: #3b4c60;
}

.plan-features ul {
  margin: 0;
  padding-left: 16px;
}

.plan-features li {
  margin: 2px 0;
  line-height: 1.6;
  color: #3b4c60;
}

.plan-note {
  margin-top: 10px;
}

/* ─────────── 使用教程 ─────────── */
.tutorial-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tutorial-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #e6ecf3;
  border-radius: 10px;
  background: #fbfdff;
}

.tutorial-no {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  line-height: 26px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  background: #1a73e8;
  border-radius: 50%;
}

.tutorial-copy {
  min-width: 0;
}

.tutorial-copy strong {
  display: block;
  font-size: 14px;
  color: #10233c;
}

.tutorial-copy span {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.6;
  color: #55677e;
}

/* ─────────── FAQ 理解中心 ─────────── */
.faq-center {
  margin-top: 14px;
}

.faq-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.faq-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  color: #33506f;
  background: #f4f7fb;
  border: 1px solid #dbe4ee;
  border-radius: 999px;
  cursor: pointer;
}

.faq-cat b {
  font-weight: 600;
  color: #7b8ca1;
}

.faq-cat.is-active {
  color: #ffffff;
  background: #1a73e8;
  border-color: #1a73e8;
}

.faq-cat.is-active b {
  color: #dcebff;
}

.faq-cat-all {
  margin-left: auto;
}

.faq-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.faq-search input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  font-size: 14px;
  color: #10233c;
  background: #ffffff;
  border: 1px solid #d3dde8;
  border-radius: 8px;
}

.faq-search input:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.14);
}

.faq-status {
  margin: 10px 0 0;
  font-size: 12px;
  color: #6b7c91;
}

.faq-list {
  margin-top: 8px;
  border-top: 1px solid #e6ecf3;
}

.faq-item {
  border-bottom: 1px solid #e6ecf3;
}

.faq-item > summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 4px;
  cursor: pointer;
  list-style: none;
}

.faq-item > summary::-webkit-details-marker {
  display: none;
}

.faq-item > summary::after {
  content: "＋";
  flex: 0 0 auto;
  font-size: 15px;
  color: #1a73e8;
}

.faq-item[open] > summary::after {
  content: "－";
}

.faq-q {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  color: #10233c;
}

.faq-cat-tag {
  flex: 0 0 auto;
  padding: 1px 8px;
  font-size: 11px;
  line-height: 18px;
  color: #5a6b80;
  background: #f1f5f9;
  border-radius: 999px;
  white-space: nowrap;
}

.faq-answer {
  padding: 0 4px 14px 0;
  font-size: 13.5px;
  line-height: 1.75;
  color: #3b4c60;
  white-space: pre-wrap;
  word-break: break-word;
}

.faq-empty {
  margin: 14px 0 0;
  font-size: 13px;
  color: #6b7c91;
}

/* ─────────── 未开通落地页 ─────────── */
.service-locked .portal-nav,
.service-locked .portal-bottom-nav {
  justify-content: flex-start;
}

.service-locked .portal-nav a,
.service-locked .portal-bottom-nav a {
  pointer-events: auto;
}

.service-locked-page .portal-view-head h1 {
  color: #8a4b00;
}

.service-locked-page .locked-status-card {
  border-left: 4px solid #f0a30a;
}

/* ─────────── 窄屏（≤640px，含验收用的 390px）─────────── */
@media (max-width: 640px) {
  .tutorial-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .faq-cat-all {
    margin-left: 0;
  }

  .service-actions .button {
    flex: 1 1 auto;
  }

  /* 套餐表拆成卡片：彻底避免 390px 横向溢出 */
  .plan-table-wrap {
    overflow-x: visible;
  }

  .plan-table,
  .plan-table tbody,
  .plan-table tr,
  .plan-table th,
  .plan-table td {
    display: block;
    width: 100%;
  }

  /* 卡片模式下必须清掉桌面端的最小宽度，否则 1000px 会撑破 390px 屏幕 */
  .plan-table {
    min-width: 0;
  }

  /* 卡片模式没有横向滚动，sticky 反而会让首列浮在文字上面 */
  .plan-table tbody th {
    position: static;
    background: transparent;
  }

  .plan-table thead {
    display: none;
  }

  .plan-table tr {
    margin-bottom: 10px;
    padding: 12px 14px;
    border: 1px solid #e2e9f1;
    border-radius: 10px;
    background: #fbfdff;
  }

  .plan-table tr.is-current {
    box-shadow: none;
    border-color: #b9dcff;
    background: #f2f8ff;
  }

  .plan-table th,
  .plan-table td {
    padding: 4px 0;
    border: 0;
    text-align: left;
    display: flex;
    gap: 10px;
    align-items: flex-start;
  }

  .plan-table td::before,
  .plan-table tbody th::before {
    flex: 0 0 84px;
    max-width: 84px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7c91;
    content: attr(data-label);
  }

  .plan-table tbody th {
    font-size: 15px;
  }

  .plan-table .plan-features ul {
    padding-left: 14px;
  }
}

.redeem-qr-link {
  display: inline-block;
  margin-top: 10px;
}

.redeem-qr-image {
  width: 168px;
  max-width: 100%;
  display: block;
  border: 1px solid #cfddda;
  border-radius: 8px;
  background: #fff;
}
/* ============================================================
   阶段 7B.1：多账号绑定与切换

   只新增「账号切换下拉 + 已绑定账号列表」这两块的样式，
   阶段 7A 的发送页视觉（按钮第一屏、目标汇总位置、卡片语言）一字不改。
   移动端 390px 原则：不出现横向溢出（账号卡片在窄屏改成上下两段）。
   ============================================================ */

/* ─────────── 发送页：圆头账号切换 ─────────── */
.ch-account-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #d9e3f2;
  border-radius: 10px;
  background: #f7faff;
}

.ch-account-switch > label {
  font-size: 13px;
  font-weight: 600;
  color: #35507a;
  white-space: nowrap;
}

.ch-account-select {
  flex: 1 1 180px;
  min-width: 0;
  max-width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #c6d5ea;
  border-radius: 8px;
  background: #ffffff;
  color: #16324f;
  font-size: 14px;
}

.ch-account-select:focus {
  outline: 2px solid #1a73e8;
  outline-offset: 1px;
}

.ch-account-switch-note {
  flex: 1 1 100%;
  font-size: 12px;
  line-height: 1.5;
  color: #5a7295;
}

/* 「＋ 添加圆头账号」入口（还有名额时才出现） */
.ch-account-add {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.ch-account-add-note {
  font-size: 12px;
  line-height: 1.5;
  color: #5a7295;
}

/* ─────────── 我的页：已绑定圆头账号列表 ─────────── */
.me-accounts-card .portal-muted-copy {
  margin-top: 8px;
}

.ch-account-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.ch-account-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #dbe4f1;
  border-radius: 10px;
  background: #ffffff;
}

.ch-account-item.is-current {
  border-color: #9cc4f5;
  box-shadow: inset 3px 0 0 #1a73e8;
}

.ch-account-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ch-account-avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e8f1fe;
  color: #1558b0;
  font-weight: 700;
  font-size: 15px;
}

.ch-account-ident {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 120px;
}

.ch-account-ident strong {
  font-size: 15px;
  color: #16324f;
  overflow-wrap: anywhere;
}

.ch-account-ident small {
  font-size: 12px;
  color: #6b7f9c;
  overflow-wrap: anywhere;
}

.ch-account-state {
  flex: 0 0 auto;
  padding: 3px 10px;
  border-radius: 999px;
  background: #f1f3f7;
  color: #6b7f9c;
  font-size: 12px;
  white-space: nowrap;
}

.ch-account-state.is-ready {
  background: #e8f6ec;
  color: #1a7f37;
}

.ch-account-current {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8f1fe;
  color: #1558b0;
  font-size: 11px;
  white-space: nowrap;
}

.ch-account-meta {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin: 0;
}

.ch-account-meta dt {
  font-size: 12px;
  color: #6b7f9c;
}

.ch-account-meta dd {
  margin: 2px 0 0;
  font-size: 13px;
  color: #16324f;
}

.ch-account-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ch-account-actions .button {
  flex: 0 0 auto;
}

/* 390px：按钮一行放不下就换行，账号卡片不产生横向滚动 */
@media (max-width: 480px) {
  .ch-account-item {
    padding: 11px 12px;
  }

  .ch-account-meta {
    gap: 14px;
  }

  .ch-account-actions {
    gap: 6px;
  }

  .ch-account-actions .button {
    flex: 1 1 calc(50% - 3px);
    min-width: 0;
  }

  .ch-account-switch {
    padding: 10px;
  }
}

/* ============================================================
   管理后台 · 左侧分类导航（阶段 5 改造）
   本段会被追加到 styles.css 末尾（styles.css = 原版 + ch-console.css + 本文件）。

   ★ 沿用后台已有的「深色石墨」视觉体系：
       header  #171c21   canvas #eceff1   强调色 #b8582f   内容卡 #fff / 边 #d1d6da
     不引入新配色、不套用会员端的蓝色门户风格。

   ★ 布局原则：整页不再向下堆成一张长表 ——
     左栏是分类导航，右栏只渲染「当前分类」的内容（其余 section 由 JS 加 hidden）。
   ============================================================ */

.admin-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding-top: 22px;
  padding-bottom: 40px;
}

/* ── 左栏 ── */
.admin-side {
  position: sticky;
  top: 16px;
  border: 1px solid #2b333a;
  border-radius: 8px;
  background: #1d2329;
  overflow: hidden;
}

.admin-side-head {
  padding: 14px 16px 12px;
  border-bottom: 1px solid #2b333a;
}

.admin-side-head span {
  display: block;
  color: #b8582f;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.admin-side-head strong {
  display: block;
  margin-top: 3px;
  color: #f4f6f7;
  font-size: 15px;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 2px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #ced5da;
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.admin-nav-item:hover {
  background: #262d34;
  color: #fff;
}

.admin-nav-item.is-active {
  border-left-color: #b8582f;
  background: #2b333a;
  color: #fff;
  font-weight: 600;
}

.admin-nav-ico {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 4px;
  background: #333c44;
  color: #e8b28f;
  font-size: 11px;
  font-weight: 700;
}

.admin-nav-item.is-active .admin-nav-ico {
  background: #b8582f;
  color: #fff;
}

.admin-nav-badge {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 999px;
  background: #333c44;
  color: #cfd6db;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.admin-side-foot {
  padding: 11px 16px 14px;
  border-top: 1px solid #2b333a;
  color: #87929b;
  font-size: 12px;
  line-height: 1.45;
}

/* 手机端：左侧栏折叠成「功能分类」开关，绝不允许横向溢出 */
.admin-nav-toggle {
  display: none;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 8px;
  background: #1d2329;
  color: #f4f6f7;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.admin-nav-toggle::after {
  content: "▾";
  float: right;
  color: #b8582f;
}

.admin-nav-toggle.is-open::after {
  content: "▴";
}

/* ── 右栏 ── */
.admin-main {
  min-width: 0;
}

.admin-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-section[hidden] {
  display: none !important;
}

.admin-section-head {
  padding-bottom: 14px;
  border-bottom: 1px solid #ccd2d6;
}

.admin-section-head h2 {
  margin-bottom: 4px;
  font-size: 22px;
}

.admin-section-head p {
  margin-bottom: 0;
  color: #65717a;
  font-size: 14px;
}

.admin-subpanel {
  padding: 16px;
  border: 1px solid #d1d6da;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 7px 18px rgba(31, 38, 44, 0.06);
}

.admin-subpanel h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.admin-subpanel > p.hint {
  margin: 0 0 12px;
  color: #65717a;
  font-size: 13px;
  line-height: 1.5;
}

/* 键值信息表（系统配置 / 品牌预览用） */
.kv-list {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 0;
  margin: 0;
  font-size: 14px;
}

.kv-list dt {
  padding: 8px 10px;
  border-top: 1px solid #e6eaec;
  color: #65717a;
}

.kv-list dd {
  padding: 8px 10px;
  border-top: 1px solid #e6eaec;
  margin: 0;
  color: #293139;
  overflow-wrap: anywhere;
}

.kv-list dt:first-of-type,
.kv-list dd:first-of-type {
  border-top: 0;
}

.kv-list code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #eef1f3;
  font-size: 12.5px;
  word-break: break-all;
}

/* 纯文本设置表单 */
.admin-form .field {
  margin-bottom: 12px;
}

.admin-form input[type="text"],
.admin-form textarea,
.admin-form input[type="number"] {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #c3cad0;
  border-radius: 6px;
  background: #fff;
  color: #293139;
  font: inherit;
  font-size: 14px;
}

.admin-form textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.admin-form input:focus,
.admin-form textarea:focus {
  outline: 2px solid #b8582f;
  outline-offset: 1px;
}

.admin-form-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-form select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #c3cad0;
  border-radius: 6px;
  background: #fff;
  color: #293139;
  font: inherit;
  font-size: 14px;
}

.admin-form .admin-form-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-form-status {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 6px;
  font-size: 13.5px;
  line-height: 1.45;
}

.admin-form-status.is-ok {
  background: #e7f4ed;
  color: #1f7a53;
}

.admin-form-status.is-bad {
  background: #fbe9e9;
  color: #a83232;
}

.admin-form-status[hidden] {
  display: none !important;
}

/* 数据表格（任务 / 审计 / 卡密） */
.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

/* 列被压到只剩几个字宽会很难看（实测过：邮箱被逐字换行）。
   给一个最小宽度，装不下时由 .admin-table-wrap 横向滚动。 */
.admin-table {
  min-width: 760px;
}

.admin-table-audit {
  min-width: 800px;
}

.admin-table th,
.admin-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #e6eaec;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: #65717a;
  font-weight: 600;
  white-space: nowrap;
}

.admin-table td {
  color: #293139;
}

.admin-table tbody tr:hover {
  background: #f7f9fa;
}

.admin-table .is-empty {
  padding: 18px 10px;
  color: #87929b;
  text-align: center;
}

/* 表格里的长内容：允许在 @ 或任意位置换行，但不要压得太窄 */
.admin-table .admin-email {
  overflow-wrap: anywhere;
}

.admin-table .admin-who {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-table .admin-arrow {
  display: none;
}

.admin-table .admin-same,
.admin-table .admin-arrow {
  color: #87929b;
}

.admin-table .admin-ip {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.admin-table .admin-who .admin-email,
.admin-table .admin-email {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

.admin-table td:first-child {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ── 手机端表格：横向滚动而不是把字掰碎 ──
   390px 实测踩到过：任务表 8 列挤进 min-width:760px，每列只剩 79~122px，
   「群 2 · 好友 1（图片×2 + 名片×1）」被拆成一字一行 —— 既难读又占满整屏。
   手机端给足整表宽度 + 单元格不折行，让 .admin-table-wrap 自己横向滚动。 */
@media (max-width: 720px) {
  .admin-table {
    min-width: 1100px;
  }

  .admin-table-audit {
    min-width: 920px;
  }

  .admin-table th,
  .admin-table td {
    white-space: nowrap;
  }

  /* 这两种单元格内容长且本来就允许换行，别被上面的 nowrap 波及 */
  .admin-table .is-empty {
    white-space: normal;
  }

  .admin-table td:last-child {
    white-space: normal;
    max-width: 260px;
  }

  .admin-table-wrap {
    overscroll-behavior-x: contain;
  }
}

/* 任务状态徽章（后台配色，独立于会员端） */
.task-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.task-badge.is-ok { background: #e7f4ed; color: #1f7a53; }
.task-badge.is-bad { background: #fbe9e9; color: #a83232; }
.task-badge.is-run { background: #fff2d7; color: #9a5a00; }
.task-badge.is-cancel { background: #eceff1; color: #65717a; }
/* 阶段 7B.1：卡密版本徽章（单号版 / 基础版 / 专业版）
   V16：is-single→入门版、is-basic→基础版、is-pro→工作室版，
   新增 is-addon 表示「加号包 / 专业能力包卡」（不是版本卡）。 */
.task-badge.is-single { background: #eceff1; color: #4b5863; }
.task-badge.is-basic { background: #e8eef7; color: #2a548b; }
.task-badge.is-advanced { background: #e9f1fb; color: #1f5fa8; }
.task-badge.is-pro { background: #efe6f8; color: #64379c; }
.task-badge.is-addon { background: #e6f7f1; color: #1c6b52; }
/* 阶段14：卡密列表区分「新卡（带 V16 标记）」与「旧库存卡」 */
.task-badge.is-plain { background: #f3f4f6; color: #7a8794; }
/* 卡密前缀是等宽字母数字，用等宽字体更好比对 */
.admin-table td.is-mono {
  font-family: Consolas, Menlo, "Courier New", monospace;
  font-size: 12px;
  letter-spacing: 0.4px;
}

/* 审计详情：把 metadata 从 "{'days': 30}" 这种「乱码感」渲染成正常键值 */
.meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}

.meta-chip {
  padding: 1px 7px;
  border: 1px solid #dde2e6;
  border-radius: 5px;
  background: #f7f9fa;
  color: #48535c;
  font-size: 12px;
  white-space: nowrap;
}

.meta-chip b {
  color: #293139;
  font-weight: 600;
}

/* 手机端 */
@media (max-width: 900px) {
  .admin-shell {
    grid-template-columns: 1fr;
    gap: 14px;
    padding-top: 16px;
  }

  .admin-side {
    position: static;
  }

  .admin-side-head {
    display: none;
  }

  .admin-nav-toggle {
    display: block;
  }

  .admin-nav {
    display: none;
    padding: 6px 8px 10px;
  }

  .admin-nav.is-open {
    display: flex;
  }

  .admin-side-foot {
    display: none;
  }

  .kv-list {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .kv-list dt {
    padding-bottom: 2px;
    border-top: 1px solid #e6eaec;
  }

  .kv-list dd {
    padding-top: 2px;
    border-top: 0;
  }
}


/* ============================================================
   阶段 7B：后台「套餐与价格 / 使用教程 / FAQ 理解中心」的整表编辑器
   （与 ch-stage7b.css 一起拼进 styles.css，线上只加载一个 <link>）
   ============================================================ */
.editor-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.editor-list-faq {
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 4px;
}

.editor-card {
  border: 1px solid #e2e9f1;
  border-radius: 10px;
  background: #fbfdff;
}

.editor-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid #e8eef5;
  background: #f4f8fc;
  border-radius: 10px 10px 0 0;
}

.editor-card-head strong {
  font-size: 13px;
  color: #10233c;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-card-body {
  padding: 12px;
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.editor-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.editor-label {
  font-size: 12px;
  font-weight: 600;
  color: #5a6b80;
}

.editor-field input[type="text"],
.editor-field input[type="number"],
.editor-field input:not([type]),
.editor-field .editor-textarea,
.editor-field .editor-wide {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 9px;
  font-size: 13px;
  color: #10233c;
  background: #ffffff;
  border: 1px solid #d3dde8;
  border-radius: 7px;
}

.editor-field .editor-textarea {
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
}

.editor-field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 4px 0;
}

.faq-admin-toolbar {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* ── 阶段 7C：整表清空的二次确认提示 ──
   FAQ / 套餐 / 教程保存的是整张表，提交空数组会把线上内容全删。
   这条警告插在「保存」按钮所在的那一行上方，必须点「确认清空」才继续。 */
.admin-empty-guard {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #e0b979;
  border-left: 4px solid #b8582f;
  border-radius: 6px;
  background: #fdf4e6;
  color: #6b4415;
  font-size: 13.5px;
  line-height: 1.55;
}

.admin-empty-guard strong {
  display: block;
  font-size: 14.5px;
  font-weight: 800;
  color: #8a3d16;
}

.admin-empty-guard span {
  display: block;
  margin-top: 4px;
}

.admin-empty-guard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* 警告条底色是浅琥珀色，普通次要按钮（透明底 + 浅灰边）在上面几乎看不见，
   这里把两个按钮的对比度钉死，避免「取消」被忽略、用户找不到退路。 */
.admin-empty-guard-actions .button-quiet {
  color: #6b4415;
  border: 1px solid #d9b483;
  background: #fffdf8;
}

.admin-empty-guard-actions .button-quiet:hover {
  background: #f6ead7;
}

.admin-empty-guard-actions .button-danger {
  color: #ffffff;
  border-color: #a8481f;
  background: #b8582f;
  font-weight: 700;
}

.admin-empty-guard-actions .button-danger:hover {
  background: #a8481f;
}

@media (max-width: 720px) {
  .editor-grid {
    grid-template-columns: 1fr;
  }

  .editor-list-faq {
    max-height: none;
  }

  .admin-empty-guard-actions .button {
    flex: 1 1 140px;
  }
}

.admin-qr-preview {
  width: 168px;
  max-width: 100%;
  margin-top: 10px;
  border: 1px solid #d6dee5;
  border-radius: 7px;
  background: #fff;
}

.table-form-danger {
  margin-top: 6px;
}
/* 阶段 8：定时发送 / 循环发送（「定时」页）
 *
 * 只新增 .tm-* 前缀的规则，不覆盖阶段 7A/7B/7B.1 的任何既有样式，
 * 也不改后台（ch-admin）与发送页（ch-console）的类。
 * 全部沿用 _styles.base.css 的颜色变量，保持浅色主题一致。
 */

.tm-summary {
  margin-bottom: 14px;
}

.tm-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.tm-summary-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  min-width: 0;
}

.tm-k {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.tm-summary-cell strong {
  color: var(--navy);
  font-size: 15px;
  font-weight: 700;
}

.tm-summary-time {
  font-size: 13.5px !important;
  overflow-wrap: anywhere;
}

.tm-tools {
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.tm-runner {
  color: var(--muted);
  font-size: 12.5px;
  margin-left: auto;
}

.tm-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

/* ── 表单 ─────────────────────────────────────────── */
.tm-form-card {
  margin-bottom: 14px;
}

.tm-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.tm-field-row {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.tm-label {
  color: var(--navy);
  font-size: 13.5px;
  font-weight: 600;
}

.tm-sub {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.tm-input {
  width: 100%;
  max-width: 460px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
}

.tm-input:focus {
  outline: 2px solid rgba(23, 105, 170, 0.35);
  outline-offset: 1px;
  border-color: var(--blue);
}

.tm-input-num {
  max-width: 140px;
}

.tm-textarea {
  max-width: 100%;
  resize: vertical;
  line-height: 1.55;
}

.tm-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13.5px;
}

.tm-check input {
  width: 16px;
  height: 16px;
}

.tm-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tm-seg label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  cursor: pointer;
}

.tm-seg label:has(input:checked) {
  border-color: var(--blue);
  background: #eaf3fa;
  color: var(--blue-dark);
  font-weight: 600;
}

.tm-seg input {
  margin: 0;
}

.tm-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tm-thumb {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f4f7fa;
  color: var(--muted);
  font-size: 12px;
}

.tm-form-actions {
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

/* 指定群 / 好友 */
.tm-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.tm-picker-col {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
  padding: 10px;
  min-width: 0;
}

.tm-picker-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.tm-picker-head strong {
  color: var(--navy);
  font-size: 13px;
}

.tm-search {
  flex: 1 1 120px;
  min-width: 0;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  font-size: 13px;
}

.tm-picker-list {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tm-picker-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.tm-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 7px;
  font-size: 13px;
  cursor: pointer;
}

.tm-pick:hover {
  background: #eef5fa;
}

.tm-pick input {
  margin: 0;
}

.tm-pick span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── 任务卡片 ─────────────────────────────────────── */
.tm-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tm-item {
  padding: 15px 16px;
}

.tm-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 10px;
}

.tm-item-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tm-item-title strong {
  color: var(--navy);
  font-size: 16px;
  font-weight: 700;
}

.tm-title {
  color: var(--muted);
  font-size: 12.5px;
}

.tm-item-account {
  color: var(--muted);
  font-size: 12.5px;
  margin-left: auto;
}

.tm-conn {
  color: var(--green);
  font-style: normal;
  font-weight: 600;
}

.tm-conn.is-off {
  color: var(--amber);
}

.tm-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 600;
}

.tm-pill.is-active {
  color: var(--green);
  background: var(--green-soft);
  border-color: #b7e0cc;
}

.tm-pill.is-paused {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: #f0d8a8;
}

.tm-pill.is-done {
  color: var(--blue-dark);
  background: #eaf3fa;
  border-color: #c3dcee;
}

.tm-pill.is-missed {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: #f0d8a8;
}

.tm-pill.is-off {
  color: var(--red);
  background: var(--red-soft);
  border-color: #f0c9c9;
}

.tm-next {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  padding: 10px 12px;
  border: 1px dashed #c3dcee;
  border-radius: 10px;
  background: #f6fbff;
}

.tm-next strong {
  color: var(--navy);
  font-size: 14.5px;
}

.tm-countdown {
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
}

.tm-countdown.is-soon {
  color: #b8582f;
}

.tm-meta {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
}

.tm-meta .tm-last {
  color: var(--muted);
}

.tm-meta .tm-last.is-bad {
  color: var(--red);
}

.tm-dup {
  color: var(--amber);
  font-style: normal;
}

.tm-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* 执行历史 */
.tm-history {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.tm-history-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.tm-history-head strong {
  color: var(--navy);
  font-size: 13.5px;
}

.tm-table-wrap {
  overflow-x: auto;
}

.tm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.tm-table th,
.tm-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.tm-table th {
  color: var(--muted);
  font-weight: 600;
  background: #f8fafc;
}

.tm-table td:last-child {
  white-space: normal;
  min-width: 160px;
  color: var(--muted);
}

.tm-run {
  display: inline-flex;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}

.tm-run-fired {
  color: var(--green);
  background: var(--green-soft);
}

.tm-run-skipped_offline,
.tm-run-skipped_blocked {
  color: var(--amber);
  background: var(--amber-soft);
}

.tm-run-pending {
  color: var(--muted);
  background: #eef1f4;
}

.tm-tasklink {
  color: var(--blue);
}

/* ── 手机端（390px 也要能完整操作）─────────────────── */
@media (max-width: 900px) {
  .tm-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tm-picker {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .tm-summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .tm-runner {
    margin-left: 0;
    flex: 1 1 100%;
  }

  .tm-input {
    max-width: 100%;
  }

  .tm-item-account {
    margin-left: 0;
    flex: 1 1 100%;
  }

  .tm-item-actions .button {
    flex: 1 1 calc(50% - 8px);
  }

  .tm-seg label {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
  }
}
/* ============================================================
   阶段 9：好友私聊消息与实时提醒
   只新增 .inbox-* / 消息导航角标规则，不覆盖发送、定时或我的页。
   ============================================================ */

.portal-nav-label {
  min-width: 0;
  flex: 1 1 auto;
}

.portal-nav-badge,
.inbox-unread-pill {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  color: #fff;
  background: #c93b35;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.portal-nav-badge {
  flex: 0 0 auto;
  margin-left: 8px;
}

.inbox-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.inbox-head > div:first-child {
  min-width: 0;
}

.inbox-head-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  padding-top: 2px;
}

.inbox-head-actions .button {
  width: auto;
  min-height: 34px;
  margin: 0;
}

.inbox-unread-pill {
  min-height: 28px;
  padding: 0 10px;
  color: #526779;
  background: #e5ebf0;
  font-size: 12px;
}

.inbox-unread-pill.has-unread {
  color: #fff;
  background: #c93b35;
}

.inbox-alert {
  margin-bottom: 10px;
  padding: 9px 11px;
  border: 1px solid #e0b6b3;
  border-radius: 8px;
  color: #8c2925;
  background: #fff3f2;
  font-size: 12.5px;
  line-height: 1.45;
}

.inbox-settings {
  margin-bottom: 12px;
}

.inbox-notify-state {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.inbox-notify-state.is-on {
  color: #1e6b46;
  background: #e3f3e9;
}

.inbox-notify-state.is-off {
  color: #667887;
  background: #edf1f4;
}

.inbox-settings-copy {
  margin-bottom: 10px;
  color: #5c6f7e;
  font-size: 12.5px;
  line-height: 1.5;
}

.inbox-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.inbox-settings-actions .button {
  width: auto;
  min-height: 34px;
  margin: 0;
}

.inbox-friend-requests {
  margin-bottom: 12px;
}

.inbox-friend-count {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: #667887;
  background: #edf1f4;
  font-size: 11px;
  font-weight: 800;
}

.inbox-friend-count.has-pending {
  color: #8c2925;
  background: #fff0ee;
}

.inbox-friend-list {
  display: grid;
  gap: 7px;
}

.inbox-friend-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid #e0e7ec;
  border-radius: 8px;
  background: #fbfcfd;
}

.inbox-friend-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #3e6f91;
  font-size: 14px;
  font-weight: 800;
}

.inbox-friend-main {
  min-width: 0;
}

.inbox-friend-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.inbox-friend-top strong {
  min-width: 0;
  overflow: hidden;
  color: #263b4d;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-friend-status {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
}

.inbox-friend-status.is-pending {
  color: #8c2925;
  background: #fff0ee;
}

.inbox-friend-status.is-accepted {
  color: #1e6b46;
  background: #e3f3e9;
}

.inbox-friend-status.is-rejected {
  color: #667887;
  background: #edf1f4;
}

.inbox-friend-meta {
  margin-top: 3px;
  color: #7a8995;
  font-size: 10.5px;
}

.inbox-friend-account {
  margin-top: 2px;
  overflow: hidden;
  color: #7a8995;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-friend-signature {
  margin: 5px 0 7px;
  color: #4d6272;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.inbox-friend-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inbox-friend-actions .button {
  width: auto;
  min-height: 30px;
  margin: 0;
  padding: 4px 10px;
  font-size: 11.5px;
}

.inbox-friend-item.is-compact,
.inbox-friend-item.is-chat-open {
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  padding: 9px 10px;
}

.inbox-friend-item.is-chat-open {
  align-items: start;
}

.inbox-friend-item.is-compact .inbox-friend-avatar,
.inbox-friend-item.is-chat-open .inbox-friend-avatar {
  width: 34px;
  height: 34px;
  font-size: 13px;
}

.inbox-friend-ready {
  margin-top: 3px;
  color: #5c7181;
  font-size: 11px;
}

.inbox-friend-chat-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.inbox-friend-chat-actions .button {
  width: auto;
  min-height: 30px;
  margin: 0;
  padding: 4px 11px;
  font-size: 11.5px;
}

.inbox-friend-chat {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid #e3eaef;
}

.inbox-friend-chat-system {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 8px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #667887;
  background: #edf2f5;
  font-size: 10.5px;
  text-align: center;
}

.inbox-friend-chat .inbox-sent-replies {
  margin-top: 7px;
}

.inbox-friend-chat-text {
  width: 100%;
  min-height: 58px;
  box-sizing: border-box;
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid #ccd8e1;
  border-radius: 8px;
  color: #17324d;
  background: #fff;
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
}

.inbox-friend-chat-text:focus {
  border-color: #4f83aa;
  outline: 2px solid rgba(79, 131, 170, 0.16);
}

.inbox-friend-chat-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
}

.inbox-friend-chat-tools .button {
  width: auto;
  min-height: 30px;
  margin: 0;
  padding: 4px 10px;
  font-size: 11.5px;
}

.inbox-friend-chat-file {
  min-width: 0;
  flex: 1 1 120px;
  overflow: hidden;
  color: #7a8995;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-friend-chat-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: calc(env(safe-area-inset-top) + 24px) 12px
    calc(env(safe-area-inset-bottom) + 12px);
  background: rgba(10, 20, 32, 0.58);
}

.inbox-friend-chat-modal[hidden] {
  display: none;
}

.inbox-friend-chat-panel {
  width: min(520px, 100%);
  max-height: min(78vh, 620px);
  overflow: auto;
  padding: 14px;
  border: 1px solid #d6dfe6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(12, 28, 43, 0.24);
}

.inbox-friend-chat-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.inbox-friend-chat-panel-head strong {
  min-width: 0;
  overflow: hidden;
  color: #17324d;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-friend-chat-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #d6dfe6;
  border-radius: 50%;
  color: #5c7181;
  background: #f6f8fa;
  font-size: 23px;
  line-height: 30px;
  cursor: pointer;
}

.inbox-friend-chat-history {
  max-height: 34vh;
  overflow: auto;
  margin-top: 8px;
}

.inbox-friend-chat-modal .inbox-friend-chat-system {
  margin: 0 auto 9px;
}

body.inbox-friend-chat-open {
  overflow: hidden;
}

.inbox-list {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.inbox-item {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid #d6dfe6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(23, 50, 77, 0.045);
  cursor: pointer;
  outline: none;
}

.inbox-item:hover,
.inbox-item:focus-visible {
  border-color: #91b4cd;
  box-shadow: 0 6px 18px rgba(23, 50, 77, 0.08);
}

.inbox-item.is-unread {
  border-left: 3px solid #c93b35;
  background: #fffdfd;
}

.inbox-item.is-open {
  border-color: #86abc5;
}

.inbox-avatar {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #265f8b;
  font-size: 16px;
  font-weight: 800;
}

.inbox-item-main {
  min-width: 0;
}

.inbox-item-top {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.inbox-peer {
  min-width: 0;
  overflow: hidden;
  color: #17324d;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-time {
  flex: 0 0 auto;
  color: #7a8995;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.inbox-peer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 9px;
  margin-top: 2px;
  color: #617687;
  font-size: 11px;
}

.inbox-type {
  color: #2a6f9e;
  font-weight: 700;
}

.inbox-preview {
  display: -webkit-box;
  margin: 6px 0 5px;
  overflow: hidden;
  color: #33485b;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.inbox-item.is-open .inbox-preview {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

.inbox-sent-replies {
  display: grid;
  gap: 4px;
  margin: 6px 0 4px;
  padding-left: 8px;
  border-left: 3px solid #b9d2e2;
}

.inbox-sent-reply {
  padding: 5px 7px;
  border-radius: 6px;
  background: #f3f8fb;
}

.inbox-sent-reply.is-pending {
  opacity: 0.78;
}

.inbox-sent-reply.is-failed {
  border-left: 3px solid #c93b35;
  background: #fff3f2;
}

.inbox-sent-reply-main {
  display: flex;
  flex-wrap: wrap;
  gap: 0 3px;
  color: #33485b;
  font-size: 12px;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.inbox-sent-reply-who {
  flex: 0 0 auto;
  color: #2a6f9e;
  font-weight: 800;
}

.inbox-sent-reply-text {
  min-width: 0;
}

.inbox-sent-reply-time {
  display: block;
  margin-top: 2px;
  color: #81909b;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.inbox-reply {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid #e4ebf0;
  cursor: default;
}

.inbox-reply-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  color: #526779;
  font-size: 11px;
  font-weight: 800;
}

.inbox-reply-close {
  width: auto;
  min-height: 24px;
  margin: 0;
  padding: 2px 6px;
  border: 0;
  color: #5f788b;
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.inbox-reply-close:hover,
.inbox-reply-close:focus-visible {
  color: #255f87;
  text-decoration: underline;
}

.inbox-reply-label {
  display: block;
  margin-bottom: 5px;
  color: #526779;
  font-size: 11px;
  font-weight: 800;
}

.inbox-reply-text {
  width: 100%;
  min-height: 58px;
  resize: vertical;
  padding: 8px 9px;
  border: 1px solid #ccd8e1;
  border-radius: 7px;
  color: #263b4d;
  background: #fff;
  font: inherit;
  font-size: 12.5px;
  line-height: 1.45;
  outline: none;
}

.inbox-reply-text:focus {
  border-color: #6f9bbb;
  box-shadow: 0 0 0 2px rgba(75, 130, 171, 0.12);
}

.inbox-reply-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.inbox-reply-tools .button {
  width: auto;
  min-height: 31px;
  margin: 0;
  padding: 4px 9px;
  font-size: 11.5px;
}

.inbox-reply-file {
  min-width: 0;
  flex: 1 1 120px;
  overflow: hidden;
  color: #7a8995;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-reply-note {
  margin: 5px 0 0;
  color: #8b98a1;
  font-size: 10.5px;
  line-height: 1.4;
}

.inbox-account {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  color: #7a8995;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-account-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inbox-reply-link {
  flex: 0 0 auto;
  margin: 0;
  padding: 2px 0;
  border: 0;
  color: #2a6f9e;
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.inbox-reply-link:hover,
.inbox-reply-link:focus-visible {
  color: #174d73;
  text-decoration: underline;
}

.inbox-dot {
  width: 9px;
  height: 9px;
  align-self: start;
  margin-top: 6px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #c93b35;
  box-shadow: 0 0 0 1px #c93b35;
}

@media (max-width: 900px) {
  .portal-bottom-nav a {
    gap: 0;
  }

  .portal-bottom-nav .portal-nav-label {
    display: block;
  }

  .portal-bottom-nav .portal-nav-badge {
    position: absolute;
    top: 2px;
    right: 18%;
    margin: 0;
    border: 2px solid #fff;
    line-height: 16px;
  }
}

@media (max-width: 560px) {
  .inbox-head {
    display: grid;
    gap: 9px;
  }

  .inbox-head-actions {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
    gap: 5px;
    padding-top: 0;
  }

  .inbox-head-actions .button {
    width: 100%;
    min-height: 32px;
    padding: 5px 7px;
    font-size: 11.5px;
  }

  .inbox-unread-pill {
    min-width: 58px;
    min-height: 32px;
    padding: 0 8px;
    font-size: 11.5px;
  }

  .inbox-item {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px;
  }

  .inbox-avatar {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .inbox-peer {
    font-size: 13px;
  }

  .inbox-preview {
    margin-top: 5px;
    font-size: 12px;
  }

  .inbox-settings-actions .button {
    width: 100%;
  }
}
/* 客户私聊图片：只在消息卡片内部展示，点击可打开原图。 */
.inbox-message-image-link {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.inbox-message-image {
  display: block;
  width: auto;
  max-width: min(240px, 100%);
  max-height: 280px;
  object-fit: contain;
  border: 1px solid rgba(23, 50, 77, 0.14);
  border-radius: 8px;
  background: #fff;
}

.inbox-image-viewer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top) + 64px) 16px
    calc(env(safe-area-inset-bottom) + 24px);
  background: rgba(10, 20, 32, 0.92);
}

.inbox-image-viewer[hidden] {
  display: none;
}

.inbox-image-viewer-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}

.inbox-image-viewer-close {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 12px);
  right: 14px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 30px;
  line-height: 40px;
  cursor: pointer;
}

body.inbox-image-viewer-open {
  overflow: hidden;
}
/* ============================================================
   阶段 10：留人功能
     · .ov-card / .ov-grid / .ov-cell —— 首页概览卡
     · .ov-renew                      —— 群发服务到期提醒横幅
     · .ov-draft-tools                —— 恢复草稿 / 复制上次发送 / 清空草稿

   只新增 .ov-* 与 .draft-* 前缀，沿用已批准模板的视觉变量，
   不改动任何既有类。移动端（≤720px）用 2×2 网格，390px 无横向溢出。
   ============================================================ */

.ov-card {
  margin-bottom: 16px;
}

.ov-updated {
  color: var(--muted);
  font-size: 12px;
}

.ov-renew {
  margin-bottom: 12px;
}

.ov-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ov-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--canvas);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: default;
}

button.ov-cell {
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

button.ov-cell:hover {
  border-color: var(--blue);
  background: var(--surface);
}

button.ov-cell:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.ov-cell.is-ok {
  border-color: #bcdcc9;
  background: var(--green-soft);
}

.ov-k {
  color: var(--muted);
  font-size: 12px;
}

.ov-v {
  font-size: 22px;
  line-height: 1.25;
  color: var(--ink);
  word-break: break-word;
}

.ov-v.is-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 18px;
}

.ov-sub {
  color: var(--muted);
  font-size: 12px;
  word-break: break-word;
}

.ov-retry {
  margin-top: 6px;
  align-self: flex-start;
}

/* 二次修复 #3：无 auto_retry 时，「只重试失败目标」按钮隐藏、改显升级提示 */
.ov-retry-hint {
  margin-top: 6px;
  color: #9a5a00;
}

.ov-shortcuts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.ov-shortcuts button {
  min-width: 0;
  padding: 9px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafb;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ov-shortcuts button:hover,
.ov-shortcuts button:focus-visible {
  border-color: var(--blue);
  background: #eef5f9;
}

.ov-shortcuts strong,
.ov-shortcuts span {
  display: block;
}

.ov-shortcuts strong {
  font-size: 12.5px;
}

.ov-shortcuts span {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── 草稿 / 复制上次发送的工具条 ── */
.ov-draft-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.ov-draft-note {
  color: var(--muted);
  font-size: 12px;
}

/* ── 移动端：2×2 网格，绝不横向溢出 ── */
@media (max-width: 720px) {
  .ov-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ov-v {
    font-size: 19px;
  }

  .ov-cell {
    padding: 10px 12px;
  }

  .ov-shortcuts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* ══════════════════════════════════════════════════════════
   阶段14：升级入口（「我的」页 #svcUpgradeCard）
   卡片列表由 ch-service.js 的 renderUpgrade() 填充；窄屏改为纵向排列。
   ══════════════════════════════════════════════════════════ */
.svc-upgrade-card .svc-upgrade-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0 6px;
}
.svc-upgrade-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e6ecf3;
  border-radius: 10px;
  background: #f8fafd;
}
.svc-upgrade-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.svc-upgrade-info strong { font-size: 14px; color: #1f2d3d; }
.svc-upgrade-info span { font-size: 12px; color: #63788f; line-height: 1.5; }
@media (max-width: 520px) {
  .svc-upgrade-item { flex-direction: column; align-items: stretch; }
  .svc-upgrade-item .button { width: 100%; }
}

/* ══ 阶段17 P5：会员中心（页面流内，不悬浮、不遮挡）══ */
.me-member-card { background: #fbfcfe; }
.me-member-card .member-grid { margin-top: 4px; }
.me-member-card .member-grid dd { font-size: 13px; }
.member-future {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed #d8e2ee;
  border-radius: 8px;
  background: #f6f9fd;
}
.member-future-list { list-style: none; margin: 6px 0 0; padding: 0; }
.member-future-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  padding: 4px 0;
  font-size: 12px;
  color: #63788f;
}
.member-future-list li strong { font-size: 13px; color: #1f2d3d; }
#svcUpgradeCross { color: #8a6b2f; }
/* 后台「会员管理与升级」详情（只读区，服务端/接口驱动） */
#adminMemberDetail { margin: 14px 0 6px; }
#adminMemberDetail h3 { margin: 14px 0 6px; font-size: 14px; }
#adminMemberDetail #adminMemberTable th {
  width: 140px; text-align: left; color: #4a5b6d; font-weight: 500;
}
#adminMemberDetail table td, #adminMemberDetail table th { font-size: 13px; }

/* 2026-10-28：消息卡片最上面的「收消息的号」色块（同一个号固定一种颜色） */
.inbox-to-account {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  margin: 0 0 6px;
  padding: 4px 9px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.35;
  background: #e8f1fb;
  color: #164a7a;
}

.inbox-to-label {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .75);
  font-size: 11px;
  font-weight: 600;
}

.inbox-to-name {
  min-width: 0;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-to-c0 { background: #e3effc; color: #134a80; }
.inbox-to-c1 { background: #e4f5ea; color: #17613a; }
.inbox-to-c2 { background: #fdf0dc; color: #8a4b0a; }
.inbox-to-c3 { background: #f1e8fb; color: #5b2d8c; }
.inbox-to-c4 { background: #fde6ea; color: #93263c; }
.inbox-to-c5 { background: #def4f4; color: #0f5e60; }
/* 2026-10-28：消息页按好友归成对话框；点开后按时间显示整段对话 */
.inbox-conv-unread {
  padding: 0 6px;
  border-radius: 999px;
  background: #d93a3a;
  color: #fff;
  font-weight: 600;
}

.inbox-conv-hint {
  margin: 4px 0 0;
  color: #8796a3;
  font-size: 11px;
}

.inbox-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 60vh;
  margin: 8px 0 6px;
  padding: 8px;
  overflow-y: auto;
  border-radius: 10px;
  background: #f4f7fa;
}

.inbox-bubble {
  max-width: 82%;
  padding: 7px 10px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.inbox-bubble.is-in {
  align-self: flex-start;
  border-top-left-radius: 4px;
  background: #fff;
  color: #17324d;
  box-shadow: 0 1px 2px rgba(23, 50, 77, .08);
}

.inbox-bubble.is-out {
  align-self: flex-end;
  border-top-right-radius: 4px;
  background: #d8ecff;
  color: #123a5e;
}

.inbox-bubble.is-pending { opacity: .65; }
.inbox-bubble.is-failed { background: #fde6ea; color: #93263c; }

.inbox-bubble-text {
  margin: 0;
  white-space: pre-wrap;
}

.inbox-bubble .inbox-message-image-link {
  display: block;
  margin-top: 6px;
}

.inbox-bubble-time {
  display: block;
  margin-top: 3px;
  color: #8796a3;
  font-size: 10.5px;
}

.inbox-bubble.is-out .inbox-bubble-time { text-align: right; }
