/* AI租界 (AI Enclave) member portal — owners (闲置设备托管出租) and tenants (租用).
   Loaded after styles.css; every colour, radius and type token comes from the site. */

.portal { width: min(1080px, 100% - var(--gutter) * 2); margin-inline: auto; padding: clamp(28px, 4vw, 56px) 0 clamp(64px, 8vw, 120px); min-height: 60vh; }
.portal:focus { outline: none; }
.p-loading { color: var(--ink-3); padding: 48px 0; }

/* nav: four destinations stay visible at every width, wrapping instead of scrolling */
.p-nav a.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(23,28,36,.10), 0 0 0 1px rgba(23,28,36,.04); }
.p-account { font-size: 14px; color: var(--ink-2); }
#p-account { flex-wrap: wrap; justify-content: flex-end; }
.p-mine { padding: 8px 12px; border-radius: var(--r-md); font-size: 14.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.p-mine:hover { color: var(--ink); }
.p-mine.is-active { color: var(--ink); background: var(--bg-2); }
@media (max-width: 1040px) {
  .nav__row:has(.p-nav) { height: auto; flex-wrap: wrap; padding-block: 12px; gap: 10px 16px; }
  .p-nav { display: flex; order: 3; width: 100%; flex-wrap: wrap; margin-left: 0; border-radius: var(--r-md); }
  .p-nav a { flex: 1 1 auto; text-align: center; white-space: nowrap; }
}
.p-footer a { text-decoration: underline; text-underline-offset: 3px; }
/* the site hides ghost buttons in the nav on small screens; here they are 登录 / 退出 and must stay */
#p-account .btn--ghost { display: inline-flex; }

/* page head */
.p-head { margin-bottom: clamp(24px, 3vw, 40px); }
.p-head h1 { font-size: clamp(30px, 4.4vw, 52px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.12; text-wrap: balance; max-width: 18em; }
.p-head p { margin-top: 16px; font-size: 17px; color: var(--ink-2); max-width: 40em; }
.p-head .btn { margin-top: 24px; }
.p-sub { margin: clamp(36px, 5vw, 64px) 0 16px; font-size: 22px; letter-spacing: -0.02em; }
.p-note { font-size: 14px; color: var(--ink-3); }
.p-back { display: inline-block; margin-bottom: 20px; font-size: 14px; color: var(--ink-2); }
.p-back:hover { color: var(--accent-ink); }

/* how it works: a real sequence, so it is numbered */
.p-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 0; border-top: 1px solid var(--line); }
.p-steps li { counter-increment: step; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 12px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.p-steps li::before { content: counter(step); grid-row: 1 / span 2; font-size: 15px; font-weight: 500; color: var(--accent-ink); font-variant-numeric: tabular-nums; padding-top: 2px; }
.p-steps strong { font-weight: 500; }
.p-steps span { grid-column: 2; color: var(--ink-2); font-size: 15px; }

/* plain facts list */
.p-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; margin: 0; }
.p-facts div { padding: 16px 0; border-top: 1px solid var(--line); }
.p-facts dt { font-weight: 500; }
.p-facts dd { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; }
@media (max-width: 720px) { .p-facts { grid-template-columns: 1fr; } }

/* cards: used only for things you pick or act on */
.p-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(20px, 2.6vw, 28px); }
.p-card + .p-card { margin-top: 16px; }
.p-card__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.p-card__title { font-size: 19px; font-weight: 500; letter-spacing: -0.015em; }
.p-card__meta { margin-top: 4px; font-size: 14px; color: var(--ink-3); }
.p-card__body { margin-top: 16px; display: grid; gap: 16px; }

.p-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.p-pick { position: relative; display: grid; gap: 4px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); cursor: pointer; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.p-pick:hover { border-color: var(--line-strong); }
.p-pick input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.p-pick:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 14px 34px rgba(42,82,240,.10); }
.p-pick:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.p-pick__name { font-size: 18px; font-weight: 500; letter-spacing: -0.015em; }
.p-pick__spec { color: var(--ink-2); font-size: 14.5px; }
.p-pick__price { margin-top: 10px; font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }
.p-pick__price small { font-size: 13px; font-weight: 400; color: var(--ink-3); }

/* country filter: every country stays visible, the row wraps instead of scrolling */
.p-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: clamp(20px, 2.6vw, 28px); }
.p-tabs a { display: inline-flex; align-items: baseline; gap: 8px; padding: 8px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); font-size: 15px; font-weight: 500; color: var(--ink-2); transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.p-tabs a small { font-size: 12.5px; font-weight: 400; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.p-tabs a:hover { border-color: var(--line-strong); color: var(--ink); }
.p-tabs a.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.p-tabs a.is-on small { color: rgba(255,255,255,.7); }
/* member centre */
.p-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.p-duo .p-card + .p-card { margin-top: 0; }
.p-duo .p-card { display: grid; gap: 16px; justify-items: start; }
.p-duo .p-card__head { width: 100%; }
@media (max-width: 820px) { .p-duo { grid-template-columns: 1fr; } }
.p-counts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; color: var(--ink-2); font-size: 15.5px; }
.p-counts b { display: inline-block; min-width: 1.6em; font-size: 20px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.p-details { margin-top: 12px; }
.p-details summary { cursor: pointer; color: var(--accent-ink); font-size: 14.5px; }
.p-pre { margin: 10px 0 0; padding: 16px 16px; border-radius: var(--r-md); background: var(--bg-2); font: inherit; font-size: 14px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }

/* one block per country */
.p-country { padding: 24px 0 28px; border-top: 1px solid var(--line); }
.p-country__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; margin-bottom: 16px; }
.p-country__head h2 { font-size: 22px; letter-spacing: -0.02em; }
.p-country__head ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; padding: 0; font-size: 14px; color: var(--ink-3); }
.p-country__empty { margin: 0; font-size: 15px; color: var(--ink-3); }
.p-pick__min { font-size: 13px; color: var(--ink-3); }
.p-order { border-top: 1px solid var(--line); }
.p-order .p-sub { margin-top: clamp(24px, 3vw, 36px); }
.p-order__device { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }

/* status chips */
.p-chip { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: var(--r-md); font-size: 13px; font-weight: 500; background: var(--bg-2); color: var(--ink-2); white-space: nowrap; }
.p-chip--wait { background: #FFF4DE; color: #8A5A00; }
.p-chip--go { background: var(--accent-soft); color: var(--accent-ink); }
.p-chip--ok { background: #DFF7EC; color: #0B6B4B; }
.p-chip--stop { background: #FDE8E6; color: #B42318; }

/* key numbers */
.p-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.p-stats div { padding: 20px 20px; }
.p-stats div + div { border-left: 1px solid var(--line); }
.p-stats dt { font-size: 14px; color: var(--ink-2); }
.p-stats dd { margin: 6px 0 0; font-size: clamp(22px, 3vw, 30px); font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.p-stats small { display: block; margin-top: 4px; font-size: 12.5px; color: var(--ink-3); }
@media (max-width: 640px) { .p-stats { grid-template-columns: 1fr; } .p-stats div + div { border-left: 0; border-top: 1px solid var(--line); } }

/* definition rows inside a card */
.p-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 24px; margin: 0; }
.p-rows dt { font-size: 13px; color: var(--ink-3); }
.p-rows dd { margin: 2px 0 0; font-size: 15px; overflow-wrap: anywhere; }

/* tables stack into labelled rows on small screens instead of scrolling sideways */
.p-table { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.p-table th, .p-table td { padding: 10px 12px 10px 0; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.p-table th { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.p-table a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 720px) {
  .p-table thead { display: none; }
  .p-table tr { display: grid; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .p-table td { display: flex; justify-content: space-between; gap: 16px; padding: 0; border: 0; }
  .p-table td::before { content: attr(data-label); color: var(--ink-3); font-size: 13px; }
}

/* forms */
.p-form { display: grid; gap: 20px; max-width: 640px; }
.p-form--wide { max-width: none; }
.p-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .p-form__row { grid-template-columns: 1fr; } }
.p-form select { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 16px; width: 100%; }
.p-input { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; width: 100%; }
.p-check { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; color: var(--ink-2); cursor: pointer; }
.p-check input { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.p-check a, .p-link { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.p-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.p-msg { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.p-msg.is-error { color: #B42318; }
.p-msg.is-ok { color: #0B6B4B; }
.p-file { display: grid; gap: 8px; }
.p-file input[type="file"] { padding: 10px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); background: var(--bg); width: 100%; font: inherit; font-size: 14px; }
.p-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.p-thumbs li { position: relative; }
.p-thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); display: block; }
.p-thumbs button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); font-size: 13px; line-height: 1; cursor: pointer; }
.btn--danger { background: transparent; color: #B42318; border-color: #F1B8B2; }
.btn--danger:hover { background: #FDE8E6; }
.btn:disabled { opacity: .55; cursor: default; }

/* the block a tenant actually came for */
.p-access { background: var(--rack); color: var(--rack-text); border-radius: var(--r-md); padding: 16px 20px; }
.p-access h3 { font-size: 14px; font-weight: 500; color: var(--rack-text-2); }
.p-access pre { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14px; line-height: 1.7; }
.p-pay { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 20px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.p-thread { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.p-thread li { padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-md); font-size: 14.5px; }
.p-thread p + p { margin-top: 6px; }
.p-reply { color: var(--ink-2); }
.p-empty { padding: 40px 0; border-top: 1px solid var(--line); color: var(--ink-2); }

/* agreement */
.p-doc { max-width: 760px; font-size: 16px; line-height: 1.85; color: #262D38; }
.p-doc h1 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.03em; line-height: 1.2; margin-bottom: 20px; }
.p-doc h2 { font-size: 20px; margin: 32px 0 8px; }
.p-doc p { margin: 8px 0; }
.p-doc ol { margin: 8px 0; padding-left: 1.5em; }
.p-doc li + li { margin-top: 6px; }

.footer__links { display: inline-flex; flex-wrap: wrap; gap: 4px 20px; }

/* sign-up: the emailed code and its send button share one row */
.p-code { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.p-code input { letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.p-code .btn { height: auto; min-height: 44px; min-width: 112px; }
.p-code__msg.is-error { color: #B42318; }
.p-code__msg.is-ok { color: #0B6B4B; }
/* forms inside a card use the card's full width */
.p-card.p-form > .field, .p-card.p-form > .p-actions { justify-self: stretch; }
/* phones: the header keeps to the switch, the account link and log out; the member's name is on the account page */
@media (max-width: 560px) { #p-account .p-account { display: none; } #p-account { flex-wrap: nowrap; } }

/* password box with a show / hide eye */
.p-pass { position: relative; display: block; }
.p-pass input { padding-right: 52px; }
.p-pass__eye { position: absolute; top: 50%; right: 4px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: var(--r-sm); background: none; color: var(--ink-3); cursor: pointer; transform: translateY(-50%); transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.p-pass__eye:hover { color: var(--ink); background: var(--bg-2); }
.p-pass__eye:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.p-pass__eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
