/* Product */
.product-page {
  padding-top: 54px;
}

.product-grid {
  display: grid;
  grid-template-columns: minmax(0, 500px) minmax(290px, 320px);
  justify-content: space-between;
  gap: 90px;
}

.mobile-product-title {
  display: none;
}

.config-section {
  margin-top: 54px;
}

.config-section + .config-section {
  margin-top: 27px;
}

.field-label {
  display: block;
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 680;
}

.option-stack {
  display: grid;
  gap: 12px;
}

.option-card {
  position: relative;
  width: 100%;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 0 22px;
  background: rgba(255,255,255,.92);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease), transform var(--ease);
}

.option-card:hover,
.option-card:focus-visible {
  border-color: rgba(82, 114, 223, .8);
  background: #fff;
}

.option-card:active {
  transform: scale(.997);
}

.option-card.selected {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.option-main {
  font-size: 17px;
  font-weight: 680;
}

.option-price {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.price-note {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.summary-card {
  position: sticky;
  top: 126px;
  align-self: start;
}

.summary-product {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  min-height: 100px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.summary-product img {
  width: 78px;
  height: 58px;
  object-fit: contain;
}

.summary-product h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -.03em;
}

.summary-total-label {
  margin: 23px 0 4px;
  color: var(--muted);
}

.summary-total {
  margin: 0 0 24px;
  font-size: 38px;
  line-height: 1;
  letter-spacing: -.035em;
  font-weight: 770;
}

.summary-list {
  display: grid;
  gap: 12px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.summary-row dt {
  color: var(--muted);
}

.summary-row dd {
  margin: 0;
}

.summary-caption {
  margin: 23px 0 18px;
  color: var(--muted);
  font-size: 12px;
}

.availability {
  margin: 0 0 17px;
  color: var(--success);
  font-size: 12px;
}

.summary-card .primary-button {
  width: 100%;
}

.mobile-checkout-bar {
  display: none;
}

/* Cart */
.cart-page {
  padding-top: 54px;
}

.cart-grid {
  display: grid;
  grid-template-columns: minmax(0, 760px) 300px;
  justify-content: space-between;
  gap: 70px;
  margin-top: 33px;
}

.cart-product {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.cart-product img {
  width: 84px;
  height: 66px;
  object-fit: contain;
}

.cart-product h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -.025em;
}

.cart-product p {
  margin: 5px 0 0;
  color: var(--muted);
}

.detail-table-title {
  margin: 26px 0 14px;
  font-size: 18px;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
}

.detail-table th,
.detail-table td {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-weight: 430;
}

.detail-table th {
  color: var(--muted);
  font-size: 12px;
}

.detail-table th:last-child,
.detail-table td:last-child {
  text-align: right;
}

.detail-table td:nth-child(2) {
  text-align: center;
}

.setup-form {
  display: grid;
  gap: 40px;
  margin-top: 45px;
}

.form-group {
  padding: 0 0 40px;
  border-bottom: 1px solid var(--line);
}

.form-group label {
  display: block;
  margin: 0 0 10px;
  font-weight: 620;
}

.text-input,
.select-input,
.textarea-input {
  width: min(100%, 260px);
  height: 38px;
  border: 1px solid rgba(32,35,43,.24);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.textarea-input {
  width: 100%;
  min-height: 140px;
  padding-top: 11px;
  resize: vertical;
}

.text-input:focus,
.select-input:focus,
.textarea-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(82,114,223,.13);
}

.form-help {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.payment-summary {
  position: sticky;
  top: 126px;
  align-self: start;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.modify-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--link);
  cursor: pointer;
}

.payment-label {
  margin: 12px 0 8px;
  color: var(--muted);
}

.payment-total {
  margin: 0 0 25px;
  font-size: 38px;
  line-height: 1;
  letter-spacing: -.035em;
  font-weight: 770;
}

.terms-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 22px 0;
  font-size: 13px;
}

.terms-check input {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--brand);
}

.payment-summary .primary-button {
  width: 100%;
}

/* Empty-state app pages */
.simple-page {
  padding-top: 54px;
}

.simple-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.simple-page-header .primary-button {
  min-height: 44px;
}

.empty-state {
  min-height: 390px;
  display: grid;
  place-items: center;
  margin-top: 36px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,.48);
  text-align: center;
}

.empty-state-inner {
  max-width: 360px;
  padding: 40px 24px;
}

.empty-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
  border-radius: 17px;
  background: #e9edf8;
  color: var(--brand);
  font-size: 25px;
  font-weight: 650;
}

