:root {
  color-scheme: light;
  --ink: #10251f;
  --muted: #66756f;
  --green: #07664e;
  --green-soft: #e7f3ee;
  --gold: #b97700;
  --gold-soft: #fff3d5;
  --red: #c9362b;
  --line: #d9e1dc;
  --paper: #fffefa;
  --page: #f4f3ec;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--page); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 72px; padding: 12px max(20px, calc((100vw - 1040px) / 2));
  background: rgba(255, 254, 250, .96); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand > span { display: grid; place-items: center; width: 40px; height: 40px; color: #fff; background: var(--green); border-radius: 6px; font: 700 22px serif; }
.brand div { display: grid; gap: 2px; }
.brand strong { font-size: 20px; }
.brand small, .eyebrow { color: var(--green); font-size: 12px; }

.page-shell { width: min(100% - 32px, 1040px); margin: 28px auto 56px; }
.account-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 30px; color: #fff; background: #074b3b; border-radius: 8px;
}
.account-summary .eyebrow { margin: 0 0 8px; color: #cce9de; }
.account-summary h1 { margin: 0 0 8px; font-size: 30px; letter-spacing: 0; }
.account-summary p:last-child { margin: 0; color: #d7e8e1; }
.state-pill, .small-state { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; border: 1px solid transparent; }
.state-pill { min-width: 92px; min-height: 38px; padding: 8px 14px; border-radius: 20px; font-weight: 700; }
.state-pill.active { color: #07513f; background: #dff6ea; }
.state-pill.pending, .state-pill.expired, .state-pill.paused { color: #7c5200; background: var(--gold-soft); }

.rights-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.rights-grid > div, .content-section { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.rights-grid > div { display: grid; gap: 7px; min-height: 88px; padding: 18px 20px; }
.rights-grid span, .package-meta, .order-meta, .session-item small { color: var(--muted); font-size: 13px; }
.rights-grid strong { font-size: 20px; }

.service-actions { display: flex; gap: 12px; margin-bottom: 16px; }
.primary-link, .secondary-link, .quiet-button, .package-action {
  display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 18px;
  border: 1px solid var(--green); border-radius: 6px; cursor: pointer;
}
.primary-link, .package-action { color: #fff; background: var(--green); }
.secondary-link, .quiet-button { color: var(--green); background: transparent; }
.primary-link.is-disabled { color: #8b9590; background: #eef0ed; border-color: #d5d9d6; pointer-events: none; }
.quiet-button.compact { min-height: 36px; padding: 6px 12px; }

.content-section { margin-top: 16px; padding: 22px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-head p, .section-head h2 { margin: 0; }
.section-head h2 { margin-top: 4px; font-size: 21px; }
.small-state { padding: 6px 10px; color: #805600; background: var(--gold-soft); border-color: #efd390; border-radius: 16px; font-size: 12px; }
.package-list, .order-list, .session-list { display: grid; gap: 10px; }
.recovery-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.recovery-form label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; }
.recovery-form input {
  width: 100%; min-height: 42px; padding: 9px 11px; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 6px; outline: none;
}
.recovery-form input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(7, 102, 78, .1); }
.package-item, .order-item, .session-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.package-item strong, .order-item strong { display: block; margin-bottom: 5px; }
.package-price { color: var(--red); font-size: 21px; font-weight: 800; }
.package-action[disabled] { opacity: .55; cursor: wait; }
.order-status { justify-self: end; padding: 5px 9px; border-radius: 14px; color: #805600; background: var(--gold-soft); font-size: 12px; font-weight: 700; }
.order-status.activated { color: var(--green); background: var(--green-soft); }
.order-status.canceled { color: var(--muted); background: #eef0ee; }
.section-note { margin: 14px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.empty-line { min-height: 70px; display: grid; place-items: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 6px; }

.notice { position: fixed; left: 50%; bottom: 28px; z-index: 20; transform: translateX(-50%); max-width: min(90vw, 560px); padding: 12px 18px; color: #fff; background: var(--green); border-radius: 6px; box-shadow: 0 12px 28px rgba(0, 0, 0, .18); }
.notice.error { background: #9f2d26; }
footer { padding: 24px; color: var(--muted); text-align: center; font-size: 12px; }

@media (max-width: 680px) {
  .topbar { min-height: 62px; padding: 10px 16px; }
  .page-shell { width: min(100% - 24px, 1040px); margin-top: 14px; }
  .account-summary { align-items: flex-start; padding: 22px 18px; }
  .account-summary h1 { font-size: 25px; }
  .rights-grid { grid-template-columns: 1fr; }
  .rights-grid > div { min-height: 70px; }
  .service-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .content-section { padding: 17px 14px; }
  .package-item, .order-item, .session-item { grid-template-columns: 1fr; }
  .recovery-form { grid-template-columns: 1fr; }
  .package-action, .order-status { justify-self: stretch; }
}
