:root {
  color: #26322b;
  background: #f7fbf4;
  font-family: "Helvetica Neue", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #121915;
  --text: #33413a;
  --muted: #68776f;
  --paper: #ffffff;
  --line: #dce8d8;
  --line-strong: #c8dac3;
  --green: #168449;
  --green-dark: #105f37;
  --green-soft: #edf8e9;
  --blue: #2563b8;
  --blue-soft: #edf5ff;
  --orange: #c65a1e;
  --orange-soft: #fff4e8;
  --red: #b73830;
  --red-soft: #fff0ef;
  --dark: #101814;
  --shadow: 0 16px 42px rgba(18, 38, 25, 0.08);
  --radius: 8px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(241, 251, 235, 0.94), rgba(255, 255, 255, 0.96) 48%, rgba(237, 249, 242, 0.92)),
    linear-gradient(180deg, #f9fcf6, #f4faef 46%, #ffffff);
}

body,
button,
input,
select,
textarea { font: inherit; }

a { color: inherit; text-decoration: none; }

button,
a { -webkit-tap-highlight-color: transparent; }

:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid #63d694;
  outline-offset: 3px;
}

h1,
h2,
h3,
p { margin: 0; letter-spacing: 0; }

.portal-header {
  position: sticky;
  top: 0;
  z-index: 30;
  color: #f5fbf7;
  border-bottom: 1px solid rgba(225, 244, 231, 0.14);
  background: linear-gradient(90deg, rgba(12, 21, 16, 0.91), rgba(18, 31, 23, 0.86), rgba(10, 20, 15, 0.91));
  box-shadow: 0 16px 34px rgba(13, 25, 18, 0.14);
  backdrop-filter: blur(18px) saturate(140%);
}

.portal-header-inner {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 28px;
  width: min(1180px, calc(100% - 40px));
  min-height: 68px;
  margin: 0 auto;
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  font-size: 19px;
  font-weight: 800;
}

.portal-brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #b8f08b;
  border: 1px solid rgba(184, 240, 139, 0.42);
  border-radius: 7px;
  font-size: 14px;
  font-weight: 900;
}

.portal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.portal-nav a {
  min-height: 36px;
  padding: 9px 12px;
  color: #bfccc4;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 650;
}

