:root {
  color-scheme: light dark;
  --color-bg: #0f172a;
  --color-bg-alt: #16213f;
  --color-surface: #ffffff;
  --color-surface-alt: #f3f4f6;
  --color-accent: #3b82f6;
  --color-accent-strong: #2563eb;
  --color-text: #1f2937;
  --color-text-inverse: #ffffff;
  --color-error: #dc2626;
  --shadow-soft: 0 20px 35px -15px rgba(15, 23, 42, 0.55);
  --radius-lg: 18px;
  --radius-sm: 8px;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, var(--color-bg) 0%, #020617 100%);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.hero {
  position: relative;
  padding: 5rem 1.5rem 4rem;
  text-align: center;
  color: var(--color-text-inverse);
  overflow: hidden;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(59, 130, 246, 0.6), transparent 60%);
  mix-blend-mode: screen;
}

.hero__content {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.9;
  margin-bottom: 2.5rem;
}

.hero__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.hero__cta {
  padding-inline: 2.4rem;
  font-size: 1.05rem;
}

.hero__note {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.85;
}

.hero__stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 1.25rem;
  padding: 0;
  margin: 0 0 3rem;
}

.hero__stats li {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 1rem;
  backdrop-filter: blur(12px);
}

.hero__stats-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text-inverse);
}

.hero__stats-label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  opacity: 0.7;
}

.tab-nav {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.3rem;
  gap: 0.3rem;
}

.tab-nav__item {
  background: transparent;
  border: none;
  appearance: none;
  color: var(--color-text-inverse);
  padding: 0.75rem 1.75rem;
  font-size: 0.95rem;
  font-family: inherit;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  position: relative;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.3s ease, transform 0.2s ease;
}

.tab-nav__item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 60%;
  background: rgba(255, 255, 255, 0.25);
}

.tab-nav__item:hover,
.tab-nav__item:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.tab-nav__item.is-active {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 10px 25px -12px rgba(59, 130, 246, 0.5);
}

.panel {
  position: relative;
  max-width: 960px;
  margin: -3rem auto 0;
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  z-index: 1;
}

body.modal-open {
  overflow: hidden;
}

.auth-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 1100;
}

.auth-modal.is-open {
  display: flex;
}

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
}

.auth-modal__dialog {
  position: relative;
  width: min(100%, 540px);
  max-height: 85vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.auth-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: none;
  background: rgba(15, 23, 42, 0.08);
  color: #334155;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.auth-modal__close:hover,
.auth-modal__close:focus-visible {
  outline: none;
  background: rgba(15, 23, 42, 0.15);
  transform: scale(1.05);
}

.auth-modal .panel {
  margin: 0;
  width: min(100%, 540px);
  max-width: none;
  max-height: inherit;
  padding: 2.25rem 2rem 2rem;
  overflow-y: auto;
}

.tab-nav--modal {
  display: flex;
  margin-bottom: 1.5rem;
  background: rgba(15, 23, 42, 0.05);
  justify-content: center;
  width: 100%;
  gap: 0.3rem;
}

.tab-nav--modal .tab-nav__item {
  color: #0f172a;
  min-width: 112px;
}

.tab-nav--modal .tab-nav__item:not(:last-child)::after {
  background: rgba(15, 23, 42, 0.15);
}

.tab-nav--modal .tab-nav__item.is-active {
  background: var(--color-accent);
  color: var(--color-text-inverse);
}

.tab-nav--hero {
  justify-content: center;
  margin-inline: auto;
}

.notice {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--color-surface-alt);
  border-left: 4px solid var(--color-accent);
  color: #0f172a;
}

.notice__message {
  margin: 0;
  font-weight: 500;
}

.notice__message + .notice__message {
  margin-top: 0.5rem;
}

.notice__message--success {
  color: #047857;
}

.notice__message--error {
  color: var(--color-error);
}

.flash-notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  max-width: 600px;
  width: 90%;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  animation: slideDown 0.3s ease-out;
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.flash-notification--success {
  border-left: 4px solid #10b981;
  color: #047857;
}

.flash-notification--error {
  border-left: 4px solid var(--color-error);
  color: var(--color-error);
}

