:root {
  --bg: #f4efe2;
  --bg-ink: #0d1b2a;
  --card: #fefcf6;
  --line: #d8c7a1;
  --primary: #0c7c59;
  --accent: #ea7317;
  --muted: #5b6b7b;
  --danger-bg: #ffe4db;
  --danger-text: #8a1f00;
  --radius-xl: 20px;
  --radius-md: 14px;
  --shadow: 0 16px 40px rgba(19, 24, 34, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--bg-ink);
  background:
    radial-gradient(circle at 10% 10%, #f9bd4f 0%, rgba(249, 189, 79, 0) 38%),
    radial-gradient(circle at 88% 0%, #8ecae6 0%, rgba(142, 202, 230, 0) 30%),
    var(--bg);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.backdrop {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(
      -25deg,
      rgba(13, 27, 42, 0.04),
      rgba(13, 27, 42, 0.04) 1px,
      transparent 1px,
      transparent 22px
    );
  pointer-events: none;
}

.page {
  position: relative;
  width: min(1120px, 92vw);
  margin: 0 auto;
  padding: 1.2rem 0 2rem;
}

.hero {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(254, 252, 246, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(2px);
  padding: 1.2rem;
}

.tab-intro {
  margin: 1rem 0;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(254, 252, 246, 0.92);
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.tab-intro-title {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 800;
}

.tab-intro-desc {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.tab-intro-actions {
  display: flex;
}

.tab-intro-actions button {
  width: 100%;
  font-size: 0.95rem;
  border-radius: 12px;
  border: 1px solid var(--primary);
  padding: 0.58rem 0.68rem;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.tab-intro-actions button:hover {
  filter: brightness(1.06);
}

.tab-intro-actions button:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  text-transform: uppercase;
  font-weight: 700;
  font-family: "Outfit", "Noto Sans SC", sans-serif;
}

h1 {
  margin: 0.5rem 0 0.6rem;
  font-size: clamp(1.7rem, 6.5vw, 3rem);
  line-height: 1.08;
  font-family: "Outfit", "Noto Sans SC", sans-serif;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.hero-actions {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(12, 124, 89, 0.28);
  background: rgba(12, 124, 89, 0.08);
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.hero-link:hover {
  filter: brightness(1.03);
}

.stats {
  margin-top: 1rem;
  display: grid;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.stats strong {
  color: var(--primary);
}

.plugin-intro {
  margin: 1rem 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(254, 252, 246, 0.92);
  padding: 0.95rem;
}

.plugin-intro h2 {
  margin: 0;
  font-size: 1.08rem;
}

.plugin-intro p {
  margin: 0.6rem 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.92rem;
}

.recommend-list {
  margin: 0.62rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.9rem;
}

.recommend-list li + li {
  margin-top: 0.34rem;
}

.plugin-actions {
  margin-top: 0.8rem;
}

.plugin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.46rem 0.86rem;
  font-size: 0.88rem;
  font-weight: 700;
  border: 1px solid rgba(12, 124, 89, 0.3);
  color: var(--primary);
  background: rgba(12, 124, 89, 0.08);
}

.plugin-link:hover {
  filter: brightness(1.04);
}

.page-footer {
  margin: 1.2rem 0 0;
  display: flex;
  justify-content: center;
}

.page-footer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  border: 1px solid rgba(12, 124, 89, 0.3);
  background: rgba(254, 252, 246, 0.92);
  box-shadow: 0 8px 20px rgba(19, 24, 34, 0.08);
}

.page-footer-link:hover {
  filter: brightness(1.04);
}


.tabs {
  margin: 0 auto 0.9rem;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 0.35rem;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(13, 27, 42, 0.16);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.96);
  padding: 0.28rem;
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 4px);
  z-index: 40;
  box-shadow: 0 4px 12px rgba(13, 27, 42, 0.1);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab-button {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.4rem 0.86rem;
  min-height: 36px;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.tab-button:hover {
  color: var(--bg-ink);
  background: rgba(12, 124, 89, 0.1);
  border-color: rgba(12, 124, 89, 0.22);
}

.tab-button.active {
  background: var(--primary);
  color: #fff;
  border-color: rgba(12, 124, 89, 0.45);
  box-shadow: 0 2px 6px rgba(12, 124, 89, 0.25);
}

.tab-button:active {
  filter: brightness(0.98);
}

.tab-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(12, 124, 89, 0.22);
}

.tab-panel {
  min-height: 80px;
}

.error {
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid rgba(138, 31, 0, 0.2);
}

.hidden {
  display: none;
}

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

.metrics-card {
  margin-bottom: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(254, 252, 246, 0.92);
  padding: 0.8rem 0.9rem;
  display: grid;
  gap: 0.75rem;
}

.metrics-card-head {
  display: grid;
  gap: 0.6rem;
}

.metrics-card-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.metrics-card-meta strong {
  color: var(--primary);
}

.metrics-card-hint {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.metrics-card-help {
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.5;
}

.metrics-card-help-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--bg-ink);
}

.metrics-card-help p {
  margin: 0.45rem 0 0;
}

.metrics-card-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 0.58rem;
}

.metrics-meta {
  margin-bottom: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(254, 252, 246, 0.9);
  padding: 0.76rem 0.9rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
  font-size: 0.9rem;
}

.metrics-meta strong {
  color: var(--primary);
}

.metrics-help {
  margin-bottom: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(254, 252, 246, 0.9);
  padding: 0.72rem 0.9rem;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.5;
}

.metrics-help p {
  margin: 0;
}

.metrics-filters {
  margin-bottom: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(254, 252, 246, 0.9);
  padding: 0.72rem 0.9rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.58rem;
}

.metrics-filter-item {
  display: grid;
  gap: 0.28rem;
  min-width: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.metrics-filter-item select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.42rem 0.5rem;
  background: #fff;
  color: var(--bg-ink);
  font-size: 0.86rem;
}

.searchable-select {
  position: relative;
  display: grid;
  gap: 0.34rem;
}

.searchable-select-watermark {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(13, 27, 42, 0.42);
  pointer-events: none;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.searchable-select-watermark.hidden {
  display: none;
}

.searchable-select-watermark::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid rgba(13, 27, 42, 0.32);
  margin-top: 2px;
}

.searchable-select-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(13, 27, 42, 0.18);
  padding: 6px;
}

.searchable-select-dropdown-search {
  width: 100%;
  border: 1px solid rgba(216, 199, 161, 0.9);
  border-radius: 10px;
  padding: 0.46rem 0.65rem;
  font-size: 0.86rem;
  background: rgba(254, 252, 246, 0.9);
  color: var(--bg-ink);
  outline: none;
}

.searchable-select-dropdown-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(12, 124, 89, 0.14);
}

.searchable-select-dropdown-divider {
  height: 1px;
  background: rgba(13, 27, 42, 0.08);
  margin: 6px 2px;
}

.searchable-select-dropdown.hidden {
  display: none;
}

.searchable-select-option {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  font-size: 0.86rem;
  color: var(--bg-ink);
  cursor: pointer;
}

.searchable-select-option:hover,
.searchable-select-option.is-active,
.searchable-select-option[aria-selected="true"] {
  background: rgba(12, 124, 89, 0.10);
}

.searchable-select-option.is-selected {
  font-weight: 800;
  color: var(--primary);
}

.searchable-select-option.is-selected::before {
  content: "✓ ";
}

.searchable-select-empty {
  padding: 0.55rem 0.6rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.searchable-select-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.46rem 0.9rem;
  font-size: 0.86rem;
  background: #fff;
  color: var(--bg-ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.searchable-select-input::placeholder {
  color: rgba(13, 27, 42, 0.45);
}

.searchable-select-input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(12, 124, 89, 0.16);
}

.searchable-select-native {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.46rem 0.9rem;
  font-size: 0.86rem;
  background: #fff;
  color: var(--bg-ink);
  appearance: auto;
  -webkit-appearance: menulist;
}

.searchable-select-native:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(12, 124, 89, 0.16);
}

.metrics-table-container {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: 0 8px 22px rgba(13, 27, 42, 0.08);
  padding: 0.64rem;
}

.metric-table-wrap {
  overflow-x: auto;
}

.metric-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
  font-size: 0.84rem;
}

.metric-table th,
.metric-table td {
  border-bottom: 1px dashed rgba(13, 27, 42, 0.15);
  text-align: left;
  vertical-align: top;
  padding: 0.42rem 0.4rem;
}

.metric-table th {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.metric-provider {
  font-weight: 700;
}

.metric-provider-meta {
  margin-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.region-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.12rem 0.52rem;
  font-size: 0.76rem;
  font-weight: 800;
  border: 1px solid rgba(13, 27, 42, 0.14);
}

.region-badge.domestic {
  background: rgba(12, 124, 89, 0.10);
  color: var(--primary);
  border-color: rgba(12, 124, 89, 0.22);
}

.region-badge.overseas {
  background: rgba(234, 115, 23, 0.10);
  color: #a5500f;
  border-color: rgba(234, 115, 23, 0.24);
}

.metric-model-cell {
  min-width: 270px;
  max-width: 360px;
  white-space: normal;
  word-break: break-word;
}

.metric-value {
  font-variant-numeric: tabular-nums;
}

.pending-panel {
  margin-top: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(254, 252, 246, 0.9);
  padding: 0.72rem 0.86rem;
}

.pending-panel summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.pending-panel summary strong {
  margin-left: 0.4rem;
  color: var(--danger-text);
}

.pending-list {
  margin: 0.62rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.pending-list li + li {
  margin-top: 0.35rem;
}

.provider-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
  padding: 0.9rem;
  box-shadow: 0 8px 22px rgba(13, 27, 42, 0.08);
  animation: rise 300ms ease both;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.provider-card.highlight-card {
  box-shadow: 0 0 0 3px var(--primary), 0 8px 22px rgba(13, 27, 42, 0.12);
  border-color: var(--primary);
}

.provider-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.provider-title {
  margin: 0;
  font-size: 1.2rem;
}

.plan-list {
  margin: 0.9rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  list-style: none;
}

.plan-item {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 0.7rem;
  background: rgba(255, 255, 255, 0.65);
}

.plan-name {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
}

.price-row {
  margin-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.price-now {
  color: var(--primary);
  font-weight: 700;
}

.price-original {
  color: var(--bg-ink);
  font-weight: 700;
  font-size: 0.9rem;
}

.price-discount {
  color: #c73636;
  font-weight: 700;
  font-size: 0.88rem;
  background: rgba(255, 238, 238, 0.72);
  border: 1px solid rgba(228, 70, 70, 0.42);
  border-radius: 999px;
  padding: 0.08rem 0.5rem;
}

.unit-tag {
  display: inline-block;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  background: rgba(234, 115, 23, 0.1);
  color: #a5500f;
  font-size: 0.8rem;
}

.plan-notes {
  margin: 0.42rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.plan-services {
  margin-top: 0.46rem;
  border: 1px solid rgba(12, 124, 89, 0.2);
  border-radius: 10px;
  background: rgba(12, 124, 89, 0.06);
  padding: 0.42rem 0.56rem;
}

.plan-services-title {
  margin: 0;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
}

.plan-service-list {
  margin: 0.38rem 0 0;
  padding-left: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.plan-service-item + .plan-service-item {
  margin-top: 0.24rem;
}

.offer-card {
  margin-top: 0.46rem;
  border: 1px solid rgba(228, 70, 70, 0.42);
  border-radius: 10px;
  background: rgba(255, 238, 238, 0.72);
  padding: 0.42rem 0.56rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.48rem;
}

.offer-name {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(228, 70, 70, 0.5);
  background: rgba(255, 255, 255, 0.9);
  color: #c73636;
  font-size: 0.79rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
}

.offer-price {
  color: #d62222;
  font-size: 0.88rem;
  font-weight: 700;
}

.buy-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.28rem 0.72rem;
  font-size: 0.84rem;
  font-weight: 700;
  border: 1px solid rgba(12, 124, 89, 0.3);
  color: var(--primary);
  background: rgba(12, 124, 89, 0.08);
}

.buy-link:hover {
  filter: brightness(1.04);
}

.empty {
  border-radius: var(--radius-md);
  border: 1px dashed var(--line);
  padding: 1.2rem;
  background: rgba(255, 255, 255, 0.65);
  text-align: center;
  color: var(--muted);
}

/* Folded plans (currency toggle) */
.folded-plans {
  margin-top: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(254, 252, 246, 0.7);
  padding: 0.5rem 0.7rem;
}

.folded-plans summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  user-select: none;
}

.folded-plans summary:hover {
  color: var(--bg-ink);
}

.folded-plans .plan-list {
  margin-top: 0.6rem;
}

/* Metrics: plan jump button */
.plan-jump-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.62rem;
  border: 1px solid rgba(12, 124, 89, 0.55);
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.15s ease, transform 0.05s ease;
}

.plan-jump-btn:hover {
  filter: brightness(1.05);
}

.plan-jump-btn:active {
  transform: translateY(1px);
}

.plan-jump-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(12, 124, 89, 0.18), 0 0 0 4px rgba(12, 124, 89, 0.12);
}

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

@media (min-width: 700px) {
  .tab-intro {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1rem;
  }

  .tab-intro-actions button {
    width: auto;
    min-width: 140px;
  }

  .page {
    padding-top: 1.8rem;
  }

  .hero {
    padding: 1.5rem;
  }

  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metrics-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .plan-list {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    align-items: stretch;
  }
}
