/* 账号页 / 购买页样式 —— 继承 product-page.css 的设计变量(--paper/--ink/--coral/--night 等),
 * 深色模式沿用同一套 html[data-eye-theme="dark"] 令牌。只写子页面独有的布局与组件。
 */

.sub-hero {
  width: min(calc(100% - 48px), var(--reading));
  margin: 0 auto;
  padding: clamp(140px, 15vw, 190px) 0 clamp(30px, 4vw, 54px);
}

.sub-hero h1 {
  margin-top: clamp(18px, 2.6vw, 30px);
  font-family: var(--display-font);
  font-size: clamp(46px, 6.4vw, 88px);
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 0.96;
}

.sub-hero > p:not(.section-index) {
  max-width: 580px;
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.7;
}

.sub-main {
  display: grid;
  width: min(calc(100% - 48px), var(--reading));
  margin: 0 auto;
  padding-bottom: 110px;
  gap: 22px;
}

.panel {
  padding: clamp(24px, 3.4vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper-bright);
  box-shadow: 0 24px 70px rgba(45, 42, 36, 0.08);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.panel-head h2 {
  font-size: clamp(19px, 2.2vw, 24px);
  font-weight: 760;
  letter-spacing: -0.015em;
}

.hint {
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.6;
}

.panel-head .hint {
  max-width: 46%;
  text-align: right;
}

/* —— 表单 —— */
.form-grid {
  display: grid;
  max-width: 460px;
  gap: 16px;
}

.field > label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.06em;
}

.field input {
  width: 100%;
  height: 48px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--white);
  color: var(--ink);
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus-visible {
  border-color: var(--coral-deep);
  box-shadow: 0 0 0 3px rgba(255, 101, 86, 0.18);
  outline: none;
}

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.form-actions {
  margin-top: 4px;
}

.form-status {
  min-height: 20px;
  margin: 0;
  color: var(--coral-ink);
  font-size: 13px;
  font-weight: 680;
}

.form-status.is-ok {
  color: #2c7a4b;
  font-weight: 500;
}

/* 按钮的紧凑/幽灵变体(product-page.css 只有 is-dark 大号胶囊) */
.button.is-compact {
  min-width: 0;
  min-height: 48px;
  padding: 0 18px;
  gap: 0;
  font-size: 12px;
}

.button.is-ghost {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.button.is-ghost:hover:not(:disabled) {
  border-color: var(--ink);
  background: rgba(17, 18, 16, 0.04);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* —— 元信息列表 —— */
.meta-list {
  display: grid;
  gap: 12px;
}

.meta-list > div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: baseline;
}

.meta-list dt {
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.06em;
}

.meta-list dd {
  margin: 0;
  font-size: 14px;
  font-weight: 640;
  word-break: break-all;
}

.meta-list.is-compact {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px 18px;
}

.meta-list.is-compact > div {
  grid-template-columns: 1fr;
  gap: 2px;
}

.meta-list.is-compact dd {
  font-size: 13px;
  font-weight: 560;
}

/* —— 授权记录 —— */
.license-list {
  display: grid;
  gap: 12px;
}

.license-item {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
}

.license-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.license-head strong {
  font-size: 15px;
}

.empty-state {
  margin: 0;
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--ink-faint);
  font-size: 13px;
  line-height: 1.7;
}

.empty-state + .text-action {
  margin-top: 12px;
}

/* —— 状态胶囊 —— */
.state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 11px;
  border: 1px solid rgba(187, 57, 45, 0.34);
  border-radius: 999px;
  color: var(--coral-ink);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.state-pill.is-ok {
  border-color: rgba(44, 122, 75, 0.4);
  color: #2c7a4b;
}

.state-pill.is-muted {
  border-color: var(--line-strong);
  color: var(--ink-faint);
}

.state-pill.is-bad {
  border-color: rgba(187, 57, 45, 0.5);
  color: var(--coral-ink);
}