.flash-notification p {
  margin: 0;
  font-weight: 500;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.welcome {
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(59, 130, 246, 0.08);
  color: #1f2937;
}

.tab {
  display: none;
  animation: fadeIn 0.35s ease;
}

.tab.is-active {
  display: block;
}

.tab h2 {
  margin-top: 0;
  color: #0f172a;
  font-size: 1.75rem;
}

.form {
  display: grid;
  gap: 1.1rem;
}

.form__group {
  display: grid;
  gap: 0.25rem;
}

.form label {
  font-weight: 600;
  color: #0f172a;
}

.form input {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid #cbd5f5;
  font-size: 1rem;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.form input:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.input-affix {
  display: flex;
  align-items: center;
  border: 1px solid #cbd5f5;
  border-radius: var(--radius-sm);
  background: #ffffff;
  overflow: hidden;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.input-affix input {
  flex: 1 1 0;
  min-width: 0;
  border: none;
  padding: 0.85rem 0.75rem 0.85rem 1rem;
  font-size: 1rem;
  box-shadow: none;
}

.input-affix input:focus-visible {
  box-shadow: none;
}

.input-affix__suffix {
  padding: 0.85rem 1rem;
  background: var(--color-surface-alt);
  border-left: 1px solid #e2e8f0;
  font-size: 0.95rem;
  color: #475569;
}

.input-affix:focus-within {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.input-affix--error {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
}

.input-affix--error:focus-within {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.25);
}

.input-affix input.input--error {
  box-shadow: none;
}

.input--error {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.input--error:focus-visible {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.25);
}

.form__error {
  min-height: 1.1rem;
  font-size: 0.85rem;
  color: var(--color-error);
  margin: 0;
}

.form__footnote {
  margin: 0;
  font-size: 0.9rem;
  color: #64748b;
  text-align: center;
}

.form__footnote a {
  color: var(--color-accent);
  text-decoration: none;
}

.form__hint {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: #6b7280;
}

.form__note {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: #6b7280;
  font-style: italic;
}

.form__divider {
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid #e5e7eb;
}

.form--register {
  gap: 1rem;
}

.form--register button,
.form--register .form__footnote {
  margin-top: 0.25rem;
}

@media (min-width: 768px) {
  .form--register {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1.25rem;
  }

  .form--register .form__group:nth-of-type(3) {
    grid-column: 1 / -1;
  }

  .form--register button,
  .form--register .form__footnote {
    grid-column: 1 / -1;
  }
}

.button {
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.25s ease;
  text-decoration: none;
}

.button--primary {
  background: var(--color-accent);
  color: var(--color-text-inverse);
  box-shadow: 0 15px 35px -18px rgba(59, 130, 246, 0.9);
}

.button--primary:hover,
.button--primary:focus-visible {
  outline: none;
  background: var(--color-accent-strong);
  transform: translateY(-1px);
}

.button--light {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 18px 30px -18px rgba(255, 255, 255, 0.8);
}

.button--light:hover,
.button--light:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.link {
  color: var(--color-accent);
  cursor: pointer;
  text-decoration: none;
}

.features,
.workflow,
.pricing,
.social-proof,
.faq,
.cta {
  padding: 5rem 1.5rem;
}

.features,
.workflow,
.social-proof,
.faq {
  background: #f8fafc;
}

.workflow {
  background: #ffffff;
}

.features__intro,
.workflow__intro,
.faq__intro {
  max-width: 720px;
  margin: 0 auto 2.5rem;
  text-align: center;
  color: #0f172a;
}

.features__intro h2,
.workflow__intro h2,
.faq__intro h2,
.pricing__head h2,
.social-proof h2 {
  margin: 0 0 0.75rem;
  font-size: 2rem;
  text-align: center;
}

.features__intro p,
.workflow__intro p,
.faq__intro p,
.pricing__head p {
  margin: 0;
  color: #64748b;
  font-size: 1rem;
}

.features__grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.feature-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 45px -25px rgba(15, 23, 42, 0.2);
}

.feature-card h3 {
  margin: 0 0 0.75rem;
  color: #0f172a;
  font-size: 1.25rem;
}

.feature-card p {
  margin: 0;
  color: #475569;
  line-height: 1.6;
}

.workflow__steps {
  list-style: none;
  max-width: 960px;
  margin: 0 auto;
  padding: 0;
  display: grid;
  gap: 1.5rem;
}

.workflow__steps li {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 1.5rem;
  align-items: start;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: 0 18px 40px -30px rgba(15, 23, 42, 0.35);
}

.workflow__index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-accent-strong);
  font-weight: 700;
  font-size: 1.1rem;
}

