﻿:root {
  --gold: #d9a441;
  --gold-soft: #f8e5b9;
  --gold-faint: rgba(217, 164, 65, 0.14);
  --navy: #0f172a;
  --navy-2: #111827;
  --ink: #172033;
  --text: #334155;
  --muted: #64748b;
  --line: rgba(148, 163, 184, 0.2);
  --white: #ffffff;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-solid: #ffffff;
  --bg: #f6f7fb;
  --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.08);
  --shadow: 0 18px 55px rgba(15, 23, 42, 0.14);
  --shadow-strong: 0 26px 70px rgba(15, 23, 42, 0.2);
  --radius: 24px;
  --radius-sm: 16px;
  --font-sans: "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
  --font-serif: "Noto Serif TC", "Microsoft JhengHei", serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(circle at 16% 8%, rgba(217, 164, 65, 0.18), transparent 30%),
    radial-gradient(circle at 82% 0%, rgba(15, 23, 42, 0.18), transparent 26%),
    linear-gradient(180deg, #f9fafb 0%, var(--bg) 48%, #eef2f7 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 72%);
}

.page-glow {
  position: fixed;
  top: -180px;
  right: -160px;
  width: 520px;
  height: 520px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(217, 164, 65, 0.24), transparent 66%);
  filter: blur(6px);
  pointer-events: none;
}

.container {
  position: relative;
  z-index: 1;
  width: min(100% - 32px, 1380px);
  margin: 0 auto;
  padding: 34px 0 46px;
}

.header {
  position: relative;
  overflow: hidden;
  min-height: 96px;
  padding: 26px 32px;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.96)),
    radial-gradient(circle at 85% 15%, rgba(217, 164, 65, 0.36), transparent 32%);
  box-shadow: var(--shadow-strong);
  margin-bottom: 22px;
  color: var(--white);
}

.header::before {
  content: "";
  position: absolute;
  inset: -1px;
  background:
    radial-gradient(circle at 78% 18%, rgba(217, 164, 65, 0.28), transparent 26%),
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  pointer-events: none;
}

.header::after {
  content: "";
  position: absolute;
  right: 28px;
  bottom: -20px;
  width: 96px;
  height: 96px;
  border: 1px solid rgba(248, 229, 185, 0.26);
  border-radius: 28px;
  transform: rotate(12deg);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent);
}

.header-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--gold-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before,
.section-kicker::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: currentColor;
}

.header h1 {
  margin: 0;
  color: var(--white);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.header p {
  max-width: 760px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.74);
  line-height: 1.8;
  font-size: 16px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(248, 229, 185, 0.22);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  font-size: 13px;
  font-weight: 700;
}

.toolbar {
  margin: 22px 0;
}