/* —— 购买页 —— */
.store-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.eyebrow-mini {
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.product-card h2 {
  margin-top: 10px;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 780;
  letter-spacing: -0.02em;
}

.card-sub {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 14px;
}

.feature-list {
  display: grid;
  gap: 9px;
  margin: 18px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.feature-list li {
  position: relative;
  padding-left: 18px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

.feature-list li::before {
  position: absolute;
  top: 0.62em;
  left: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
  content: "";
}

.price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.price {
  margin: 0;
  font-family: var(--display-font);
  font-size: 26px;
  font-weight: 780;
  letter-spacing: -0.02em;
}

.channel-card {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: clamp(22px, 3vw, 34px);
  align-items: center;
}

.channel-qr img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
}

.channel-copy h2 {
  margin-top: 10px;
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 760;
  letter-spacing: -0.015em;
}

.channel-copy p:not(.eyebrow-mini) {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.75;
}

.channel-copy strong {
  color: var(--ink);
}

/* —— 账号页:面板标题行 / 身份条 / 授权统计 —— */
.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.identity-bar {
  display: flex;
  align-items: center;
  gap: 16px;
}

.identity-avatar {
  display: grid;
  flex: 0 0 40px;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--coral);
  color: var(--white);
  font-size: 16px;
  font-weight: 800;
}

.identity-meta {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.identity-meta strong {
  font-size: 15px;
  font-weight: 700;
  word-break: break-all;
}

.identity-meta span {
  color: var(--ink-faint);
  font-size: 12px;
}

.identity-bar .text-action {
  flex: 0 0 auto;
  margin-left: auto;
}

.license-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.license-stats[hidden] {
  display: none;
}

.license-stats > div {
  display: grid;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
}

.license-stats strong {
  font-family: var(--display-font);
  font-size: 26px;
  font-weight: 780;
  letter-spacing: -0.02em;
}

.license-stats span {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.08em;
}

/* —— 购买页:视图切换 tab —— */
.buy-tabs {
  display: flex;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-bright);
}

.buy-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 13px;
  font-weight: 760;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.buy-tab:hover:not(.is-active) {
  background: rgba(17, 18, 16, 0.05);
  color: var(--ink);
}

.buy-tab.is-active {
  background: var(--ink);
  color: var(--white);
}

.cart-count {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--coral);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  place-items: center;
}

.cart-count[hidden] {
  display: none;
}

.buy-view {
  display: grid;
  gap: 22px;
}

.buy-view[hidden] {
  display: none;
}

.buy-view.is-active {
  animation: buy-view-in 0.3s ease both;
}