.workflow__steps h3 {
  margin: 0 0 0.4rem;
  color: #0f172a;
  font-size: 1.2rem;
}

.workflow__steps p {
  margin: 0;
  color: #475569;
  line-height: 1.6;
}

.pricing {
  background: radial-gradient(circle at top, rgba(59, 130, 246, 0.12), rgba(15, 23, 42, 0.9));
  color: var(--color-text-inverse);
}

.pricing__content {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  gap: 2.5rem;
}

.pricing__head {
  text-align: center;
}

.pricing__head p {
  color: rgba(255, 255, 255, 0.75);
}

.pricing-calculator {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 60px -35px rgba(15, 23, 42, 0.9);
  padding: 2.5rem;
  display: grid;
  gap: 2rem;
}

.pricing-calculator__controls {
  display: grid;
  gap: 1.75rem;
}

.control {
  display: grid;
  gap: 0.75rem;
}

.control__label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

.control__value {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
}

.slider {
  width: 100%;
  accent-color: var(--color-accent);
}

.control__ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

.control__ticks--labels {
  gap: 0.5rem;
}

.control__ticks--labels span {
  flex: 1;
  text-align: center;
  padding: 0.25rem 0.35rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: border 0.2s ease, background 0.2s ease;
}

.control__ticks--labels span.is-active {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.12);
  color: #ffffff;
  font-weight: 600;
}

.pricing-calculator__summary {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.summary-card {
  background: rgba(14, 19, 41, 0.8);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: grid;
  gap: 0.5rem;
}

.summary-card__label {
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.summary-card__value {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  color: #ffffff;
}

.summary-card__hint {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.pricing-calculator__actions {
  display: grid;
  gap: 1rem;
}

.purchase-form {
  display: grid;
}

.reseller-form {
  display: grid;
  gap: 0.75rem;
}

.reseller-form__label {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
}

.reseller-form input[type="text"] {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.6);
  color: #ffffff;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.reseller-form input[type="text"]:focus-visible {
  outline: none;
  border-color: rgba(59, 130, 246, 0.65);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.reseller-form__hint {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.62);
}

.reseller-form__note {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.8);
}

.pricing-calculator__reseller {
  display: grid;
  gap: 1rem;
}

.reseller-card {
  background: rgba(12, 18, 38, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  display: grid;
  gap: 0.75rem;
}

.reseller-card h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #ffffff;
}

.reseller-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.6;
}

.reseller-card__status {
  font-size: 0.9rem;
}

.reseller-card__status a {
  color: var(--color-accent);
  text-decoration: none;
}

.button--wide {
  width: 100%;
  justify-content: center;
}

.pricing-calculator__note {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
}
}

.social-proof {
  text-align: center;
}

.social-proof__grid {
  max-width: 1100px;
  margin: 3rem auto 0;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.testimonial {
  margin: 0;
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 45px -28px rgba(15, 23, 42, 0.35);
  text-align: left;
  color: #0f172a;
}

.testimonial blockquote {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #334155;
}

.testimonial figcaption {
  margin: 0;
  font-weight: 600;
  color: #0f172a;
}

.faq__items {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}

.faq__item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.4rem;
  box-shadow: 0 15px 30px -24px rgba(15, 23, 42, 0.25);
  transition: border 0.2s ease;
}

.faq__item[open] {
  border-color: var(--color-accent);
}

.faq__item summary {
  list-style: none;
  font-weight: 600;
  cursor: pointer;
  color: #0f172a;
}

.faq__item summary::marker,
.faq__item summary::-webkit-details-marker {
  display: none;
}

.faq__item p {
  margin: 0.75rem 0 0;
  color: #475569;
  line-height: 1.6;
}

.cta {
  background: radial-gradient(circle at center, rgba(59, 130, 246, 0.22), rgba(15, 23, 42, 0.95));
  color: var(--color-text-inverse);
  text-align: center;
  padding-block: 4.5rem;
}