.portal-nav a:hover,
.portal-nav a.active { color: #fff; background: rgba(255, 255, 255, 0.08); }

.account-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.account-name {
  display: grid;
  min-width: 0;
  text-align: right;
}

.account-name strong,
.account-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-name strong { font-size: 12px; }
.account-name span { color: #9fb0a6; font-size: 11px; }

.portal-shell {
  width: min(1180px, calc(100% - 40px));
  min-height: calc(100vh - 68px);
  margin: 0 auto;
  padding: 48px 0 80px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 26px;
}

.page-heading-copy { max-width: 760px; }

.page-kicker {
  display: block;
  margin-bottom: 10px;
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.page-heading h1 {
  max-width: 780px;
  color: var(--ink);
  font-size: 48px;
  line-height: 1.08;
  font-weight: 780;
}

.page-heading p {
  max-width: 700px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.68;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 16px;
  border: 1px solid #bdcbbb;
  border-radius: 6px;
  color: #26332c;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
}

.button:hover { border-color: #91aa8c; background: #fbfef9; }

.button.primary {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
  box-shadow: 0 9px 20px rgba(22, 132, 73, 0.17);
}

.button.primary:hover { border-color: var(--green-dark); background: var(--green-dark); }
.button.dark { color: #fff; border-color: #314138; background: #18231d; }
.button.danger { color: var(--red); border-color: #e4b8b4; background: #fff; }
.button.full { width: 100%; }
.button[disabled] { cursor: not-allowed; opacity: 0.5; }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 26px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.metric {
  min-width: 0;
  padding: 22px 24px;
  border-right: 1px solid var(--line);
}

.metric:last-child { border-right: 0; }
.metric span { display: block; color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.metric strong { display: block; margin-top: 7px; color: var(--ink); font-size: 28px; line-height: 1; }
.metric small { display: block; margin-top: 7px; color: #78867e; font-size: 11px; }

.portal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.8fr);
  gap: 22px;
  align-items: start;
}

.portal-grid.spaced { margin-top: 22px; }
.section-body { padding: 22px; }

.section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 19px 22px;
  border-bottom: 1px solid var(--line);
}

.section-header h2 { color: var(--ink); font-size: 17px; font-weight: 760; }
.section-header p { margin-top: 4px; color: var(--muted); font-size: 12px; }

.order-list { display: grid; }

.order-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.25fr) minmax(140px, 0.7fr) minmax(130px, 0.65fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 94px;
  padding: 17px 22px;
  border-bottom: 1px solid #e8efe5;
}

.order-row:last-child { border-bottom: 0; }
.order-row:hover { background: rgba(244, 250, 240, 0.72); }
.order-title { min-width: 0; }
.order-title strong { display: block; overflow: hidden; color: var(--ink); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.order-title span { display: block; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.order-meta span { display: block; color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.order-meta strong { display: block; margin-top: 5px; color: #34423a; font-size: 12px; font-weight: 700; }

.status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 25px;
  padding: 5px 9px;
  border: 1px solid #d5dfd2;
  border-radius: 999px;
  color: #526158;
  background: #f8faf7;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.status.good { color: #136239; border-color: #b8dfbd; background: var(--green-soft); }
.status.info { color: #235990; border-color: #bed4ed; background: var(--blue-soft); }
.status.warning { color: #8f481e; border-color: #e8c49f; background: var(--orange-soft); }
.status.danger { color: #8e302a; border-color: #e8b6b2; background: var(--red-soft); }

.notification-list { display: grid; }

.notification {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 13px;
  padding: 17px 20px;
  border-bottom: 1px solid #e8efe5;
}

.notification:last-child { border-bottom: 0; }
.notification-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--green); }
.notification.read .notification-dot { background: #bdc7c0; }
.notification h3 { color: var(--ink); font-size: 13px; line-height: 1.35; }
.notification p { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.notification a { display: inline-flex; margin-top: 9px; color: var(--blue); font-size: 11px; font-weight: 750; }

.notice {
  margin-bottom: 20px;
  padding: 13px 16px;
  color: #1d5b38;
  border: 1px solid #bcdcbc;
  border-left: 3px solid var(--green);
  border-radius: 6px;
  background: #f4fbf0;
  font-size: 12px;
  line-height: 1.5;
}

.notice.error { color: #7e312c; border-color: #e5b5b1; border-left-color: var(--red); background: #fff7f6; }

.empty-state { padding: 42px 24px; text-align: center; }
.empty-state h3 { color: var(--ink); font-size: 17px; }
.empty-state p { max-width: 430px; margin: 8px auto 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 36px 20px;
  background: linear-gradient(120deg, #0f1913, #19281e 54%, #102018);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(290px, 0.85fr) minmax(360px, 1fr);
  width: min(920px, 100%);
  overflow: hidden;
  border: 1px solid rgba(227, 247, 231, 0.15);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
}

.login-intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 520px;
  padding: 38px;
  color: #f6fbf7;
  background: linear-gradient(155deg, #12231a, #1b3928 65%, #1d522f);
}

.login-intro .portal-brand { color: #fff; }
.login-intro h1 { margin-top: auto; color: #fff; font-size: 37px; line-height: 1.12; }
.login-intro p { margin-top: 16px; color: #c4d3c9; font-size: 14px; line-height: 1.65; }
.login-assurances { display: grid; gap: 11px; margin-top: 30px; color: #dbe8df; font-size: 12px; }
.login-assurances span::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 9px; border-radius: 50%; background: #8dde77; }

.login-form-panel { display: flex; flex-direction: column; justify-content: center; padding: 46px; }
.login-form-panel h2 { color: var(--ink); font-size: 25px; }
.login-form-panel > p { margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.6; }

.form-grid { display: grid; gap: 16px; margin-top: 28px; }
.field { display: grid; gap: 7px; }
.field > span { color: #405047; font-size: 11px; font-weight: 760; }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  color: var(--ink);
  border: 1px solid #cdd9c9;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
}

.field textarea { min-height: 104px; resize: vertical; line-height: 1.5; }
.field input::placeholder,
.field textarea::placeholder { color: #9aa59e; }

.consent-field {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  color: #59675f;
  font-size: 11px;
  line-height: 1.5;
}

.consent-field input { width: 15px; height: 15px; margin: 1px 0 0; accent-color: var(--green); }
.form-help { color: var(--muted); font-size: 10px; line-height: 1.5; }
.form-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: #929e97; font-size: 10px; }
.form-divider::before,
.form-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.product-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.product-option { position: relative; }
.product-option input { position: absolute; opacity: 0; pointer-events: none; }
.product-option label {
  display: grid;
  min-height: 152px;
  padding: 17px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}

.product-option label:hover { border-color: #8bad83; }
.product-option input:checked + label { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); background: #fbfef9; }
.product-option label span { color: var(--green-dark); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.product-option label strong { margin-top: 6px; color: var(--ink); font-size: 15px; }
.product-option label p { margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.product-option label b { margin-top: auto; color: var(--ink); font-size: 18px; }

.form-section {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.form-section + .form-section { margin-top: 18px; }
.form-section h2 { color: var(--ink); font-size: 18px; }
.form-section > p { margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.55; }

.order-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.order-hero h1 { margin-top: 7px; color: var(--ink); font-size: 30px; line-height: 1.16; }
.order-hero p { margin-top: 9px; color: var(--muted); font-size: 13px; }
.order-price { text-align: right; }
.order-price span { display: block; color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.order-price strong { display: block; margin-top: 6px; color: var(--ink); font-size: 27px; }

.progress-track { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.progress-step { position: relative; min-width: 0; padding: 22px 18px 24px; border-right: 1px solid var(--line); }
.progress-step:last-child { border-right: 0; }
.progress-step::before { content: ""; display: block; width: 10px; height: 10px; margin-bottom: 11px; border: 2px solid #abb8ae; border-radius: 50%; background: #fff; }
.progress-step.done::before { border-color: var(--green); background: var(--green); }
.progress-step.current::before { border-color: var(--blue); box-shadow: 0 0 0 4px #e8f2ff; }
.progress-step strong { display: block; color: var(--ink); font-size: 12px; }
.progress-step span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.45; }

.detail-list { display: grid; }
.detail-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 20px; padding: 15px 22px; border-bottom: 1px solid #e8efe5; }
.detail-row:last-child { border-bottom: 0; }
.detail-row span { color: var(--muted); font-size: 11px; }
.detail-row strong { min-width: 0; overflow-wrap: anywhere; color: #35423b; font-size: 12px; font-weight: 700; }

.checkout-summary { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.checkout-total { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.checkout-total span { color: var(--muted); font-size: 11px; }
.checkout-total strong { display: block; margin-top: 6px; color: var(--ink); font-size: 34px; }
.checkout-total p { margin: 15px 0; padding-top: 15px; color: var(--muted); border-top: 1px solid var(--line); font-size: 11px; line-height: 1.55; }

.paypal-checkout-module {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #dfe7ef;
}

.paypal-provider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.paypal-provider-row em {
  color: #607080;
  font-size: 9px;
  font-style: normal;
  font-weight: 750;
  text-transform: uppercase;
}

.paypal-provider-name {
  display: inline-flex;
  align-items: baseline;
  width: fit-content;
  color: #003087 !important;
  font-size: 22px !important;
  font-weight: 850;
  line-height: 1;
}

.paypal-provider-name b,
.paypal-provider-name strong {
  display: inline !important;
  margin: 0 !important;
  color: inherit;
  font: inherit !important;
}

.paypal-provider-name strong {
  color: #0070e0 !important;
}

.paypal-hosted-button {
  min-height: 48px;
}

.paypal-checkout-status {
  margin: 0 !important;
  padding: 10px 12px !important;
  border: 1px solid #d7e2ee !important;
  border-radius: 6px;
  background: #f7fbff;
  color: #536879 !important;
}

.paypal-checkout-status[data-tone="ready"] {
  border-color: #bfe0c6 !important;
  background: #f2fbf2;
  color: #1f6840 !important;
}

.paypal-checkout-status[data-tone="error"] {
  border-color: #edc7c3 !important;
  background: #fff6f5;
  color: #9b342e !important;
}

.paypal-disabled-state {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 17px;
  border: 1px solid #d7e2ee;
  border-radius: 7px;
  background: #f8fbfe;
}

.paypal-disabled-state > strong {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
}

.paypal-disabled-state > p {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 10px;
}

.checkout-policy-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 13px;
  margin-top: 17px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.checkout-policy-links a {
  color: var(--green-dark);
  font-size: 9px;
  font-weight: 750;
}

.cost-boundary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 13px;
  padding: 16px;
  color: #315440;
  border: 1px solid #cbe0c7;
  border-radius: 6px;
  background: #f4faef;
}

.cost-boundary b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; background: var(--green); font-size: 11px; }
.cost-boundary strong { display: block; font-size: 12px; }
.cost-boundary p { margin-top: 4px; color: #617269; font-size: 11px; line-height: 1.5; }

.portal-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 42px;
  padding-top: 22px;
  color: #78867d;
  border-top: 1px solid var(--line);
  font-size: 10px;
}

@media (max-width: 920px) {
  .portal-header-inner { grid-template-columns: 1fr auto; }
  .portal-nav { display: none; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .portal-grid,
  .checkout-summary { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; width: min(560px, 100%); }
  .login-intro { min-height: 300px; }
  .progress-track { grid-template-columns: 1fr; }
  .progress-step { display: grid; grid-template-columns: 16px minmax(0, 1fr); column-gap: 10px; padding: 15px 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .progress-step::before { grid-row: 1 / span 2; margin: 2px 0 0; }
  .progress-step span { grid-column: 2; }
}

@media (max-width: 640px) {
  .portal-header-inner,
  .portal-shell { width: min(100% - 24px, 1180px); }
  .portal-header-inner { min-height: 60px; }
  .account-name { display: none; }
  .portal-shell { padding: 30px 0 56px; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .page-heading h1 { font-size: 32px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { padding: 18px 16px; }
  .order-row { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 16px; }
  .order-row .order-meta { display: none; }
  .product-options { grid-template-columns: 1fr; }
  .product-option label { min-height: 132px; }
  .login-page { padding: 12px; }
  .login-intro { min-height: 260px; padding: 28px; }
  .login-intro h1 { font-size: 30px; }
  .login-form-panel { padding: 30px 24px; }
  .order-hero { grid-template-columns: 1fr; padding: 22px; }
  .order-price { text-align: left; }
  .detail-row { grid-template-columns: 1fr; gap: 5px; }
  .portal-footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