.empty-state h2 {
  margin: 0;
  font-size: 23px;
}

.empty-state p {
  margin: 10px 0 24px;
  color: var(--muted);
}

/* Affiliates */
.affiliate-hero {
  margin: 36px 0 25px;
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.64);
}

.affiliate-hero h2 {
  margin: 0 0 9px;
  font-size: 28px;
}

.affiliate-hero p {
  max-width: 670px;
  margin: 0;
  color: var(--muted);
}

.affiliate-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 24px 0;
}

.stat-card {
  min-height: 158px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.stat-card strong {
  display: block;
  margin: 8px 0;
  font-size: 24px;
}

.stat-card span,
.stat-card p {
  color: var(--muted);
  font-size: 12px;
}

.stat-card p {
  margin: 8px 0 0;
}

.affiliate-join {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 34px;
  margin-top: 25px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.55);
}

.affiliate-join h3 {
  margin: 0 0 6px;
}

.affiliate-join p {
  margin: 0;
  color: var(--muted);
}

/* Legal */
.legal-page {
  max-width: 860px;
  padding-top: 58px;
}

.legal-intro {
  margin: 18px 0 45px;
  color: var(--muted);
}

.legal-section {
  margin: 0 0 40px;
}

.legal-section h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.legal-section p,
.legal-section li {
  color: #454c58;
  line-height: 1.8;
}

.legal-section ul {
  padding-left: 22px;
}

/* Toast */
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  max-width: 360px;
  padding: 14px 18px;
  border: 1px solid rgba(32,35,43,.09);
  border-radius: 12px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow-soft);
  color: var(--text);
  animation: toast-in 220ms var(--ease);
}

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

@media (max-width: 900px) {
  :root {
    --header-height: 68px;
  }

  .header-inner {
    width: calc(100% - 32px);
    grid-template-columns: 1fr auto;
  }

  .desktop-nav {
    display: none;
  }

  .language-button {
    display: inline-flex;
    padding: 8px;
  }

  .language-button span {
    display: none;
  }

  .header-tools {
    gap: 8px;
  }

  .menu-button {
    display: inline-flex;
  }

  .mobile-nav {
    position: fixed;
    z-index: 49;
    inset: var(--header-height) 0 auto;
    display: grid;
    gap: 2px;
    padding: 12px 18px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(249,250,253,.98);
    box-shadow: 0 16px 30px rgba(32,35,43,.09);
  }

  .mobile-nav .nav-button {
    min-height: 46px;
    justify-content: flex-start;
    padding: 0 12px;
    border-radius: 9px;
  }

  .mobile-nav .nav-button.active {
    background: rgba(82,114,223,.07);
  }

  .mobile-nav .nav-button.active::after {
    display: none;
  }

  .page-main,
  .home-content,
  .site-footer {
    width: calc(100% - 32px);
  }

  .hero {
    width: 100%;
    min-height: 550px;
    border-radius: 0;
  }

  .hero-image {
    object-position: 66% center;
  }

  .hero-overlay {
    background: linear-gradient(90deg, rgba(249,250,252,.98) 0%, rgba(249,250,252,.84) 52%, rgba(249,250,252,.16) 100%);
  }

  .hero-content {
    width: calc(100% - 44px);
    padding-top: 70px;
  }

  .use-grid,
  .affiliate-grid {
    grid-template-columns: 1fr 1fr;
  }

  .connection-panel {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .faq-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .product-grid,
  .cart-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-grid {
    max-width: 650px;
  }

  .summary-card,
  .payment-summary {
    position: static;
  }

  .product-page .summary-card {
    display: none;
  }

  .cart-grid {
    max-width: 760px;
  }

  .payment-summary {
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255,255,255,.64);
  }
}