.toolbar-card,
.result-panel {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.toolbar-card {
  padding: 22px;
}

.toolbar-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.toolbar-heading h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.toolbar-heading p {
  max-width: 390px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  text-align: right;
}


/* ESG 快速入口：尺寸比照「清除國家篩選」，但使用深色與金色提高辨識度。 */
.toolbar-heading .egs-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 7px;
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid rgba(217, 164, 65, 0.78);
  border-radius: 999px;
  background: linear-gradient(135deg, #0f172a 0%, #24324a 100%);
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1;
  white-space: nowrap;
  box-shadow:
    0 8px 18px rgba(15, 23, 42, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.13);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.toolbar-heading .egs-button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f8e5b9, #d9a441);
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.toolbar-heading .egs-button:hover {
  transform: translateY(-1px);
  border-color: #d9a441;
  background: linear-gradient(135deg, #111827 0%, #31415f 100%);
  box-shadow:
    0 11px 24px rgba(15, 23, 42, 0.24),
    0 0 0 3px rgba(217, 164, 65, 0.11);
}

.toolbar-heading .egs-button:active {
  transform: translateY(0);
  box-shadow: 0 5px 12px rgba(15, 23, 42, 0.18);
}

.toolbar-heading .egs-button:focus-visible {
  outline: 3px solid rgba(217, 164, 65, 0.42);
  outline-offset: 3px;
}

.section-kicker {
  margin-bottom: 8px;
  color: var(--gold);
}

.search-box {
  position: relative;
  display: flex;
  gap: 12px;
}

.search-box-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  flex: 1;
  padding: 17px 20px 17px 48px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 18px;
  font-size: 16px;
  outline: none;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 10px 24px rgba(15, 23, 42, 0.05);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.search-box input::placeholder {
  color: #94a3b8;
}

.search-box input:focus {
  border-color: rgba(217, 164, 65, 0.72);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(217, 164, 65, 0.15), 0 18px 34px rgba(15, 23, 42, 0.08);
}

[hidden] {
  display: none !important;
}

.filter-panel {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid rgba(217, 164, 65, 0.22);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.74), rgba(255, 255, 255, 0.86));
}

.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.filter-title {
  display: block;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.filter-subtitle {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.filter-clear {
  border: 1px solid rgba(217, 164, 65, 0.35);
  border-radius: 999px;
  padding: 9px 14px;
  background: var(--white);
  color: #9a6a10;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.filter-clear:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
  background: #fffbeb;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.checkbox-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.checkbox-option:hover {
  transform: translateY(-1px);
  border-color: rgba(217, 164, 65, 0.65);
  background: #fffbeb;
  box-shadow: 0 10px 22px rgba(217, 164, 65, 0.16);
}

.checkbox-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
}

.checkbox-option:has(input:checked) {
  border-color: var(--gold);
  background: linear-gradient(135deg, #fff7dc, #ffffff);
  color: var(--ink);
  box-shadow: 0 12px 26px rgba(217, 164, 65, 0.2);
}

.result-panel {
  padding: 14px;
  overflow: hidden;
}

.status {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 9px 13px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(248, 250, 252, 0.92);
  font-size: 14px;
  font-weight: 700;
}

.status::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 9px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(217, 164, 65, 0.14);
}

.table-wrapper {
  width: 100%;
  max-height: calc(100vh - 235px);
  overflow: auto;
  scrollbar-gutter: stable both-edges;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 22px;
  background: var(--surface-solid);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

table {
  width: 100%;
  min-width: 1120px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface-solid);
}

thead {
  background: linear-gradient(135deg, var(--navy), #1e293b);
  color: var(--white);
}

thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(248, 229, 185, 0.18);
  background: #0f172a;
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-align: left;
  white-space: nowrap;
  background-clip: padding-box;
  box-shadow: 0 1px 0 rgba(248, 229, 185, 0.18);
}

th,
td {
  text-align: left;
  vertical-align: middle;
}

td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  line-height: 1.55;
  font-size: 14px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

th,
td {
  overflow-wrap: anywhere;
}

tbody tr {
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

tbody tr:nth-child(even) {
  background: rgba(248, 250, 252, 0.72);
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fffaf0;
  box-shadow: inset 4px 0 0 var(--gold);
}

.field-countryRegion {
  width: 86px;
}

.field-productName {
  width: 170px;
}

td.field-productName {
  color: var(--ink);
  font-weight: 800;
}

.field-featureContent {
  width: 205px;
}

.field-standardGroupName {
  width: 160px;
}

.field-departureDate {
  width: 128px;
}

.field-discount,
.field-onsiteAdd {
  width: 86px;
  text-align: center;
}

.field-price {
  width: 92px;
}

.field-popCode {
  width: 86px;
}

.field-note {
  width: 160px;
}

.field-tripLink {
  width: 88px;
  white-space: nowrap;
}

.table-wrapper thead th,
.table-wrapper thead th.field-productName,
.table-wrapper thead th.field-price,
.table-wrapper thead th.field-countryRegion {
  background: #0f172a;
  color: rgba(255, 255, 255, 0.92);
}

.table-wrapper::-webkit-scrollbar {
  height: 14px;
  width: 14px;
}

.table-wrapper::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 999px;
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
  border: 3px solid #f1f5f9;
}

.country-badge,
.card-country {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid rgba(217, 164, 65, 0.26);
  border-radius: 999px;
  color: #8a5a0a;
  background: #fffbeb;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.price-value {
  color: #9a3412;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.empty,
.loading {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  color: var(--muted);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

.empty,
.card-list {
  display: none;
}

.card {
  position: relative;
  overflow: hidden;
  background: var(--surface-solid);
  border-radius: 22px;
  padding: 18px;
  margin-bottom: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(217, 164, 65, 0.45);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.12);
}

.card h3 {
  margin: 12px 0 14px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.35;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.card-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  margin: 10px 0;
  line-height: 1.65;
  color: var(--text);
}

.label {
  font-weight: 800;
  color: var(--muted);
}

.field-text:empty::after {
  content: "—";
  color: #94a3b8;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover .link-button {
  transform: translateY(-1px);
  box-shadow: 0 9px 18px rgba(217, 164, 65, 0.22);
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 7px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), #b7791f);
  color: var(--white);
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 7px 15px rgba(217, 164, 65, 0.2);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.link-button::after {
  content: "↗";
  margin-left: 6px;
  font-size: 12px;
}

.link-button:hover {
  filter: brightness(0.98);
}

.standard-group-name-content {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  max-width: 100%;
}

.standard-group-name-text {
  min-width: 0;
}

.copy-button {
  flex: 0 0 auto;
  min-height: 25px;
  padding: 3px 8px;
  border: 1px solid rgba(183, 121, 31, 0.42);
  border-radius: 999px;
  background: #fffaf0;
  color: #8a5a0a;
  font-family: inherit;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.copy-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #b7791f;
  background: #fef3c7;
}

.copy-button:focus-visible {
  outline: 3px solid rgba(217, 164, 65, 0.35);
  outline-offset: 2px;
}

.copy-button.is-copied {
  border-color: #15803d;
  background: #f0fdf4;
  color: #166534;
}

.copy-button.is-error {
  border-color: #dc2626;
  background: #fef2f2;
  color: #b91c1c;
}

.copy-button:disabled {
  cursor: default;
  opacity: 1;
}

.muted {
  color: #94a3b8;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 900px) {
  .toolbar-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-heading p {
    max-width: none;
    text-align: left;
  }


  .toolbar-heading .egs-button {
    align-self: flex-start;
  }
}

@media (max-width: 768px) {
  .container {
    width: min(100% - 20px, 1380px);
    padding: 18px 0 28px;
  }

  .header {
    min-height: auto;
    padding: 26px 22px;
    border-radius: 26px;
  }

  .header::after {
    display: none;
  }

  .header h1 {
    font-size: 32px;
  }

  .hero-meta span {
    width: 100%;
    justify-content: center;
  }

  .toolbar-card,
  .result-panel {
    border-radius: 22px;
  }

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

  .checkbox-group {
    gap: 8px;
  }

  .checkbox-option {
    width: 100%;
    justify-content: flex-start;
  }

  .table-wrapper {
    display: none;
  }

  .card-list {
    display: block;
  }

  .search-box {
    flex-direction: column;
  }

  .card-row {
    grid-template-columns: 82px 1fr;
  }
}

/* 確認查詢與操作紀錄 */

.filter-clear:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
  box-shadow: none;
}

.search-meta-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  min-height: 34px;
}

.search-hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.search-pending-notice {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(217, 164, 65, 0.35);
  border-radius: 999px;
  background: #fffbeb;
  color: #8a5a0a;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.search-validation-notice {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(185, 28, 28, 0.28);
  border-radius: 999px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}


@media (max-width: 768px) {
  .search-meta-actions {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .search-hint {
    width: 100%;
  }

}


/* 確認查詢按鈕 */
.search-confirm-panel {
  width: 100%;
  margin: 48px 0 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

.search-confirm {
  display: block;
  width: 100%;
  min-height: 64px;
  margin: 0 auto;
  padding: 18px 36px;
  border: 1px solid #111b31;
  border-radius: 999px;
  background: linear-gradient(135deg, #0d172a 0%, #22375d 100%);
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.28);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.search-confirm:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: #d39a2c;
  background: linear-gradient(135deg, #172541 0%, #304a79 100%);
  box-shadow: 0 20px 38px rgba(15, 23, 42, 0.32);
}

.search-confirm:active:not(:disabled),
.search-confirm.is-clicked:not(:disabled) {
  transform: translateY(1px) scale(0.996);
  border-color: #b7791f;
  background: linear-gradient(135deg, #e0aa3d 0%, #b7791f 100%);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(183, 121, 31, 0.36);
}

.search-confirm.is-pending:not(:disabled) {
  border-color: #c88b20;
  background: linear-gradient(135deg, #d9a441 0%, #b7791f 100%);
  box-shadow: 0 14px 30px rgba(183, 121, 31, 0.28);
}

.search-confirm:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
  box-shadow: none;
}

.search-confirm:focus-visible {
  outline: 4px solid rgba(217, 164, 65, 0.38);
  outline-offset: 4px;
}

@media (max-width: 768px) {
  .search-confirm-panel {
    margin-top: 28px;
  }

  .search-confirm {
    min-height: 56px;
    padding: 16px 22px;
    font-size: 16px;
  }
}