@keyframes buy-view-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .buy-view.is-active {
    animation: none;
  }
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.cart-side {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.cart-side .text-action {
  min-height: 32px;
  white-space: nowrap;
}

.intent-account {
  margin-bottom: 18px;
}

.intent-account-line,
.orders-session-line {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

.intent-account .text-action,
.orders-session .text-action {
  min-height: 36px;
  margin-top: 6px;
}

.intent-actions {
  margin-top: 4px;
}

.orders-session {
  margin-bottom: 18px;
}

/* —— 购买页:产品详情层 —— */
.product-dialog {
  width: min(calc(100% - 48px), 880px);
  max-height: calc(100vh - 96px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper-bright);
  color: var(--ink);
  box-shadow: 0 40px 120px rgba(14, 14, 14, 0.35);
}

.product-dialog::backdrop {
  background: rgba(14, 14, 14, 0.45);
  backdrop-filter: blur(6px);
}

.dialog-inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
}

.dialog-media {
  display: grid;
  margin: 0;
  padding: clamp(20px, 3vw, 34px);
  background:
    radial-gradient(circle at 20% 85%, rgba(122, 76, 255, 0.2), transparent 40%),
    var(--night);
  place-items: center;
}

.dialog-media img {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  border-radius: var(--radius-md);
}

.dialog-copy {
  padding: clamp(22px, 3vw, 34px);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.dialog-close {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  place-items: center;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.dialog-close:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.dialog-copy h2 {
  margin-top: 10px;
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 780;
  letter-spacing: -0.02em;
}

.dialog-meta {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

/* —— 深色模式覆盖(与 product-page.css 深色块同一令牌) —— */
html[data-eye-theme="dark"] .sub-hero h1,
html[data-eye-theme="dark"] .panel h2,
html[data-eye-theme="dark"] .product-card h2,
html[data-eye-theme="dark"] .channel-copy h2,
html[data-eye-theme="dark"] .price {
  color: #eeede7;
}

html[data-eye-theme="dark"] .sub-hero .section-index {
  color: #9c9b95;
}

html[data-eye-theme="dark"] .sub-hero .section-index > span {
  color: var(--coral);
}

html[data-eye-theme="dark"] .eyebrow-mini {
  color: #8f8e88;
}

/* button 版的 text-action 要重置 UA 按钮默认样式(product-page.css 里它是按 <a> 设计的) */
button.text-action {
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

html[data-eye-theme="dark"] .text-action {
  border-color: rgba(255, 255, 255, 0.28);
  color: #c9c8c2;
}

html[data-eye-theme="dark"] .text-action:hover {
  border-color: #fff;
  color: #fff;
}

html[data-eye-theme="dark"] .sub-hero > p:not(.section-index),
html[data-eye-theme="dark"] .card-sub,
html[data-eye-theme="dark"] .feature-list li,
html[data-eye-theme="dark"] .channel-copy p:not(.eyebrow-mini) {
  color: #aaa9a3;
}

html[data-eye-theme="dark"] .panel {
  border-color: rgba(255, 255, 255, 0.1);
  background: #1b1b19;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

html[data-eye-theme="dark"] .field input {
  border-color: rgba(255, 255, 255, 0.18);
  background: #141413;
  color: #eeede7;
}

html[data-eye-theme="dark"] .license-item {
  border-color: rgba(255, 255, 255, 0.1);
  background: #141413;
}

html[data-eye-theme="dark"] .empty-state {
  border-color: rgba(255, 255, 255, 0.2);
  color: #8f8e88;
}

html[data-eye-theme="dark"] .button.is-ghost {
  border-color: rgba(255, 255, 255, 0.22);
  color: #eeede7;
}

html[data-eye-theme="dark"] .button.is-ghost:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.06);
}

html[data-eye-theme="dark"] .feature-list,
html[data-eye-theme="dark"] .price-row {
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-eye-theme="dark"] .channel-copy strong,
html[data-eye-theme="dark"] .license-head strong,
html[data-eye-theme="dark"] .meta-list dd {
  color: #eeede7;
}

html[data-eye-theme="dark"] .channel-qr img {
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-eye-theme="dark"] .form-status.is-ok,
html[data-eye-theme="dark"] .state-pill.is-ok {
  color: #7fc79a;
  border-color: rgba(127, 199, 154, 0.4);
}

html[data-eye-theme="dark"] .state-pill.is-muted {
  border-color: rgba(255, 255, 255, 0.2);
  color: #8f8e88;
}

html[data-eye-theme="dark"] .hint {
  color: #8f8e88;
}

html[data-eye-theme="dark"] .identity-meta strong,
html[data-eye-theme="dark"] .license-stats strong,
html[data-eye-theme="dark"] .dialog-copy h2 {
  color: #eeede7;
}

html[data-eye-theme="dark"] .identity-meta span,
html[data-eye-theme="dark"] .license-stats span {
  color: #8f8e88;
}

html[data-eye-theme="dark"] .intent-account-line,
html[data-eye-theme="dark"] .orders-session-line {
  color: #aaa9a3;
}

html[data-eye-theme="dark"] .license-stats > div {
  border-color: rgba(255, 255, 255, 0.1);
  background: #141413;
}

html[data-eye-theme="dark"] .buy-tabs {
  border-color: rgba(255, 255, 255, 0.1);
  background: #1b1b19;
}

html[data-eye-theme="dark"] .buy-tab {
  color: #aaa9a3;
}

html[data-eye-theme="dark"] .buy-tab:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.06);
  color: #eeede7;
}

html[data-eye-theme="dark"] .buy-tab.is-active {
  background: #efeee8;
  color: #171715;
}

html[data-eye-theme="dark"] .product-dialog {
  border-color: rgba(255, 255, 255, 0.1);
  background: #1b1b19;
  color: #eeede7;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.5);
}

html[data-eye-theme="dark"] .dialog-close {
  border-color: rgba(255, 255, 255, 0.22);
  color: #c9c8c2;
}

html[data-eye-theme="dark"] .dialog-close:hover {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

html[data-eye-theme="dark"] .dialog-meta {
  border-color: rgba(255, 255, 255, 0.1);
}

/* —— 窄屏 —— */
@media (max-width: 720px) {
  .store-grid {
    grid-template-columns: 1fr;
  }

  .channel-card {
    grid-template-columns: 1fr;
  }

  .channel-qr {
    max-width: 210px;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .panel-head .hint {
    max-width: none;
    text-align: left;
  }

  .code-row {
    grid-template-columns: 1fr;
  }

  .meta-list > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .buy-tabs {
    width: 100%;
  }

  .buy-tab {
    flex: 1 0 auto;
    justify-content: center;
  }

  .license-head {
    flex-wrap: wrap;
  }

  .cart-side {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .dialog-inner {
    grid-template-columns: 1fr;
  }

  .dialog-media img {
    max-width: 220px;
  }

  .identity-bar {
    flex-wrap: wrap;
  }

  .identity-bar .text-action {
    margin-left: 0;
  }

  .license-stats {
    gap: 8px;
  }

  .license-stats > div {
    padding: 12px;
  }

  .license-stats strong {
    font-size: 22px;
  }
}