@media (max-width: 760px) {
  body {
    font-size: 14px;
  }

  .brand {
    gap: 10px;
  }

  .brand img {
    width: 27px;
    height: 27px;
  }

  .brand span {
    font-size: 15px;
  }

  .account-button .chevron {
    display: none;
  }

  .page-title {
    font-size: 31px;
  }

  .site-footer {
    min-height: 118px;
    grid-template-columns: 1fr auto;
    padding: 23px 0;
  }

  .site-footer .tagline {
    display: none;
  }

  .footer-links {
    gap: 12px;
  }

  .hero {
    min-height: 620px;
  }

  .hero-image {
    height: 58%;
    top: auto;
    object-position: center bottom;
  }

  .hero-overlay {
    background: linear-gradient(180deg, rgba(249,250,252,.99) 0%, rgba(249,250,252,.91) 51%, rgba(249,250,252,.04) 86%);
  }

  .hero-content {
    padding-top: 49px;
  }

  .hero h1 {
    max-width: 360px;
    font-size: 44px;
  }

  .hero-copy {
    max-width: 355px;
    margin-top: 24px;
    font-size: 16px;
  }

  .hero-actions {
    gap: 18px;
  }

  .hero-actions .primary-button {
    min-height: 45px;
    padding: 0 22px;
  }

  .home-section {
    padding: 46px 0;
  }

  .use-grid,
  .affiliate-grid {
    grid-template-columns: 1fr;
  }

  .use-card {
    min-height: 190px;
  }

  .connection-panel {
    padding: 28px 22px;
  }

  .faq-layout {
    gap: 20px;
  }

  .home-cta {
    align-items: flex-start;
    flex-direction: column;
  }

  .product-page,
  .cart-page,
  .simple-page {
    padding-top: 34px;
  }

  .product-page {
    padding-bottom: 115px;
  }

  .product-grid {
    display: block;
  }

  .product-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
  }

  .mobile-product-title {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .mobile-product-title img {
    width: 76px;
    height: 54px;
    object-fit: contain;
  }

  .mobile-product-title strong {
    white-space: nowrap;
    font-size: 19px;
  }

  .config-section {
    margin-top: 44px;
  }

  .option-card {
    min-height: 75px;
    padding: 0 20px;
  }

  .mobile-checkout-bar {
    position: fixed;
    z-index: 45;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 106px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 34px max(15px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255,255,255,.93);
    backdrop-filter: blur(18px) saturate(150%);
    box-shadow: 0 -10px 34px rgba(32,35,43,.08);
  }

  .mobile-total-label {
    color: var(--muted);
    font-size: 12px;
  }

  .mobile-total {
    display: block;
    margin-top: 1px;
    font-size: 22px;
    font-weight: 750;
  }

  .mobile-availability {
    color: var(--success);
    font-size: 11px;
  }

  .mobile-checkout-bar .primary-button {
    min-height: 45px;
    padding: 0 23px;
  }

  .cart-grid {
    margin-top: 25px;
  }

  .cart-product img {
    width: 70px;
  }

  .detail-table td:nth-child(2),
  .detail-table th:nth-child(2) {
    text-align: left;
  }

  .detail-table {
    font-size: 12px;
  }

  .simple-page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .empty-state {
    min-height: 330px;
  }

  .affiliate-hero {
    padding: 28px 22px;
  }

  .affiliate-join {
    align-items: flex-start;
    flex-direction: column;
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* =========================================
   MySQL 数据驱动扩展样式: 账单、服务与支付模态框
   ========================================= */
.data-table-wrap {
  width: 100%;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  margin-top: 1.5rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.data-table th {
  background: rgba(0, 0, 0, 0.02);
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.badge-success {
  background: rgba(40, 167, 69, 0.12);
  color: #1e7e34;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
  margin-top: 1.5rem;
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.service-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.service-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.service-specs {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.service-meta-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px dashed rgba(0,0,0,0.06);
}

.service-meta-row:last-child {
  border-bottom: none;
}

.service-meta-label {
  color: var(--muted);
}

.service-meta-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 500;
  color: var(--text);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.payment-modal {
  background: var(--surface);
  border-radius: 18px;
  max-width: 480px;
  width: 100%;
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: modalPop 0.22s ease-out;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.payment-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.payment-option-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color var(--ease), background var(--ease);
}

.payment-option-label:hover {
  border-color: var(--brand);
  background: rgba(82, 114, 223, 0.04);
}

.payment-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