.cta__inner {
  max-width: 720px;
  margin: 0 auto;
  display: grid;
  gap: 1.25rem;
}

.cta__inner h2 {
  margin: 0;
  font-size: 2rem;
}

.cta__inner p {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
}

.footer {
  margin-top: auto;
  padding: 3.5rem 1.5rem 2rem;
  color: rgba(255, 255, 255, 0.85);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.85) 0%, rgba(2, 6, 23, 0.95) 100%);
}

.footer__columns {
  display: grid;
  gap: 1.5rem;
  max-width: 960px;
  margin: 0 auto 2rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.footer h3,
.footer h4 {
  margin: 0 0 0.75rem;
}

.footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.35rem;
  font-size: 0.95rem;
}

.footer__legal {
  text-align: center;
  margin: 0;
  font-size: 0.85rem;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .panel {
    margin: -2rem 1rem 0;
    padding: 1.5rem;
  }

  .hero__stats {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .workflow__steps li {
    grid-template-columns: 40px 1fr;
    padding: 1.25rem;
  }

  .workflow__index {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .pricing__card {
    padding-inline: 1.5rem;
  }

  .social-proof__grid {
    margin-top: 2rem;
  }

  .tab-nav--hero,
  .tab-nav--modal {
    flex-wrap: nowrap;
    gap: 0.2rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-nav--hero .tab-nav__item,
  .tab-nav--modal .tab-nav__item {
    flex: 0 0 auto;
    min-width: max-content;
    padding: 0.75rem 1.2rem;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .auth-modal .panel {
    padding: 2rem 1.5rem 1.75rem;
  }

  .form--register {
    grid-template-columns: 1fr;
  }

  .pricing-calculator {
    padding: 2rem 1.5rem;
  }

  .summary-card {
    padding: 1.25rem 1rem;
  }

  .input-affix input {
    padding: 0.85rem 0.5rem 0.85rem 0.75rem;
    font-size: 0.95rem;
  }

  .input-affix__suffix {
    padding: 0.85rem 0.75rem;
    font-size: 0.85rem;
    flex-shrink: 0;
  }
}

/* Orders List */
.orders-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.order-card {
  background: var(--color-surface-alt);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  border-left: 4px solid var(--color-accent);
}

.order-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.order-card__header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--color-text);
}

.order-card__badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: #10b981;
  color: white;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.order-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.order-card__body p {
  margin: 0;
  font-size: 0.9rem;
  color: #374151;
}

.order-card__date {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e5e7eb;
  font-size: 0.85rem;
  color: #6b7280;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.empty-state p {
  margin: 0 0 1.5rem;
  color: #6b7280;
}

/* Reseller Info */
.reseller-info {
  padding: 1rem 0;
}

.reseller-info p {
  margin: 0 0 1.5rem;
  color: #374151;
  line-height: 1.6;
}

/* ===================================
   信用卡綁定樣式
   =================================== */

/* 信用卡區域 */
.credit-card-section {
    margin-bottom: 1.5rem;
}

/* 已綁定信用卡 */
.credit-card-bound {
    background: var(--surface-color, #ffffff);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
}

.card-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.card-icon {
    flex-shrink: 0;
    color: #666;
}

.card-details {
    flex: 1;
}

.card-brand {
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0 0 0.25rem 0;
    color: #333;
}

.card-number {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
    font-family: 'Courier New', monospace;
}

/* 未綁定信用卡提示 */
.credit-card-prompt {
    background: #fff9e6;
    border: 1px solid #ffd966;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.prompt-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    color: #996600;
}

.prompt-message svg {
    flex-shrink: 0;
    color: #ffa500;
}

/* Inline 綁卡表單 */
.credit-card-form-inline {
    background: var(--surface-color, #ffffff);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
}

.credit-card-form-inline .loading-state {
    text-align: center;
    padding: 2rem;
}

.credit-card-form-inline .error-message {
    display: none;
    margin-bottom: 1rem;
    padding: 12px;
    background: #ffebee;
    border-left: 4px solid #f44336;
    border-radius: 5px;
    color: #c62828;
    font-size: 0.9rem;
}

/* 綁卡 Modal */
.modal__content--medium {
    max-width: 500px;
}

.modal__description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* 信用卡表單 */
.card-form {
    margin: 1.5rem 0;
}

.form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.card-input {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.75rem;
    min-height: 44px;
    background: white;
    transition: border-color 0.2s;
}

.card-input:focus-within {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* 載入狀態 */
.loading-state {
    text-align: center;
    padding: 2rem;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Button 內的 spinner (小型) */
.button .spinner {
    width: 16px;
    height: 16px;
    margin: 0 0.5rem 0 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-state p {
    color: #666;
    font-size: 0.9rem;
}

/* 錯誤訊息 */
.error-message {
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    color: #c33;
    font-size: 0.9rem;
    margin: 1rem 0;
}

/* Modal 操作按鈕 */
.modal__actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal__actions .button {
    flex: 1;
}

/* 按鈕樣式補充 */
.button--text {
    background: none;
    border: none;
    color: #007bff;
    padding: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
}

.button--text:hover {
    color: #0056b3;
}

.button--small {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

/* 購買按鈕禁用狀態 */
.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #ccc;
}

/* 響應式調整 */
@media (max-width: 640px) {
    .card-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .form__row {
        grid-template-columns: 1fr;
    }

    .modal__actions {
        flex-direction: column;
    }

    .modal__actions .button {
        width: 100%;
    }
}

/* ========================================
   綁卡 Modal 樣式
   ======================================== */

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 1200;
}

.modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
}

.modal__content {
    position: relative;
    width: min(100%, 540px);
    max-height: 85vh;
    overflow-y: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    background: white;
}

.modal__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    border: none;
    background: rgba(15, 23, 42, 0.08);
    color: #334155;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.modal__close:hover,
.modal__close:focus-visible {
    outline: none;
    background: rgba(15, 23, 42, 0.15);
    transform: scale(1.05);
}

.modal__body {
    padding: 2rem;
}

.modal__title {
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
}

/* 載入動畫已在上方定義，此處已移除重複 */

/* 錯誤訊息 */
.error-message {
    padding: 1rem;
    background: #fee;
    border-left: 4px solid #f44;
    border-radius: 4px;
    color: #c62828;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* 付款方式選項樣式 */
.payment-option {
    transition: border-color 0.2s ease, background 0.2s ease;
}

.payment-option:has(input:checked) {
    border-color: #3b82f6 !important;
    background: rgba(59, 130, 246, 0.05);
}

.payment-option:hover {
    border-color: #94a3b8;
}

/* ==================== 經銷商後台樣式 ==================== */

/* 統計卡片 */
.reseller-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: box-shadow 0.2s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

.stat-value.text-success {
    color: #10b981;
}

/* 子導航 */
.reseller-sub-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e5e7eb;
    flex-wrap: wrap;
}

.reseller-sub-tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    color: #64748b;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.reseller-sub-tab:hover {
    color: #1e293b;
}

.reseller-sub-tab.is-active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

/* 連結卡片 */
.reseller-link-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* 訂單表格 */
.orders-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.orders-table thead {
    background: #f8fafc;
}

.orders-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    color: #475569;
    border-bottom: 2px solid #e5e7eb;
}

.orders-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.9rem;
}

.orders-table tbody tr:hover {
    background: #f8fafc;
}

.orders-table code {
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: monospace;
}

/* 訂單卡片（可摺疊） */
.order-cards, .settlement-cards, .withdrawal-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-card, .settlement-card, .withdrawal-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.order-card:hover, .settlement-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.order-card-header, .settlement-card-header {
    padding: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: background 0.2s ease;
}

.order-card-header:hover, .settlement-card-header:hover {
    background: #f8fafc;
}

.order-card.expanded .order-card-header,
.settlement-card.expanded .settlement-card-header {
    border-bottom: 1px solid #e5e7eb;
}

.order-card-main {
    flex: 1;
    min-width: 0;
}

.order-number {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.order-number strong {
    font-size: 0.95rem;
    color: #1e293b;
}

.order-amount {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.amount-label {
    font-size: 0.8rem;
    color: #64748b;
}

.amount-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.order-card-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.order-date {
    font-size: 0.85rem;
    color: #64748b;
}

.expand-icon {
    font-size: 0.8rem;
    color: #64748b;
    transition: transform 0.2s ease;
    user-select: none;
}

.order-card.expanded .expand-icon,
.settlement-card.expanded .expand-icon {
    transform: rotate(180deg);
}

.order-card-details, .settlement-card-details {
    padding: 1rem;
    display: none;
}

.order-card-details[style*="display: block"],
.settlement-card-details[style*="display: block"] {
    display: block;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
}

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

.detail-label {
    color: #64748b;
    font-weight: 500;
}

.detail-value {
    color: #1e293b;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

.detail-value code {
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: monospace;
}

/* 結算卡片特定樣式 */
.settlement-period {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.settlement-period strong {
    font-size: 0.95rem;
    color: #1e293b;
}

.settlement-summary-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.settlement-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.settlement-stat .stat-label {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0;
}

.settlement-stat .stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.settlement-orders-list {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.settlement-orders-list h5 {
    font-size: 0.9rem;
    color: #475569;
    margin: 0 0 0.75rem 0;
}

.settlement-order-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.85rem;
    border-bottom: 1px solid #f8fafc;
}

.settlement-order-item:last-child {
    border-bottom: none;
}

/* 提領卡片 */
.withdrawal-card {
    padding: 1rem;
}

.withdrawal-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.withdrawal-amount-display {
    flex: 1;
}

.withdrawal-amount-display strong {
    font-size: 1.25rem;
    color: #1e293b;
}

.withdrawal-date {
    font-size: 0.85rem;
    color: #64748b;
}

.withdrawal-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.withdrawal-detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    padding: 0.25rem 0;
}

.withdrawal-detail-label {
    color: #64748b;
    font-weight: 500;
}

.withdrawal-detail-value {
    color: #1e293b;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
    font-family: monospace;
    font-size: 0.85rem;
}

/* Badge */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-paid {
    background: #d1fae5;
    color: #065f46;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.badge-failed {
    background: #fee2e2;
    color: #991b1b;
}

.badge-available {
    background: #d1fae5;
    color: #065f46;
}

.badge-partial_withdrawn {
    background: #fef3c7;
    color: #92400e;
}

.badge-fully_withdrawn {
    background: #e5e7eb;
    color: #475569;
}

.badge-processing {
    background: #dbeafe;
    color: #1e40af;
}

.badge-completed {
    background: #d1fae5;
    color: #065f46;
}

.badge-rejected {
    background: #fee2e2;
    color: #991b1b;
}

/* 分頁 */
.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.page-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #cbd5e1;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    color: #374151;
}

.page-btn:hover:not(:disabled) {
    border-color: #3b82f6;
    background: #eff6ff;
}

.page-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 結算摘要 */
.settlements-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
}

.summary-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.summary-card .amount {
    font-size: 1.75rem;
    font-weight: 700;
}

/* 載入狀態 */
/* 重複的 .loading-state 和 ::before 偽元素已移除 - 避免產生雙重轉圈圈 */

/* 響應式 */
@media (max-width: 768px) {
    .reseller-stats {
        grid-template-columns: 1fr;
    }

    .reseller-sub-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .orders-table {
        font-size: 0.85rem;
    }

    .orders-table th,
    .orders-table td {
        padding: 0.5rem;
    }

    /* 手機版卡片樣式 */
    .order-card-header, .settlement-card-header {
        flex-direction: column;
        align-items: stretch;
    }

    .order-card-meta {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid #f1f5f9;
    }

    .settlement-summary-info {
        width: 100%;
    }

    .settlement-stat {
        flex: 1;
        min-width: 80px;
    }

    .detail-row {
        flex-direction: column;
        gap: 0.25rem;
    }

    .detail-value {
        max-width: 100%;
        text-align: left;
    }

    .withdrawal-header {
        flex-direction: column;
        align-items: stretch;
    }

    .withdrawal-detail-row {
        flex-direction: column;
        gap: 0.25rem;
    }

    .withdrawal-detail-value {
        max-width: 100%;
        text-align: left;
    }
}

/* 經銷商訂單操作按鈕 */
.order-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8125rem;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background-color: #64748b;
    color: white;
}

.btn-secondary:hover {
    background-color: #475569;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(100, 116, 139, 0.3);
}

.btn:active {
    transform: translateY(0);
}
