/* === THSR 共用設計權杖 === */
:root {
  --primary-color: #8b5cf6;
  --secondary-color: #6366f1;
  --accent-color: #06b6d4;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --info-color: #3b82f6;
  --bg-primary: #0f0f1e;
  --bg-secondary: #1a1a2e;
  --bg-tertiary: #16213e;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
  --glow: 0 0 20px rgba(139, 92, 246, 0.3);
  --search-bg: rgba(15, 15, 30, 0.88);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body.thsr-app {
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 50%, #16213e 100%);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text-primary);
}

body.thsr-app--login {
  line-height: 1.6;
}

body.thsr-app--query {
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 100% 70% at 50% -15%, rgba(139, 92, 246, 0.22), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 30%, rgba(6, 182, 212, 0.08), transparent),
    radial-gradient(ellipse 50% 35% at 0% 80%, rgba(99, 102, 241, 0.06), transparent),
    linear-gradient(168deg, #0a0a14 0%, #121026 42%, #0d1526 100%);
  background-attachment: fixed;
}

.text-muted {
  color: var(--text-secondary) !important;
}

/* === 登入頁 === */
.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px)) max(1rem, env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
}

.login-shell {
  width: 100%;
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeInUp 0.55s ease;
}

@media (min-width: 992px) {
  .login-shell {
    flex-direction: row;
    align-items: stretch;
    gap: 2.5rem;
  }
}

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

.login-brand {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 0.5rem 0;
}

@media (min-width: 992px) {
  .login-brand {
    text-align: left;
    padding: 1.5rem 0.5rem 1.5rem 0;
    max-width: 26rem;
  }
}

.login-brand-badge {
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 1.15rem;
  box-shadow: var(--glow);
}

@media (min-width: 992px) {
  .login-brand-badge {
    margin: 0 0 1.5rem 0;
  }
}

.login-brand-badge i {
  font-size: 2.25rem;
  color: #fff;
}

.login-lead-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text-primary);
  text-wrap: balance;
}

.login-lead-text {
  margin: 0.75rem 0 0;
  font-size: clamp(0.95rem, 2.5vw, 1.05rem);
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 992px) {
  .login-lead-text {
    margin-left: 0;
    margin-right: 0;
  }
}

.login-hints {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: none;
  gap: 0.65rem;
  flex-direction: column;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

@media (min-width: 992px) {
  .login-hints {
    display: flex;
  }
}

.login-hints li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.login-hints i {
  color: var(--primary-color);
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.login-main {
  flex: 0 1 auto;
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
}

@media (min-width: 992px) {
  .login-main {
    margin: 0;
    max-width: 26rem;
    display: flex;
    align-items: center;
  }
}

.login-card {
  width: 100%;
  background: rgba(26, 26, 46, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 92, 246, 0.22);
  border-radius: clamp(16px, 3vw, 24px);
  padding: clamp(1.5rem, 4vw, 2.75rem) clamp(1.25rem, 4vw, 2.25rem);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), var(--glow);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
  .login-card:hover {
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.55), 0 0 28px rgba(139, 92, 246, 0.35);
    border-color: rgba(139, 92, 246, 0.35);
  }
}

.login-card-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

@media (min-width: 992px) {
  .login-card-header {
    text-align: left;
  }
}

.login-card-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

.login-card-sub {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.form-label {
  display: block;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 0.4rem;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
}

.form-control {
  background: rgba(15, 15, 30, 0.65);
  border: 1px solid rgba(139, 92, 246, 0.28);
  border-radius: 12px;
  color: var(--text-primary);
  padding: 0.8rem 1rem;
  min-height: 3rem;
  font-size: 16px;
  line-height: 1.4;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  width: 100%;
}

.form-control::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.form-control:focus {
  background: rgba(15, 15, 30, 0.88);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
  outline: none;
  color: var(--text-primary);
}

.field-group {
  margin-bottom: 1.1rem;
}

.field-group:last-of-type {
  margin-bottom: 0;
}

.btn-login {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border: none;
  border-radius: 12px;
  color: #fff;
  font-weight: 600;
  font-size: 1.05rem;
  padding: 0.9rem 1rem;
  min-height: 3rem;
  width: 100%;
  margin-top: 1.35rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

@media (hover: hover) and (pointer: fine) {
  .btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.45);
  }
}

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

.alert {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 12px;
  color: #fecaca;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.alert i {
  flex-shrink: 0;
  margin-top: 0.15rem;
}

@media (max-width: 380px) {
  .login-brand-badge {
    width: 4rem;
    height: 4rem;
  }
  .login-brand-badge i {
    font-size: 2rem;
  }
}
/* === 後台 === */

/* === 共用導覽 thsr-nav（後台 app-navbar、查詢頁共用）=== */
.thsr-nav.app-navbar,
nav.thsr-nav {
  background: rgba(15, 15, 30, 0.88) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.thsr-shell {
  width: 100%;
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--bs-gutter-x, 0.75rem);
  padding-right: var(--bs-gutter-x, 0.75rem);
}
@media (min-width: 992px) {
  .thsr-shell {
    padding-left: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
    padding-right: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
  }
}

.app-root {
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(0.75rem, env(safe-area-inset-top, 0px)) max(0.75rem, env(safe-area-inset-right, 0px)) max(0.75rem, env(safe-area-inset-bottom, 0px)) max(0.75rem, env(safe-area-inset-left, 0px));
}

/* 導覽與主內容同一直欄，左右邊緣對齊（手機維持窄欄；電腦後台加寬） */
.app-root > .app-navbar,
.app-root > .container-fluid,
.app-root > .app-main,
.app-root > .admin-manage-rail {
  width: 100%;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

@media (min-width: 992px) {
  body.thsr-app--admin .app-root > .app-navbar,
  body.thsr-app--admin .app-root > .container-fluid,
  body.thsr-app--admin .app-root > .app-main,
  body.thsr-app--admin .app-root > .admin-manage-rail {
    max-width: 1120px;
  }
}

@media (min-width: 1280px) {
  body.thsr-app--admin .app-root > .app-navbar,
  body.thsr-app--admin .app-root > .container-fluid,
  body.thsr-app--admin .app-root > .app-main,
  body.thsr-app--admin .app-root > .admin-manage-rail {
    max-width: 1280px;
  }
}

.app-root > .app-navbar .thsr-shell {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

.app-main {
  padding-bottom: 1.5rem;
}

.navbar.app-navbar {
  background: rgba(15, 15, 30, 0.88) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  padding: 0.65rem 1rem !important;
}

.app-navbar-inner {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.app-nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 1 1 auto;
  justify-content: center;
}

.app-nav-tabs .btn.is-active {
  background: #1a73e8 !important;
  border-color: #1a73e8 !important;
  color: #fff !important;
}

@media (max-width: 575.98px) {
  .app-navbar-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.55rem 0.65rem;
  }

  .navbar-brand {
    grid-column: 1;
    max-width: none;
  }

  .user-info {
    grid-column: 2;
    justify-content: flex-end;
  }

  .app-nav-tabs {
    grid-column: 1 / -1;
    order: unset;
    flex: 1 1 auto;
    justify-content: stretch;
  }

  .app-nav-tabs .btn {
    flex: 1 1 auto;
  }

  .user-action-label {
    display: none;
  }

  .user-info .btn {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }
}

.navbar-brand { 
  font-size: clamp(1.15rem, 3.5vw, 1.75rem);
  color: var(--text-primary) !important;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  line-height: 1.2;
  max-width: min(100%, 70vw);
}

.navbar-brand-badge {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e8f0fe;
  color: #1a73e8;
  font-size: 1.05rem;
}

.navbar-brand-badge i {
  line-height: 1;
}

.btn-nav-secondary {
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: var(--primary-color);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.9rem;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .btn-nav-secondary:hover {
    background: rgba(139, 92, 246, 0.22);
    border-color: var(--primary-color);
    color: #e9d5ff;
  }
}

.form-control,
.form-select {
  background: rgba(15, 15, 30, 0.6);
  color: var(--text-primary);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
  background: rgba(15, 15, 30, 0.8);
  color: var(--text-primary);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1), var(--glow);
}

.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23cbd5e1' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  padding-right: 2.5rem;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.form-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0.5rem;
  font-size: 1rem;
}

.form-check-input {
  background-color: rgba(15, 15, 30, 0.6);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.form-check-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.form-check-label {
  color: var(--text-secondary);
}

.form-text {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.form-label {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
}

input.form-control:not([type="file"]),
select.form-select {
  min-height: 2.75rem;
}

.card {
  background: rgba(26, 26, 46, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  color: var(--text-primary);
}

.card-header {
  background: rgba(139, 92, 246, 0.1);
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 16px 16px 0 0 !important;
}

h4 {
  color: var(--text-primary);
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1.25rem;
  font-size: clamp(1.2rem, 2.8vw, 1.5rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
  scroll-margin-top: 0.75rem;
}

.section-title {
  color: var(--text-primary);
  font-weight: 600;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  font-size: clamp(1.15rem, 2.6vw, 1.45rem);
}

/* 新增票券：頁內標題與輸入方式 */
.entry-page-header {
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(139, 92, 246, 0.18);
}

.entry-page-header .entry-page-title {
  color: var(--text-primary);
  font-weight: 600;
  font-size: clamp(1.25rem, 3vw, 1.55rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 0;
}

.entry-page-header .entry-page-lead {
  margin: 0.5rem 0 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.entry-mode-block .entry-mode-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-bottom: 0.6rem;
}

.entry-card .btn-check:checked + .btn {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #fff;
  border-color: transparent;
}

/* 新增票券：分組標題與呼吸空間 */
.entry-card .card-body {
  padding: clamp(1.25rem, 4vw, 1.75rem);
}

.form-section-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin: 0 0 0.25rem 0;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(139, 92, 246, 0.18);
}

#manualForm.row {
  --bs-gutter-y: 1.1rem;
  --bs-gutter-x: 1rem;
}

@media (min-width: 768px) {
  #manualForm.row {
    --bs-gutter-y: 1.25rem;
  }
}

.btn-add-ticket {
  background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
  color: #fff;
  border: none;
  font-weight: 600;
  padding: 0.7rem 1.5rem;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.25);
  max-width: 100%;
  width: 100%;
}

@media (min-width: 576px) {
  .btn-add-ticket {
    width: auto;
    min-width: min(100%, 14rem);
    display: block;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (hover: hover) and (pointer: fine) {
  .btn-add-ticket:hover {
    color: #fff;
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
  }
}

.btn-add-ticket:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.search-form-actions {
  margin-top: 0.25rem;
}

.search-form-actions .btn {
  width: 100%;
}

@media (min-width: 768px) {
  .search-form-actions .btn {
    width: auto;
    min-width: 7rem;
  }
}

details.dash-panel {
  background: rgba(26, 26, 46, 0.55);
  border: 1px solid rgba(139, 92, 246, 0.22);
  border-radius: 16px;
  margin-bottom: 1rem;
  overflow: hidden;
}

details.dash-panel > summary.dash-panel-summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: clamp(0.95rem, 2.5vw, 1.05rem);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  user-select: none;
}

details.dash-panel > summary.dash-panel-summary::-webkit-details-marker {
  display: none;
}

details.dash-panel > summary.dash-panel-summary::after {
  content: '▼';
  font-size: 0.7rem;
  opacity: 0.65;
  transition: transform 0.2s ease;
}

details.dash-panel[open] > summary.dash-panel-summary::after {
  transform: rotate(-180deg);
}

details.dash-panel .dash-panel-body {
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid rgba(139, 92, 246, 0.12);
}

.field-needs-input {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 0.15rem rgba(245, 158, 11, 0.35);
}

.ticket-card {
  background: rgba(26, 26, 46, 0.65);
  border: 1px solid rgba(139, 92, 246, 0.2) !important;
  border-radius: 14px;
}

.ticket-card .btn {
  font-size: 0.85rem;
}

/* 未設 data-bs-theme 時 Bootstrap .text-muted 為深灰，在深色卡片上不可讀 */
.text-muted {
  color: var(--text-secondary) !important;
}

/* 票券列表卡片：擁有者／日期時間為必要資訊，對比需高於一般次要文字 */
.ticket-card-owner {
  color: #cbd5e1 !important;
  font-size: 0.8125rem;
}

.ticket-card-datetime {
  color: #e2e8f0 !important;
  font-size: 0.9rem;
  font-weight: 500;
}

.ticket-card .btn-outline-info {
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.55);
}

.ticket-card .btn-outline-info:hover {
  color: #f0f9ff;
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(125, 211, 252, 0.75);
}

.ticket-card .btn-outline-primary {
  color: #c4b5fd;
  border-color: rgba(167, 139, 250, 0.5);
}

.ticket-card .btn-outline-primary:hover {
  color: #f5f3ff;
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(196, 181, 253, 0.75);
}

.ticket-card .btn-outline-success {
  color: #86efac;
  border-color: rgba(74, 222, 128, 0.5);
}

.ticket-card .btn-outline-success:hover {
  color: #f0fdf4;
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(134, 239, 172, 0.75);
}

/* 表格样式 */
.table-responsive {
  background: transparent;
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch; /* 移动端平滑滚动 */
  position: relative;
}

.table {
  background: transparent !important;
  color: var(--text-secondary);
  margin-bottom: 0;
  min-width: 800px; /* 確保表格有最小寬度，可橫向滾動 */
  --bs-table-bg: transparent;
  --bs-table-striped-bg: transparent;
  --bs-table-hover-bg: rgba(139, 92, 246, 0.1);
}

.table thead {
  background: rgba(139, 92, 246, 0.15);
  backdrop-filter: blur(10px);
}

.table thead th {
  color: var(--text-primary);
  font-weight: 600;
  border: none;
  padding: 1rem 0.75rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.table tbody tr {
  background: rgba(26, 26, 46, 0.3) !important;
  border-bottom: 1px solid rgba(139, 92, 246, 0.1);
  transition: all 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .table tbody tr:hover {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.15), rgba(99, 102, 241, 0.15)) !important;
    transform: translateX(2px);
  }
}

.table tbody td {
  padding: 0.75rem;
  vertical-align: middle;
  color: var(--text-secondary);
  border: none;
  font-size: 0.9rem;
}

/* 按钮样式 */
.btn {
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
  white-space: nowrap;
}

.btn-success {
  background: linear-gradient(135deg, var(--success-color), #059669);
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

@media (hover: hover) and (pointer: fine) {
  .btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  }

  .btn-info:hover {
    background: linear-gradient(135deg, #0891b2, #0e7490);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
  }

  .btn-warning:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
  }

  .btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  }

  .btn-primary:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
  }

  .btn-outline-secondary:hover,
  .btn-outline-warning:hover,
  .btn-outline-success:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--primary-color);
    color: var(--text-primary);
    transform: translateY(-2px);
  }
}

.btn-info {
  background: linear-gradient(135deg, var(--accent-color), #0891b2);
  color: white;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3);
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning-color), #d97706);
  color: white;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger-color), #dc2626);
  color: white;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.btn-outline-secondary,
.btn-outline-warning,
.btn-outline-success {
  background: rgba(26, 26, 46, 0.4);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: var(--text-primary);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

/* 手機優化 */
@media (max-width: 768px) {
  /* 確保頁面不會阻止橫向滾動 */
  html, body {
    overflow-x: visible;
    width: 100%;
  }
  
  /* 確保容器不會限制寬度 */
  .container, .container-fluid, .container-lg {
    overflow-x: visible;
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }
  
  .navbar.app-navbar {
    padding: 0.55rem 0.65rem !important;
  }
  
  .app-navbar-inner {
    gap: 0.65rem;
  }
  
  .user-info {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.45rem 0.6rem;
    max-width: 100%;
  }
  
  .user-badge {
    padding: 0.38rem 0.58rem;
    font-size: 0.8rem;
    max-width: 100%;
  }
  
  .user-badge span {
    max-width: 6.5rem;
  }

  .seller-account-menu {
    position: static;
  }

  .seller-account-menu__panel {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0.65rem;
    left: auto;
    bottom: auto;
    z-index: 1200;
    min-width: 11rem;
  }
  
  .btn-logout {
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
    min-height: 2.6rem;
  }
  
  .btn-nav-secondary {
    min-height: 2.6rem;
    font-size: 0.85rem;
  }
  
  /* 表格橫向滾動優化 */
  .table-responsive {
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px;
    padding-right: 12px;
    border-radius: 0;
  }
  
  .table th, .table td {
    font-size: 0.75rem;
    padding: 0.5rem 0.3rem;
    white-space: nowrap; /* 防止文字換行，保持表格整潔 */
  }
  
  .btn-sm {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }
  
  .form-control, .form-select {
    font-size: 16px; /* 防止iOS放大 */
  }
  
  h4 {
    font-size: 1.25rem;
}

  /* 卡片在移動端的間距調整 */
  .card {
    margin-bottom: 1rem;
  }
}

/* 確保時間輸入顯示24小時制 */
input[type="time"] {
  -webkit-appearance: none;
  -moz-appearance: textfield;
}

input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
}

/* 表格橫向滾動條樣式 */
.table-responsive::-webkit-scrollbar {
  height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
  background: rgba(15, 15, 30, 0.4);
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
}

/* 用户信息区域 */
.user-info {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  color: var(--text-primary);
  min-width: 0;
}

.user-badge {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  box-shadow: var(--glow);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
}

.user-badge span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 16rem;
}

.seller-account-menu {
  position: relative;
  z-index: 5;
}

.seller-account-menu > summary {
  cursor: pointer;
  list-style: none;
}

.seller-account-menu > summary::-webkit-details-marker {
  display: none;
}

.seller-account-menu__chevron {
  font-size: 0.7rem;
  transition: transform 0.18s ease;
}

.seller-account-menu[open] .seller-account-menu__chevron {
  transform: rotate(180deg);
}

.seller-account-menu__panel {
  position: absolute;
  z-index: 1200;
  top: calc(100% + 0.4rem);
  right: 0;
  display: grid;
  min-width: 10.5rem;
  overflow: hidden;
  border: 1px solid #dadce0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(60, 64, 67, 0.2);
}

body.thsr-app--admin .app-root > .app-navbar {
  position: sticky;
  top: max(0.5rem, env(safe-area-inset-top, 0px));
  z-index: 1100;
}

body.thsr-app--admin .app-root > .app-navbar,
body.thsr-app--admin .app-navbar-inner,
body.thsr-app--admin .user-info {
  overflow: visible;
}

body.thsr-app--admin .app-navbar-inner {
  position: relative;
}

.seller-account-menu__panel button,
.seller-account-menu__panel a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 0;
  background: #fff;
  color: #3c4043;
  font-size: 0.88rem;
  text-align: left;
  text-decoration: none;
}

.seller-account-menu__panel button:hover,
.seller-account-menu__panel a:hover {
  background: #f1f3f4;
}

.btn-logout {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 500;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger-color);
    color: #fef2f2;
    transform: translateY(-2px);
  }
}
/* === 查詢前台 === */
/* 舊版 .modern-navbar 保留相容；新版型請用與後台相同之 .app-navbar.thsr-nav */
.modern-navbar {
  background: rgba(15, 15, 30, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
}

.logo-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

.navbar-logo:hover .logo-icon {
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.6);
  transform: translateY(-2px);
}

.logo-icon svg {
  width: 24px;
  height: 24px;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.navbar-line-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: rgba(255, 255, 255, 0.95);
  color: #06c755;
  border-radius: 24px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.navbar-line-btn:hover {
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  color: #06c755;
}

.navbar-line-btn i {
  font-size: 1.1rem;
}

@media (max-width: 767.98px) {
  .navbar-container {
    padding: 0 1rem;
  }
  
  .logo-text {
    font-size: 1rem;
  }
  
  .logo-icon {
    width: 36px;
    height: 36px;
  }
  
  .navbar-line-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
  
  .navbar-line-btn span {
    display: none;
  }
  
  .navbar-line-btn i {
    font-size: 1.2rem;
  }
}

/* 主容器样式 - AI深色风格 */
.query-container {
  background: rgba(26, 26, 46, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(20px);
  margin: 2rem auto;
  padding: clamp(2rem, 5vw, 3.5rem);
  max-width: 1140px;
  width: 100%;
  box-sizing: border-box;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* 页面标题 */
.page-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.page-title {
  font-size: clamp(2rem, 5vw, 2.5rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin: 0;
}

/* 查詢頁：標題層級與輔助文案 */
body.thsr-app--query .page-kicker {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.95);
  margin: 0 0 0.75rem;
}

body.thsr-app--query .page-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 1rem 0 0;
  opacity: 0.85;
  letter-spacing: 0.02em;
}

body.thsr-app--query .page-header {
  border-bottom: none;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  position: relative;
}

body.thsr-app--query .page-header::after {
  content: "";
  display: block;
  width: min(220px, 55%);
  height: 1px;
  margin: 1.75rem auto 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(139, 92, 246, 0.45) 25%,
    rgba(6, 182, 212, 0.35) 75%,
    transparent
  );
  border-radius: 2px;
}

body.thsr-app--query .query-container {
  background: linear-gradient(155deg, rgba(30, 30, 52, 0.78) 0%, rgba(16, 16, 32, 0.82) 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    0 0 0 1px rgba(139, 92, 246, 0.1) inset,
    0 28px 90px -20px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

body.thsr-app--query .search-card {
  background: rgba(18, 18, 34, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

body.thsr-app--query .search-card__head {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(139, 92, 246, 0.12);
}

body.thsr-app--query .search-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

body.thsr-app--query .search-card__lead {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
  max-width: 36rem;
}

body.thsr-app--query .table-container {
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
}

.results-summary {
  margin: 0 0 1rem;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.results-summary strong {
  color: var(--text-primary);
  font-weight: 700;
}

body.thsr-app--query .empty-state {
  padding: 3rem 1.5rem;
  border-radius: 18px;
  border: 1px dashed rgba(139, 92, 246, 0.25);
  background: rgba(0, 0, 0, 0.15);
}

body.thsr-app--query .loading {
  padding: 2.75rem 1rem;
}

body.thsr-app--query .line-group-alert {
  border-radius: 16px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(5, 150, 105, 0.08));
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

body.thsr-app--query .modal-content-custom {
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 0 0 1px rgba(139, 92, 246, 0.15) inset,
    0 28px 80px rgba(0, 0, 0, 0.55);
}

body.thsr-app--query .modal-btn-confirm {
  min-width: 7.5rem;
  border-radius: 12px;
}

body.thsr-app--query .btn-buy:not(.btn) {
  border-radius: 12px;
  padding: 0.5rem 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.28);
}

/* 搜索卡片 - AI深色风格 */
.search-card {
  background: rgba(26, 26, 46, 0.4);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(139, 92, 246, 0.2);
}


/* 表单标签样式 */
.form-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
}

/* 表单样式 - AI深色风格 */
.form-control, .form-select {
  border-radius: 12px;
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 0.875rem 1.125rem;
  font-size: 0.95rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-weight: 500;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2), var(--glow);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.form-control::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23cbd5e1' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  background-size: 16px 12px;
}

/* 按钮样式 */
.btn {
  border-radius: 12px;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border: 1px solid rgba(139, 92, 246, 0.5);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), var(--glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 0 30px rgba(139, 92, 246, 0.5);
  background: linear-gradient(135deg, #9d6fff 0%, #7c71ff 100%);
  border-color: rgba(139, 92, 246, 0.8);
}

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

.btn-success {
  background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning-color) 0%, #f97316 100%);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.4);
  color: white;
}

/* 表格容器样式 - AI深色风格 */
.table-container {
  background: rgba(26, 26, 46, 0.4);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(139, 92, 246, 0.2);
  animation: fadeIn 0.5s ease-out;
}

.table-responsive {
  background: transparent;
}

.table-responsive .table {
  background: transparent;
}

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

.table {
  margin-bottom: 0;
  background: transparent !important;
  color: var(--text-secondary);
  --bs-table-bg: transparent !important;
  --bs-table-striped-bg: transparent !important;
  --bs-table-hover-bg: rgba(139, 92, 246, 0.08) !important;
}

.table th {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(99, 102, 241, 0.15));
  color: var(--text-primary);
  border: none;
  font-weight: 700;
  padding: 1.125rem 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.table td {
  border-color: rgba(139, 92, 246, 0.1);
  vertical-align: middle;
  padding: 1.125rem 1rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.table tbody tr {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-bottom: 1px solid rgba(139, 92, 246, 0.1);
  background: rgba(26, 26, 46, 0.3) !important;
}

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

.table tbody tr:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(99, 102, 241, 0.15)) !important;
}

/* 简化的表格样式 */
.ticket-row {
  transition: all 0.2s ease;
}

.ticket-row:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(99, 102, 241, 0.1));
}

/* 票根缩略图样式（桌面：略放大、contain 利於看清票面） */
.ticket-thumb {
  width: 128px;
  height: 88px;
  object-fit: contain;
  object-position: center;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  background: rgba(0, 0, 0, 0.35);
}

.ticket-thumb:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}

.no-image {
  width: 128px;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.35rem;
}

.no-image a {
  color: var(--accent-color);
  font-weight: 600;
}

/* 日期样式 - AI深色 */
.date-info {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
}

/* 路线信息样式 - AI深色 */
.route-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.route-info .station {
  font-weight: 600;
  color: var(--text-primary);
}

.route-info .bi-arrow-right {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* 时间信息样式 - AI深色（與路線同區時需足夠對比） */
.time-info {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.type-badge,
.discount-badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

.type-badge.free {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(6, 182, 212, 0.2));
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.4);
  }
  
.type-badge.reserved {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.2));
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.type-badge.business {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(139, 92, 246, 0.2));
  color: #a78bfa;
  border: 1px solid rgba(167, 139, 250, 0.45);
}

.discount-badge {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(251, 191, 36, 0.2));
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.btn-buy {
  padding: 0.5rem 1.25rem;
  background: linear-gradient(135deg, var(--success-color), #059669);
  color: white;
  border: 1px solid rgba(16, 185, 129, 0.5);
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.btn-buy:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4), 0 0 25px rgba(16, 185, 129, 0.4);
}



/* 警告框样式 */
.alert {
  border-radius: 16px;
  border: none;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--card-shadow);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.alert-info {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(14, 165, 233, 0.15));
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.alert-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(251, 191, 36, 0.15));
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.alert-danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(220, 38, 38, 0.15));
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.15));
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-primary {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(99, 102, 241, 0.15));
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

/* 行動／平板：以卡片為主、票根大圖置頂 */
@media (max-width: 767.98px) {
  body.thsr-app--query {
    padding: 0;
  }
  
  .query-container {
    margin: 0.65rem 0;
    padding: 1rem 0.9rem 1.25rem;
    border-radius: 18px;
  }
  
  .page-header {
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
  }
  
  .page-title {
    font-size: 1.45rem;
    margin-bottom: 0.2rem;
  }
  
  .page-subtitle {
    font-size: 0.88rem;
    margin-bottom: 0;
  }

  body.thsr-app--query .page-kicker,
  body.thsr-app--query .page-meta {
    display: none;
  }
  
  .search-card {
    padding: 1rem;
  }

  body.thsr-app--query .search-card__head {
    margin-bottom: 0.85rem;
    padding-bottom: 0.65rem;
  }

  body.thsr-app--query .search-card__lead {
    font-size: 0.82rem;
  }

  #queryForm .row.g-3 {
    --bs-gutter-y: 0.65rem;
  }

  .results-summary {
    display: block;
    margin: 0 0 0.85rem;
    padding: 0.55rem 0.85rem;
    border-radius: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
  }

  .results-summary strong {
    color: var(--text-primary);
    font-weight: 700;
  }
  
  .navbar-brand {
    font-size: 1.1rem;
  }
  
  .navbar .btn-success {
    font-size: 0.75rem;
    padding: 0.4rem 0.7rem;
  }
  
  .table-responsive .table {
    display: none !important;
  }
  
  .mobile-card {
    display: block !important;
    padding: 0;
  }
  
  .mobile-card .ticket-mobile-card {
    border-radius: 18px;
    box-shadow: var(--card-shadow);
    margin-bottom: 1rem;
    border: 1px solid rgba(139, 92, 246, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: rgba(18, 18, 34, 0.92);
  }

  .mobile-card .ticket-mobile-card-main {
    flex: 1 1 auto;
    min-height: 0;
    background: rgba(26, 26, 46, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .mobile-card .ticket-mobile-card-cta {
    flex-shrink: 0;
    position: relative;
    z-index: 4;
    padding: 0.45rem 1rem 0.85rem;
    background: rgba(20, 20, 38, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    isolation: isolate;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.1rem;
  }

  .mobile-card .myship-fallback-btn {
    font-size: 0.78rem;
    line-height: 1.35;
    border: none;
    background: transparent;
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  
  .ticket-mobile-photo-wrap {
    width: 100%;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 112px;
    /* 依視窗高度上限，避免直式大圖佔滿半屏；寬度仍 100% 由 object-fit 留白 */
    max-height: min(32vh, 240px);
    max-height: min(32dvh, 240px);
    position: relative;
    overflow: hidden;
  }
  
  .ticket-mobile-photo {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: min(32vh, 240px);
    max-height: min(32dvh, 240px);
    object-fit: contain;
    object-position: center;
    display: block;
    cursor: zoom-in;
  }
  
  .ticket-mobile-photo-fail {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    min-height: 112px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
  }
  
  .ticket-mobile-photo-fail a {
    color: var(--accent-color);
    font-weight: 600;
  }
  
  .ticket-mobile-photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 1.25rem 1rem;
    text-align: center;
    min-height: 120px;
    max-height: min(28vh, 200px);
    max-height: min(28dvh, 200px);
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.45;
    background: rgba(0, 0, 0, 0.35);
  }
  
  .ticket-mobile-photo-placeholder a {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.35rem 0.75rem;
    border-radius: 10px;
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.35);
  }
  
  .ticket-mobile-body {
    padding: 0.85rem 1rem 0.55rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .ticket-mobile-body--with-photo {
    padding-top: 0.7rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }
  
  .ticket-mobile-route {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    line-height: 1.35;
    text-align: center;
  }
  
  .ticket-mobile-meta {
    font-size: 0.86rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.35rem 0.65rem;
  }

  .ticket-mobile-meta .ticket-mobile-type {
    font-size: 0.72rem;
    padding: 0.28rem 0.55rem;
  }
  
  .ticket-mobile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
  }
  
  /* 次要於票券資訊：不滿版、較矮，避免整屏被綠色 CTA 壓過；保留約 40px 觸控高度 */
  .mobile-card .btn-buy {
    align-self: center;
    width: auto;
    max-width: min(100%, 240px);
    min-height: 40px;
    margin-top: 0.35rem;
    padding: 0.35rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
  }
  
  .mobile-card .badge {
    font-size: 0.75rem;
    padding: 0.4rem 0.7rem;
  }
  
  .form-control, .form-select {
    font-size: 16px;
  }
  
  .alert {
    padding: 1rem;
    font-size: 0.9rem;
  }
  
  .alert-danger .row {
    gap: 1rem;
  }

  body.thsr-app--query .search-card {
    padding: 1rem 0.95rem;
  }

  body.thsr-app--query .mobile-card .ticket-mobile-card {
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow:
      0 0 0 1px rgba(139, 92, 246, 0.1) inset,
      0 16px 48px rgba(0, 0, 0, 0.4);
  }

  body.thsr-app--query .mobile-card .btn-buy.btn-buy--myship {
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    margin-top: 0;
    padding: 0.85rem 1.15rem;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 14px;
    letter-spacing: 0.02em;
    box-shadow: 0 6px 24px rgba(16, 185, 129, 0.35);
    touch-action: manipulation;
    text-decoration: none;
  }
}

/* 查詢結果下方 LINE 提示：窄屏直向堆疊，較寬時橫排 */
.line-group-alert .line-group-alert-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}

.line-group-alert .line-group-alert-text {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.line-group-alert .line-group-alert-btn {
  width: 100%;
  justify-content: center;
  padding: 0.55rem 0.85rem;
  font-weight: 600;
}

@media (min-width: 576px) {
  .line-group-alert .line-group-alert-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .line-group-alert .line-group-alert-btn {
    width: auto;
    flex-shrink: 0;
  }
}

/* 平板／手機卡片斷點為 max-width 767.98px；此段僅微調中等螢幕容器 */
@media (min-width: 768px) and (max-width: 1200px) {
  .query-container {
    margin: 1rem 0;
    padding: 2rem;
  }
  
  .table th, .table td {
    font-size: 0.9rem;
    padding: 0.875rem;
  }
}

/* 加载动画 */
.loading {
  display: none;
  text-align: center;
  padding: 3rem;
  animation: fadeIn 0.3s ease-out;
}

.spinner-border {
  width: 3rem;
  height: 3rem;
  border-width: 0.3rem;
  color: var(--primary-color);
}

/* 空状态 - AI深色风格 */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
  animation: fadeIn 0.5s ease-out;
}

.empty-state div:first-child {
  font-size: 5rem;
  margin-bottom: 1.5rem;
  opacity: 0.4;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.empty-state h5 {
  color: var(--text-secondary);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.empty-state__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.empty-state__actions .btn {
  min-width: 10.5rem;
}

/* 图片样式 */
.img-thumbnail {
  border-radius: 12px;
  border: 2px solid #e5e7eb;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.img-thumbnail:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: var(--primary-color);
}

/* 导航栏按钮 */
.navbar .btn-success {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

/* 标题样式（深色頁面不可用淺色底專用的深灰字） */
h4 {
  color: var(--text-primary);
  font-weight: 800;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 小图标样式 */
.bi {
  vertical-align: -0.125em;
}

/* 加载骨架屏 */
.skeleton {
  animation: skeleton-loading 1s linear infinite alternate;
}

@keyframes skeleton-loading {
  0% {
    background-color: hsl(200, 20%, 80%);
  }
  100% {
    background-color: hsl(200, 20%, 95%);
}
}

/* 自定义模态框样式 - AI深色风格 */
.custom-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 15, 30, 0.9);
  backdrop-filter: blur(10px);
  z-index: 10000;
  animation: fadeIn 0.2s ease-out;
}

.custom-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content-custom {
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.95), rgba(22, 33, 62, 0.95));
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 20px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(139, 92, 246, 0.2);
  animation: slideUpModal 0.3s ease-out;
}

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

.modal-header-custom {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.modal-icon {
  font-size: 2rem;
}

.modal-title-custom {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.modal-body-custom {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 2rem;
}

.modal-body-custom strong {
  color: var(--text-primary);
}

.modal-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 1rem;
  color: #fbbf24;
}

.modal-warning-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.modal-footer-custom {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.modal-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
}

.modal-btn-cancel {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.modal-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
}

.modal-btn-confirm {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.modal-btn-confirm:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.5);
}

/* 電子票聯絡按鈕懸停效果 */
.modal-body-custom a[href*="facebook.com"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(24, 119, 242, 0.5);
}

.modal-body-custom a[href*="line.me"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 195, 0, 0.5);
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #9d6fff, #7c71ff);
}

/* 桌面端隱藏移動卡片 */
@media (min-width: 768px) {
  .mobile-card {
    display: none !important;
  }
}

/* 深色主題下的縮圖（查詢頁） */
.img-thumbnail {
  border-radius: 12px;
  border: 1px solid rgba(139, 92, 246, 0.25);
  background: rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.img-thumbnail:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  border-color: var(--primary-color);
}

/* ==========================================================================
   Google-like clean style overrides (light, simple, clear)
   ========================================================================== */
:root {
  --primary-color: #1a73e8;
  --secondary-color: #1967d2;
  --accent-color: #1a73e8;
  --success-color: #188038;
  --warning-color: #f9ab00;
  --danger-color: #d93025;
  --info-color: #1a73e8;
  --bg-primary: #f8f9fa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f3f4;
  --surface: #ffffff;
  --surface-hover: #f8f9fa;
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --text-muted: #80868b;
  --card-shadow: 0 1px 2px rgba(60, 64, 67, 0.2), 0 1px 3px 1px rgba(60, 64, 67, 0.1);
  --card-shadow-hover: 0 2px 6px rgba(60, 64, 67, 0.25), 0 4px 12px rgba(60, 64, 67, 0.12);
  --glow: none;
  --search-bg: #ffffff;
}

html, body {
  background: #f8f9fa !important;
  color: var(--text-primary);
}

body.thsr-app,
body.thsr-app--login,
body.thsr-app--query,
body.thsr-app--admin {
  font-family: "Roboto", "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f8f9fa !important;
  color: var(--text-primary);
}

.app-root {
  background: transparent;
}

.navbar.app-navbar {
  background: #ffffff !important;
  border: 1px solid #e0e3e7;
  border-radius: 14px !important;
  box-shadow: var(--card-shadow);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.navbar-brand {
  color: #1f1f1f !important;
  font-weight: 700;
  letter-spacing: 0;
}

.btn,
.btn:focus {
  border-radius: 10px;
  box-shadow: none !important;
}

.btn-primary,
.btn-login,
.btn-add-ticket,
.modal-btn-confirm {
  background: #1a73e8 !important;
  border-color: #1a73e8 !important;
  color: #fff !important;
}

.btn-primary:hover,
.btn-login:hover,
.btn-add-ticket:hover,
.modal-btn-confirm:hover {
  background: #1967d2 !important;
  border-color: #1967d2 !important;
  transform: none !important;
}

.btn-nav-secondary,
.btn-logout,
.modal-btn-cancel {
  background: #fff !important;
  color: #3c4043 !important;
  border: 1px solid #dadce0 !important;
}

.query-container,
.search-card,
.entry-card,
.dash-panel .dash-panel-body,
.table-container,
.empty-state,
.login-card,
.login-brand,
.card,
.modal-content-custom {
  background: #fff !important;
  color: var(--text-primary) !important;
  border: 1px solid #e0e3e7 !important;
  border-radius: 14px !important;
  box-shadow: var(--card-shadow) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.query-container {
  padding: clamp(1.2rem, 2.5vw, 2rem);
}

.page-header {
  border: 0 !important;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
}

.page-header::after {
  display: none !important;
}

.page-kicker {
  color: #5f6368 !important;
  letter-spacing: 0.08em !important;
}

.page-title {
  background: none !important;
  -webkit-text-fill-color: initial !important;
  color: #202124 !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
}

.page-subtitle,
.page-meta,
.search-card__lead,
.text-muted,
.form-text {
  color: #5f6368 !important;
}

.form-label {
  color: #3c4043;
  font-weight: 500;
}

.form-control,
.form-select,
textarea.form-control {
  background: #fff !important;
  border: 1px solid #dadce0 !important;
  color: #202124 !important;
  border-radius: 10px !important;
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
  border-color: #1a73e8 !important;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.16) !important;
  background: #fff !important;
}

.table {
  --bs-table-bg: #fff;
  --bs-table-striped-bg: #f8f9fa;
  --bs-table-hover-bg: #f1f3f4;
  color: #202124;
}

.table thead th {
  color: #5f6368;
  font-weight: 600;
  border-bottom-color: #e0e3e7;
}

.table-dark,
.table-dark > :not(caption) > * > * {
  --bs-table-bg: #f8f9fa !important;
  --bs-table-color: #3c4043 !important;
  --bs-table-border-color: #e0e3e7 !important;
  color: #3c4043 !important;
}

.type-badge,
.discount-badge,
.badge {
  border-radius: 999px !important;
  font-weight: 500 !important;
}

.custom-modal {
  background: rgba(32, 33, 36, 0.28) !important;
}

.modal-title-custom {
  color: #202124 !important;
}

.modal-body-custom {
  color: #3c4043 !important;
}

.modal-content.bg-dark.text-light {
  background: #fff !important;
  color: #202124 !important;
  border-color: #e0e3e7 !important;
}

.modal-content.bg-dark.text-light .modal-header {
  border-bottom-color: #e8eaed !important;
}

.btn-close.btn-close-white {
  filter: none !important;
  opacity: 0.6;
}

.modal-warning {
  background: #fef7e0 !important;
  border-color: #f9de9b !important;
  color: #8a6100 !important;
}

.login-page {
  background: transparent !important;
}

.login-shell {
  max-width: 980px;
}

.login-brand,
.login-main {
  min-width: 0;
}

.login-brand,
.login-card {
  padding: clamp(1.25rem, 2.8vw, 2rem) !important;
}

.login-lead-title {
  word-break: keep-all;
}

.login-brand-badge i {
  color: #1a73e8 !important;
}

.login-shell--simple {
  max-width: 26rem !important;
  margin-left: auto;
  margin-right: auto;
}

.login-card-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-card-brand .login-brand-badge {
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0.85rem;
}

.login-card-brand .login-lead-title {
  margin: 0;
  font-size: 1.45rem;
}

.login-seller-hint {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: #5f6368;
}

.login-back-home {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1a73e8;
  text-decoration: none;
}

.login-no-account {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: #5f6368;
}

.login-line-link {
  font-weight: 650;
  color: #06c755;
  text-decoration: none;
}

.login-line-link:hover,
.login-line-link:focus-visible {
  text-decoration: underline;
}

/* ---------- 首頁：買家／賣家分流 ---------- */

.home-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  background: #f8f9fa;
}

.home-shell {
  width: min(100%, 28rem);
}

.home-brand {
  text-align: center;
  margin-bottom: 1.75rem;
}

.home-brand-badge {
  width: 4.25rem;
  height: 4.25rem;
  margin: 0 auto 0.9rem;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8f0fe;
  color: #1a73e8;
  font-size: 2rem;
}

.home-title {
  margin: 0;
  font-size: clamp(1.6rem, 5vw, 1.9rem);
  font-weight: 750;
  color: #202124;
  letter-spacing: -0.02em;
}

.home-lead {
  margin: 0.45rem 0 0;
  color: #5f6368;
  font-size: 1rem;
}

.home-role-grid {
  display: grid;
  gap: 0.85rem;
}

.home-role-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 1.15rem 1.2rem;
  border-radius: 16px;
  border: 1.5px solid #dadce0;
  background: #fff;
  color: #202124;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.home-role-card:hover,
.home-role-card:focus {
  color: #202124;
  border-color: #1a73e8;
  box-shadow: 0 4px 16px rgba(26, 115, 232, 0.16);
  transform: translateY(-1px);
}

.home-role-icon {
  font-size: 1.45rem;
  color: #1a73e8;
  margin-bottom: 0.2rem;
}

.home-role-title {
  font-size: 1.15rem;
  font-weight: 750;
}

.home-role-desc {
  font-size: 0.9rem;
  color: #5f6368;
}

.home-resume {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.875rem;
  color: #5f6368;
}

.home-resume a {
  color: #1a73e8;
  font-weight: 600;
  text-decoration: none;
}

@media (min-width: 992px) {
  .login-shell--simple {
    display: block !important;
    grid-template-columns: none !important;
  }
}

@media (min-width: 992px) {
  .login-shell {
    max-width: 1080px;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.25rem !important;
  }

  .login-brand {
    max-width: none !important;
    text-align: left;
  }

  .login-main {
    max-width: none !important;
    width: 100%;
  }
}

.login-brand-badge {
  background: #e8f0fe !important;
  color: #1a73e8 !important;
  box-shadow: none !important;
}

.login-hints li {
  background: #f8f9fa !important;
  border: 1px solid #e8eaed !important;
}

.dash-panel {
  border: 1px solid #e0e3e7 !important;
  border-radius: 14px !important;
  background: #fff !important;
}

.dash-panel-summary {
  background: #fff !important;
  color: #202124 !important;
  border-bottom: 1px solid #eceff1 !important;
}

/* 後台摘要列上的 badge（管理員 / 展開後載入）統一灰藍系 */
body.thsr-app--admin .dash-panel-summary .badge {
  background: #e8eaed !important;
  color: #3c4043 !important;
  border: 1px solid #dadce0 !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

body.thsr-app--admin .dash-panel-summary #ticketListCount {
  background: #e8f0fe !important;
  color: #174ea6 !important;
  border-color: #c6dafc !important;
}

/* Drive 狀態：頂部色條（藍＝已授權／紅＝未授權；點擊可連結或解除） */
.app-root > .drive-status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: calc(100% + max(1.5rem, env(safe-area-inset-left, 0px) + env(safe-area-inset-right, 0px)));
  max-width: none;
  margin: calc(-1 * max(0.75rem, env(safe-area-inset-top, 0px))) calc(-1 * max(0.75rem, env(safe-area-inset-right, 0px))) 0.65rem calc(-1 * max(0.75rem, env(safe-area-inset-left, 0px)));
  padding-top: env(safe-area-inset-top, 0px);
  height: calc(4px + env(safe-area-inset-top, 0px));
  border: 0;
  border-radius: 0;
  text-decoration: none !important;
  color: #fff !important;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  flex-shrink: 0;
  z-index: 1040;
  transition: filter 0.15s ease, height 0.15s ease;
}

.app-root > .drive-status-bar.is-ok {
  background: linear-gradient(90deg, #1a73e8 0%, #4285f4 50%, #1a73e8 100%);
}

.app-root > .drive-status-bar.is-bad {
  height: calc(2rem + env(safe-area-inset-top, 0px));
  background: linear-gradient(90deg, #d93025 0%, #ea4335 50%, #d93025 100%);
}

.app-root > .drive-status-bar.is-bad span {
  padding: 0 0.75rem;
}

a.drive-status-bar:hover,
a.drive-status-bar:focus-visible {
  filter: brightness(1.06);
  outline: none;
}

html, body {
  overscroll-behavior-y: none;
}

body.thsr-app--admin,
body.thsr-app--admin .app-root,
body.thsr-app--admin .app-main {
  overscroll-behavior-y: contain;
}

/* 賣家列表搜尋：對齊買家 query 路線區塊 */
.seller-list-search {
  display: grid;
  gap: 1rem;
  max-width: 44rem;
  margin: 0 auto 1rem;
  padding: 1rem 0.85rem 1.05rem;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff 0%, #fff 70%);
  box-shadow: inset 0 0 0 1px #e8f0fe;
}

.seller-list-search__block {
  text-align: center;
}

.seller-list-search__label,
.seller-list-search .form-label {
  display: block;
  margin-bottom: 0.35rem;
  color: #5f6368;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
}

.seller-list-search__date {
  max-width: 360px;
  margin: 0 auto;
  min-height: 52px;
}

.seller-search-intro {
  max-width: 44rem;
  margin: 0 auto 0.65rem;
  color: #5f6368;
  font-size: 0.85rem;
  text-align: center;
}

.seller-list-search .query-route-fields {
  margin-top: 0.15rem;
}

.seller-list-search .query-popular-routes {
  justify-content: flex-start;
  margin-top: 0.75rem;
}

.seller-list-search__actions {
  margin-top: 0.15rem;
  justify-content: center;
}

.seller-list-search__actions .btn {
  min-height: 44px;
  min-width: 7rem;
  border-radius: 999px;
}

@media (max-width: 767.98px) {
  .seller-list-search {
    padding: 0.85rem 0.65rem 0.95rem;
  }
  .seller-list-search .query-route-fields {
    grid-template-columns: minmax(0, 1fr) 2.25rem minmax(0, 1fr);
    align-items: end;
    gap: 0.35rem;
  }
  .seller-list-search .query-route-swap {
    width: 2.25rem;
    height: 2.25rem;
    margin: 0 0 0.4rem;
    transform: none;
  }
  .seller-list-search .query-route-fields .form-select,
  .seller-list-search__date {
    min-height: 44px;
  }
  .seller-list-search .query-popular-routes {
    justify-content: center;
  }
  .seller-list-search__actions {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 0.5rem;
    margin-top: 0.25rem;
  }
  .seller-list-search__actions .btn {
    width: 100%;
    min-width: 0;
    padding-inline: 0.5rem;
    white-space: nowrap;
  }
  .seller-list-search__block {
    min-width: 0;
  }
  .seller-list-toolbar {
    flex-wrap: nowrap;
  }
  .seller-scope-tabs {
    flex: 1 1 auto;
    min-width: 0;
  }
  .seller-scope-tab {
    flex: 1 1 0;
    min-width: 0;
    padding-inline: 0.5rem;
    font-size: 0.8rem;
  }
  .seller-advanced-toggle {
    flex: 0 0 auto;
  }
  .seller-ticket-card__tools {
    justify-content: flex-start;
  }
  .seller-ticket-card__tools .ticket-more-menu {
    margin-left: auto;
  }
}

.seller-more-tools {
  margin-bottom: 0.85rem;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.seller-more-tools > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.82rem;
  font-weight: 500;
  color: #80868b;
  padding: 0.15rem 0;
}

.seller-more-tools > summary::-webkit-details-marker {
  display: none;
}

.seller-more-tools > summary::after {
  content: " ▾";
  font-size: 0.75em;
  opacity: 0.7;
}

.seller-more-tools[open] > summary::after {
  content: " ▴";
}

.seller-more-tools[open] .seller-admin-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1rem;
  margin-top: 0.35rem;
  padding: 0;
}

.seller-list-hint {
  font-size: 0.82rem;
  color: #80868b;
}

.seller-load-more-wrap {
  margin-top: 0.75rem;
}

.seller-ticket-panel {
  overflow: hidden;
  border: 1px solid #e0e3e7 !important;
  border-radius: 14px !important;
  background: #fff;
  box-shadow: 0 2px 8px rgba(60, 64, 67, 0.08);
}

.seller-ticket-panel > .dash-panel-summary {
  border-bottom: 0 !important;
}

.seller-ticket-panel[open] > .dash-panel-summary {
  border-bottom: 1px solid #eceff1 !important;
}

.seller-ticket-panel > .dash-panel-body {
  padding: 0.75rem 1rem 1rem !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.seller-list-controls {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.seller-list-controls.is-hidden {
  display: none;
}

/* 列表工具列：範圍分段 + 進階篩選入口 */
.seller-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.seller-scope-tabs {
  display: inline-flex;
  padding: 0.2rem;
  border-radius: 999px;
  background: #f1f3f4;
}

.seller-scope-tab {
  border: 0;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  background: transparent;
  color: #5f6368;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.seller-scope-tab.is-active {
  background: #fff;
  color: #1a73e8;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.2);
}

.seller-advanced-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  white-space: nowrap;
}

.seller-advanced-toggle.is-open,
.seller-advanced-toggle.has-filters {
  border-color: #1a73e8;
  color: #1a73e8;
}

.seller-advanced-toggle__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: #1a73e8;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.seller-filter-summary {
  margin: 0 0 0.6rem;
  color: #5f6368;
  font-size: 0.82rem;
}

.seller-list-controls .seller-filter-summary {
  margin-bottom: 0;
}

.seller-empty-state {
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  padding: 1.4rem 0.75rem;
  color: #5f6368;
  text-align: center;
}

.seller-empty-state i {
  color: #9aa0a6;
  font-size: 1.6rem;
}

.seller-empty-state strong {
  color: #3c4043;
}

.seller-empty-state p {
  margin: 0;
  font-size: 0.84rem;
}

.seller-empty-state__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.2rem;
}

.ticket-card-tag--qty {
  margin-left: auto;
  background: #fef7e0;
  color: #b06000;
}

.seller-ticket-card {
  padding: 0.85rem 0.9rem !important;
}

.seller-ticket-card__route {
  font-size: 1.05rem !important;
  margin-bottom: 0.3rem !important;
}

.seller-ticket-card__meta {
  margin-bottom: 0.55rem !important;
  font-size: 0.84rem !important;
}

.seller-admin-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.ticket-card-stack {
  display: grid;
  gap: 0.85rem;
}

.seller-ticket-card {
  background: #fff !important;
  border: 1px solid #e0e3e7 !important;
  border-radius: 14px !important;
  box-shadow: var(--card-shadow) !important;
  padding: 1rem 1.05rem 1.05rem;
  color: #202124;
}

.seller-ticket-card__top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.ticket-card-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #f1f3f4;
  color: #3c4043;
  font-size: 0.75rem;
  font-weight: 600;
}

.ticket-card-tag--seat {
  background: #e8f0fe;
  color: #174ea6;
}

.seller-ticket-card .ticket-card-owner {
  order: 99;
  margin: 0.55rem 0 0;
  padding-top: 0.45rem;
  border-top: 1px solid #f1f3f4;
  color: #80868b !important;
  font-size: 0.78rem;
}

.seller-ticket-card__route {
  margin: 0 0 0.45rem;
  font-size: 1.15rem;
  font-weight: 750;
  color: #202124;
}

.seller-ticket-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.9rem;
  margin: 0 0 0.7rem;
  color: #5f6368;
  font-size: 0.9rem;
}

.seller-ticket-card__meta i {
  margin-right: 0.25rem;
  color: #1a73e8;
}

.seller-ticket-card__status {
  margin-bottom: 0.75rem;
}

.seller-ticket-card {
  display: flex;
  flex-direction: column;
}

.seller-ticket-card__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-top: 0.35rem;
  padding-top: 0.6rem;
  border-top: 1px solid #f1f3f4;
}

.seller-icon-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  min-height: 2.35rem !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: #5f6368 !important;
  box-shadow: none !important;
}

.seller-icon-btn:hover,
.seller-icon-btn:focus-visible {
  background: #f1f3f4 !important;
  color: #202124 !important;
}

.seller-icon-btn--primary {
  color: #1a73e8 !important;
}

.seller-icon-btn--primary:hover,
.seller-icon-btn--primary:focus-visible {
  background: #e8f0fe !important;
  color: #174ea6 !important;
}

.seller-icon-btn--sell {
  color: #e37400 !important;
}

.seller-icon-btn--sell:hover,
.seller-icon-btn--sell:focus-visible {
  background: #fef7e0 !important;
  color: #b06000 !important;
}

.seller-icon-btn--sold {
  color: #137333 !important;
}

.seller-icon-btn--sold:hover,
.seller-icon-btn--sold:focus-visible {
  background: #e6f4ea !important;
  color: #0d652d !important;
}

.seller-icon-btn--ok {
  color: #137333 !important;
}

.seller-icon-btn--danger {
  color: #c5221f !important;
}

.seller-icon-btn--danger:hover,
.seller-icon-btn--danger:focus-visible {
  background: #fce8e6 !important;
  color: #a50e0e !important;
}

/* 卡片操作：常用動作用文字按鈕，其餘收進「更多」 */
.seller-action-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 2.3rem !important;
  padding: 0 0.75rem !important;
  border: 1px solid #dadce0 !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: #3c4043 !important;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  box-shadow: none !important;
  cursor: pointer;
}

.seller-action-btn:hover,
.seller-action-btn:focus-visible {
  background: #f1f3f4 !important;
}

.seller-action-btn--primary {
  border-color: #1a73e8 !important;
  background: #1a73e8 !important;
  color: #fff !important;
}

.seller-action-btn--primary:hover,
.seller-action-btn--primary:focus-visible {
  background: #174ea6 !important;
}

.seller-action-btn--sell {
  border-color: #f9ab00 !important;
  color: #b06000 !important;
}

.seller-action-btn--sell:hover,
.seller-action-btn--sell:focus-visible {
  background: #fef7e0 !important;
}

.seller-action-btn--sold {
  border-color: #a8dab5 !important;
  color: #137333 !important;
}

.seller-action-btn--sold:hover,
.seller-action-btn--sold:focus-visible {
  background: #e6f4ea !important;
}

.seller-action-btn--more {
  width: 2.3rem;
  padding: 0 !important;
  list-style: none;
}

.seller-action-btn--more::-webkit-details-marker {
  display: none;
}

/* 票券列表不可裁切：卡片的「更多」選單需要溢出面板才點得到刪除 */
#ticketListPanel {
  overflow: visible;
}

#ticketListPanel > .dash-panel-summary {
  border-radius: 13px 13px 0 0;
}

#ticketListPanel:not([open]) > .dash-panel-summary {
  border-radius: 13px;
}

#ticketListPanel > .dash-panel-body {
  border-radius: 0 0 13px 13px !important;
}

.ticket-more-menu {
  position: relative;
}

.ticket-more-menu__panel {
  position: absolute;
  z-index: 1200;
  top: calc(100% + 0.35rem);
  right: 0;
  display: grid;
  min-width: 11rem;
  overflow: hidden;
  border: 1px solid #dadce0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(60, 64, 67, 0.2);
}

.ticket-more-menu.is-up .ticket-more-menu__panel {
  top: auto;
  bottom: calc(100% + 0.35rem);
}

.ticket-more-menu__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  border: 0;
  padding: 0.6rem 0.85rem;
  background: transparent;
  color: #3c4043;
  font-size: 0.88rem;
  text-align: left;
  text-decoration: none;
}

.ticket-more-menu__item:hover,
.ticket-more-menu__item:focus-visible {
  background: #f1f3f4;
  color: #202124;
}

.ticket-more-menu__item--danger {
  border-top: 1px solid #f1f3f4;
  color: #c5221f;
}

.ticket-more-menu__item--danger:hover,
.ticket-more-menu__item--danger:focus-visible {
  background: #fce8e6;
  color: #a50e0e;
}

.ticket-card-tag--owner {
  background: #fef7e0;
  color: #8a5a00;
}

.ticket-card-tag--owner i {
  margin-right: 0.2rem;
}

.seller-ticket-table-wrap {
  margin-top: 0.5rem;
}

.seller-ticket-table thead th {
  background: #f8f9fa;
  color: #3c4043;
  border-bottom: 1px solid #e0e3e7;
  font-weight: 600;
  white-space: nowrap;
}

.seller-copy-toast {
  position: fixed;
  left: 50%;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(120%);
  z-index: 2000;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  background: #202124;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(32, 33, 36, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.seller-copy-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.seller-manual-copy-panel {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.seller-manual-copy-panel.is-visible {
  display: flex;
}

.seller-manual-copy-panel__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.seller-manual-copy-panel__sheet {
  position: relative;
  width: min(100%, 34rem);
  max-height: min(82vh, 36rem);
  margin: 0;
  padding: 1rem 1rem max(1rem, env(safe-area-inset-bottom));
  border-radius: 1rem 1rem 0 0;
  background: #fff;
  box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.seller-manual-copy-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.seller-manual-copy-panel__ta {
  width: 100%;
  min-height: 11rem;
  flex: 1 1 auto;
  resize: vertical;
  border: 1px solid #d7dde5;
  border-radius: 0.65rem;
  padding: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.5;
  -webkit-user-select: text;
  user-select: text;
}

.seller-manual-copy-panel__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

@media (min-width: 768px) {
  .seller-manual-copy-panel {
    align-items: center;
  }
  .seller-manual-copy-panel__sheet {
    border-radius: 1rem;
    margin: 1rem;
  }
}

@media (min-width: 1200px) {
  .ticket-card-stack {
    display: none;
  }
  .seller-ticket-table-wrap {
    display: block !important;
  }
}


.alert {
  border-radius: 10px !important;
  border-width: 1px !important;
}

.line-group-alert {
  border: 1px solid #c6dafc !important;
  background: #e8f0fe !important;
  box-shadow: none !important;
}

/* Query mobile card simplified */
@media (max-width: 767.98px) {
  .query-container {
    margin: 0.75rem 0;
    padding: 1rem;
    border-radius: 12px !important;
  }

  .query-step__control,
  .query-step__actions--end {
    max-width: none;
    width: 100%;
  }

  .query-step__actions--end {
    justify-content: stretch;
  }

  .query-step__actions .btn,
  .query-step__actions .query-next-btn {
    width: 100%;
    min-width: 0;
  }

  .mobile-card .ticket-mobile-card,
  body.thsr-app--query .mobile-card .ticket-mobile-card {
    background: #fff !important;
    border: 1px solid #e0e3e7 !important;
    border-radius: 12px !important;
    box-shadow: var(--card-shadow) !important;
    transform: none !important;
  }

  .mobile-card .ticket-mobile-card-main,
  .mobile-card .ticket-mobile-card-cta {
    background: #fff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .mobile-card .ticket-mobile-card-cta {
    border-top: 0 !important;
    padding: 0.55rem 1rem 1rem !important;
    gap: 0.35rem !important;
  }

  .ticket-mobile-photo-wrap,
  .ticket-mobile-photo-placeholder {
    background: #f8f9fa !important;
  }

  body.thsr-app--query .mobile-card .btn-buy.btn-buy--myship {
    margin-top: 0.6rem;
    background: #1a73e8 !important;
    border-color: #1a73e8 !important;
    color: #fff !important;
    box-shadow: none !important;
  }

  .mobile-card .myship-fallback-btn {
    color: #5f6368 !important;
    text-decoration: none !important;
    border: 0 !important;
    font-size: 0.8rem !important;
    padding: 0.2rem 0 0 !important;
  }
}

/* Admin OCR / OAuth visual tune: blue and clear */
body.thsr-app--admin .alert-warning,
body.thsr-app--admin #ocrGapBanner {
  background: #e8f0fe !important;
  border: 1px solid #c6dafc !important;
  color: #1a73e8 !important;
}

body.thsr-app--admin #ocrGapBanner strong,
body.thsr-app--admin #ocrGapBanner i {
  color: #1967d2 !important;
}

/* 「解除」按鈕改藍底白字（避免灰色突兀） */
body.thsr-app--admin .btn-oauth-disconnect {
  background: #1a73e8 !important;
  border-color: #1a73e8 !important;
  color: #fff !important;
}

body.thsr-app--admin .btn-oauth-disconnect:hover {
  background: #1967d2 !important;
  border-color: #1967d2 !important;
  color: #fff !important;
}

/* 輸入模式按鈕（含「手動輸入」）統一藍系 */
body.thsr-app--admin .entry-mode-block .btn-outline-secondary {
  background: #fff !important;
  border-color: #1a73e8 !important;
  color: #1a73e8 !important;
}

body.thsr-app--admin .entry-card .btn-check:checked + .btn,
body.thsr-app--admin .entry-mode-block .btn-outline-secondary:hover {
  background: #1a73e8 !important;
  border-color: #1a73e8 !important;
  color: #fff !important;
}

/* ==========================================================================
   Unified Button System (Google-like, consistent across pages)
   ========================================================================== */
.thsr-app .btn {
  border-radius: 10px !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  min-height: 40px;
  padding: 0.5rem 1rem;
  border-width: 1px !important;
  box-shadow: none !important;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.thsr-app .btn-sm {
  min-height: 32px;
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem;
}

.thsr-app .btn-primary,
.thsr-app .btn-success,
.thsr-app .btn-info,
.thsr-app .btn-login,
.thsr-app .btn-add-ticket,
.thsr-app .btn-oauth-disconnect,
.thsr-app .modal-btn-confirm {
  background: #1a73e8 !important;
  border-color: #1a73e8 !important;
  color: #fff !important;
}

.thsr-app .btn-primary:hover,
.thsr-app .btn-success:hover,
.thsr-app .btn-info:hover,
.thsr-app .btn-login:hover,
.thsr-app .btn-add-ticket:hover,
.thsr-app .btn-oauth-disconnect:hover,
.thsr-app .modal-btn-confirm:hover {
  background: #1967d2 !important;
  border-color: #1967d2 !important;
  color: #fff !important;
  transform: none !important;
}

.thsr-app .btn-outline-secondary,
.thsr-app .btn-outline-success,
.thsr-app .btn-outline-warning,
.thsr-app .btn-outline-info,
.thsr-app .btn-outline-light,
.thsr-app .btn-nav-secondary,
.thsr-app .btn-logout,
.thsr-app .modal-btn-cancel {
  background: #fff !important;
  border-color: #dadce0 !important;
  color: #3c4043 !important;
}

.thsr-app .btn-outline-secondary:hover,
.thsr-app .btn-outline-success:hover,
.thsr-app .btn-outline-warning:hover,
.thsr-app .btn-outline-info:hover,
.thsr-app .btn-outline-light:hover,
.thsr-app .btn-nav-secondary:hover,
.thsr-app .btn-logout:hover,
.thsr-app .modal-btn-cancel:hover {
  background: #e8f0fe !important;
  border-color: #c6dafc !important;
  color: #1a73e8 !important;
  transform: none !important;
}

/* Entry mode checked state should match primary buttons */
.thsr-app .entry-card .btn-check:checked + .btn {
  background: #1a73e8 !important;
  border-color: #1a73e8 !important;
  color: #fff !important;
}

/* OCR 缺欄提示：提高可讀性（高對比） */
body.thsr-app--admin #ocrGapBanner.alert,
body.thsr-app--admin #ocrGapBanner.alert-warning {
  background: #eaf2ff !important;
  border: 1px solid #8ab4f8 !important;
  border-left: 4px solid #1a73e8 !important;
  color: #174ea6 !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  line-height: 1.55 !important;
}

body.thsr-app--admin #ocrGapBanner * {
  color: inherit !important;
}

body.thsr-app--admin #ocrGapBanner.ocr-gap-banner--info {
  background: #eaf2ff !important;
  border: 1px solid #8ab4f8 !important;
  border-left: 4px solid #1a73e8 !important;
  color: #174ea6 !important;
}

body.thsr-app--admin #ocrGapBanner.ocr-gap-banner--error {
  background: #fdecec !important;
  border: 1px solid #f6b9b9 !important;
  border-left: 4px solid #d93025 !important;
  color: #9b1c1c !important;
}

body.thsr-app--admin #ocrGapBanner,
body.thsr-app--admin #ocrGapBanner * {
  opacity: 1 !important;
  filter: none !important;
  text-shadow: none !important;
}

/* Admin alerts: 統一可讀風格（覆蓋舊版粉紅 alert） */
body.thsr-app--admin .alert {
  background: #f8f9fa !important;
  border: 1px solid #e0e3e7 !important;
  color: #3c4043 !important;
}

body.thsr-app--admin .alert-secondary,
body.thsr-app--admin .ocr-verify-note {
  background: #eaf2ff !important;
  border: 1px solid #c6dafc !important;
  color: #174ea6 !important;
}

body.thsr-app--admin .ocr-verify-note i,
body.thsr-app--admin .ocr-verify-note strong {
  color: #174ea6 !important;
}

/* OCR 缺欄提示：即使未套 JS class 也保持高對比藍色 */
body.thsr-app--admin #ocrGapBanner {
  background: #eaf2ff !important;
  border: 1px solid #8ab4f8 !important;
  border-left: 4px solid #1a73e8 !important;
  color: #174ea6 !important;
}

/* Query guided search */
.query-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 320px;
  margin: 0 auto 0.65rem;
}

.query-progress__dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 1px solid #dadce0;
  border-radius: 50%;
  background: #fff;
  color: #80868b;
  font-size: 0.85rem;
  font-weight: 700;
  transition: 0.2s ease;
}

.query-progress__dot.is-active,
.query-progress__dot.is-complete {
  border-color: #1a73e8;
  background: #1a73e8;
  color: #fff;
}

.query-progress__line {
  width: 72px;
  height: 2px;
  background: #dadce0;
}

.query-step[hidden] {
  display: none !important;
}

#queryForm {
  overflow: hidden;
}

.query-step {
  max-width: 620px;
  min-height: 270px;
  margin: 0 auto;
  text-align: center;
}

.query-step.is-leave-forward {
  animation: queryStepLeaveForward 0.28s ease forwards;
}

.query-step.is-leave-back {
  animation: queryStepLeaveBack 0.28s ease forwards;
}

.query-step.is-enter-forward {
  opacity: 0;
  transform: translateX(32px);
}

.query-step.is-enter-back {
  opacity: 0;
  transform: translateX(-32px);
}

.query-step.is-enter-forward.is-enter-done,
.query-step.is-enter-back.is-enter-done {
  transition: opacity 0.34s ease, transform 0.34s ease;
  opacity: 1;
  transform: translateX(0);
}

@keyframes queryStepLeaveForward {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-28px); }
}

@keyframes queryStepLeaveBack {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(28px); }
}

@media (prefers-reduced-motion: reduce) {
  .query-step.is-leave-forward,
  .query-step.is-leave-back,
  .query-step.is-enter-forward,
  .query-step.is-enter-back,
  .query-step.is-enter-forward.is-enter-done,
  .query-step.is-enter-back.is-enter-done {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

.query-step__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 0.75rem;
  border-radius: 16px;
  background: #e8f0fe;
  color: #1a73e8;
  font-size: 1.45rem;
  line-height: 1;
}

.query-step__title {
  margin-bottom: 0.35rem;
  color: #202124;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 750;
}

.query-step__hint {
  margin-bottom: 1.5rem;
  color: #5f6368;
}

.query-date-range-hint {
  margin: 0.55rem auto 0;
  max-width: 360px;
  text-align: center;
  font-size: 0.86rem;
  color: #174ea6;
  font-weight: 600;
}

@media (max-width: 767.98px) {
  .query-date-range-hint {
    max-width: none;
  }
}

.query-step__control {
  max-width: 360px;
  min-height: 52px;
  margin: 0 auto;
}

.query-quick-options,
.query-popular-routes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.query-popular-routes > span {
  color: #5f6368;
  font-size: 0.85rem;
}

.query-quick-chip,
.query-route-chip {
  min-height: 36px;
  padding: 0.35rem 0.75rem;
  border: 1px solid #dadce0;
  border-radius: 999px;
  background: #fff;
  color: #3c4043;
  font-size: 0.85rem;
  transition: 0.15s ease;
}

.query-quick-chip:hover,
.query-route-chip:hover,
.query-quick-chip.is-selected,
.query-route-chip.is-selected {
  border-color: #1a73e8;
  background: #e8f0fe;
  color: #174ea6;
}

.query-route-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 1rem;
  text-align: left;
}

.query-route-fields .form-select {
  min-height: 52px;
}

.query-route-swap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 0.3rem;
  border: 1px solid #dadce0;
  border-radius: 50%;
  background: #fff;
  color: #1a73e8;
  transition: 0.15s ease;
}

.query-route-swap:hover {
  border-color: #1a73e8;
  background: #e8f0fe;
}

.query-type-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: 520px;
  margin: 0 auto;
}

.query-type-option {
  position: relative;
  cursor: pointer;
}

.query-type-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.query-type-option > span {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 112px;
  padding: 1rem;
  border: 2px solid #dadce0;
  border-radius: 14px;
  background: #fff;
  transition: 0.18s ease;
}

.query-type-option strong {
  color: #202124;
  font-size: 1.15rem;
}

.query-type-option small {
  margin-top: 0.3rem;
  color: #5f6368;
}

.query-type-option input:checked + span {
  border-color: #1a73e8;
  background: #e8f0fe;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

.query-type-option input:focus-visible + span {
  outline: 3px solid rgba(26, 115, 232, 0.28);
  outline-offset: 2px;
}

.query-step__actions {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.query-step__actions--end {
  justify-content: flex-end;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.query-step__actions .btn {
  min-width: 132px;
  min-height: 46px;
}

.query-results-head {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid #e0e3e7;
  border-radius: 12px;
  background: #fff;
}

.query-results-head__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.query-results-count,
.query-results-filter {
  margin: 0;
}

.query-results-count {
  color: #202124;
  font-size: 0.95rem;
  white-space: nowrap;
}

.query-results-count strong {
  font-size: 1.35rem;
  line-height: 1;
  color: #1a73e8;
}

.query-results-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.7rem;
}

.query-results-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.6rem;
  border: 1px solid #e0e3e7;
  border-radius: 999px;
  background: #f8f9fa;
  color: #3c4043;
  font-size: 0.82rem;
  white-space: nowrap;
}

.query-results-chip .bi {
  color: #80868b;
  font-size: 0.85em;
}

.query-results-chip--price {
  border-color: #f5c2c0;
  background: #fce8e6;
  color: #c5221f;
  font-weight: 700;
}

.query-results-chip--price .bi {
  color: #c5221f;
}

.query-results-filter {
  margin-top: 0.6rem;
  color: #5f6368;
  font-size: 0.82rem;
}

.query-result-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.query-result-kind-filter {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.2rem;
  border-radius: 10px;
  background: #f1f3f4;
}

.query-result-kind-filter button {
  padding: 0.36rem 0.62rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #5f6368;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.query-result-kind-filter button.is-active {
  background: #fff;
  color: #1a73e8;
  box-shadow: 0 1px 4px rgba(60, 64, 67, 0.18);
}

.query-result-kind-filter button:disabled {
  opacity: 0.42;
}

.query-result-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #5f6368;
  font-size: 0.8rem;
  white-space: nowrap;
}

.query-result-sort select {
  padding: 0.34rem 1.6rem 0.34rem 0.5rem;
  border: 1px solid #dadce0;
  border-radius: 8px;
  background-color: #fff;
  color: #3c4043;
  font-size: 0.8rem;
}

.query-filter-empty {
  padding: 2rem 1rem;
  border: 1px dashed #dadce0;
  border-radius: 12px;
  color: #5f6368;
  text-align: center;
}

.query-results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.query-result-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: 1rem;
  border: 1px solid #e0e3e7;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(60, 64, 67, 0.08);
}

.query-result-card__title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #202124;
  font-size: 1.08rem;
}

.query-result-card__title .bi {
  color: #5f6368;
}

.query-result-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  margin-top: 0.65rem;
  color: #5f6368;
  font-size: 0.86rem;
}

.query-result-card__type {
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #e8f0fe;
  color: #174ea6;
  font-weight: 600;
}

.query-result-card__stock {
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #f1f3f4;
  color: #5f6368;
  font-weight: 600;
}

.query-result-card__stock.is-low {
  background: #fce8e6;
  color: #c5221f;
}

.query-result-card__actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  margin-top: 1rem;
}

.query-result-card__actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  font-size: 0.86rem;
}

.ticket-detail-summary {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.85rem;
  color: #202124;
}

.ticket-detail-summary span {
  color: #5f6368;
  font-size: 0.88rem;
}

.ticket-detail-reminder {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.75rem;
  border-radius: 9px;
  background: #e8f0fe;
  color: #174ea6;
  font-size: 0.82rem;
  line-height: 1.45;
}

.ticket-detail-image-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  max-height: 58vh;
  overflow: hidden;
  border: 1px solid #e0e3e7;
  border-radius: 12px;
  background: #f8f9fa;
}

.ticket-detail-image-loading {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #5f6368;
}

.ticket-detail-image {
  display: none;
  width: 100%;
  max-height: 58vh;
  object-fit: contain;
  cursor: zoom-in;
}

body.thsr-app--query .page-header {
  max-width: 660px;
  margin: 0 auto 1.25rem;
  padding: 0;
}

body.thsr-app--admin .upload-shell {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

body.thsr-app--admin .page-header {
  max-width: 660px;
  margin: 0 auto 1.25rem;
  padding: 0;
  text-align: center;
}

body.thsr-app--admin .page-title {
  margin-bottom: 0.35rem;
  font-size: clamp(1.8rem, 4vw, 2.35rem);
}

body.thsr-app--admin .page-subtitle {
  font-size: 0.98rem;
  color: #5f6368;
}

body.thsr-app--admin .upload-shell .search-card.entry-card {
  max-width: none;
  margin: 0 auto 1.25rem;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

body.thsr-app--admin .upload-shell .search-card.entry-card .card-body {
  padding: 0 !important;
}

body.thsr-app--admin .upload-tools {
  max-width: none;
  margin: 0;
}

body.thsr-app--query .page-title {
  margin-bottom: 0.35rem;
  font-size: clamp(1.8rem, 4vw, 2.35rem);
}

body.thsr-app--query .search-card {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

body.thsr-app--query .search-card.is-collapsed {
  display: none;
}

body.thsr-app--query .search-card__head {
  margin-bottom: 1.1rem;
  padding-bottom: 0.85rem;
}

.empty-state__icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 1rem !important;
  border-radius: 20px;
  background: #e8f0fe;
  color: #1a73e8;
  font-size: 1.75rem !important;
  opacity: 1 !important;
  animation: none !important;
}

.empty-state__notice {
  max-width: 520px;
  margin: 1rem auto 0 !important;
  color: #80868b !important;
  font-size: 0.82rem !important;
}

body.preorder-open {
  overflow: hidden;
}

.preorder-drawer {
  position: fixed;
  z-index: 1100;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  visibility: hidden;
  pointer-events: none;
}

.preorder-drawer.is-open {
  visibility: visible;
  pointer-events: auto;
}

.preorder-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(32, 33, 36, 0);
  transition: background 0.22s ease;
}

.preorder-drawer.is-open .preorder-drawer__backdrop {
  background: rgba(32, 33, 36, 0.42);
}

.preorder-drawer__panel {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(720px, 100%);
  height: 100%;
  background: #fff;
  box-shadow: -16px 0 48px rgba(32, 33, 36, 0.18);
  transform: translateX(100%);
  transition: transform 0.24s cubic-bezier(0.2, 0, 0, 1);
}

.preorder-drawer.is-open .preorder-drawer__panel {
  transform: translateX(0);
}

.preorder-drawer__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid #e8eaed;
}

.preorder-drawer__eyebrow {
  margin: 0 0 0.2rem;
  color: #1a73e8;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.preorder-drawer__header h2 {
  margin: 0;
  color: #202124;
  font-size: 1.25rem;
}

.preorder-drawer__header p:last-child {
  margin: 0.25rem 0 0;
  color: #5f6368;
  font-size: 0.85rem;
}

.preorder-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 0;
  border-radius: 50%;
  background: #f1f3f4;
  color: #3c4043;
}

.preorder-drawer__body {
  position: relative;
  min-height: 0;
  background: #f8f9fa;
}

.preorder-drawer__loading {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  color: #5f6368;
}

.preorder-drawer iframe {
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.preorder-drawer__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid #e8eaed;
  color: #5f6368;
  font-size: 0.8rem;
}

.preorder-drawer__footer a {
  flex-shrink: 0;
  color: #1a73e8;
  font-weight: 600;
  text-decoration: none;
}

@media (max-width: 575.98px) {
  body.thsr-app--admin .upload-shell {
    padding: 1rem 0.75rem;
  }

  body.thsr-app--admin .entry-page-heading .page-title {
    font-size: 1.65rem;
  }

  body.thsr-app--admin .entry-page-heading .page-subtitle {
    font-size: 0.86rem;
  }

  .entry-gate {
    max-width: 100%;
  }

  .entry-process-progress {
    margin-bottom: 0.7rem;
    padding-inline: 0.5rem;
  }

  .entry-process-progress li small {
    font-size: 0.64rem;
  }

  .seller-ticket-panel > .dash-panel-body {
    padding: 0.65rem 0.75rem 0.8rem !important;
  }

  .query-step {
    min-height: 310px;
  }

  .query-route-fields {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .query-route-swap {
    margin: -0.15rem auto;
    transform: rotate(90deg);
  }

  .query-type-options {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .query-type-option > span {
    min-height: 82px;
  }

  .query-step__actions .btn {
    min-width: 0;
    flex: 1;
  }

  .query-results-chip {
    font-size: 0.8rem;
  }

  .query-results-head {
    padding: 0.72rem 0.78rem;
  }

  .query-result-tools {
    align-items: stretch;
    flex-direction: column;
    gap: 0.55rem;
  }

  .query-result-kind-filter {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .query-result-kind-filter button {
    min-width: 0;
    padding-inline: 0.35rem;
  }

  .query-result-sort {
    justify-content: flex-end;
  }

  .query-results-grid {
    grid-template-columns: 1fr;
  }

  .query-result-card__actions {
    grid-template-columns: 1fr;
  }

  .preorder-drawer__header {
    padding: 0.9rem 1rem;
  }

  .preorder-drawer__footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.65rem 1rem;
  }
}

/* 編輯票券：並排票根預覽 */
.edit-ticket-modal .modal-body {
  padding-top: 1rem;
}

.edit-photo-pane {
  position: sticky;
  top: 0.5rem;
}

.edit-photo-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #5f6368;
  margin-bottom: 0.45rem;
}

.edit-photo-frame {
  border: 1px solid #dadce0;
  border-radius: 12px;
  background: #f8f9fa;
  overflow: hidden;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.edit-photo-img {
  display: block;
  width: 100%;
  max-height: min(58vh, 420px);
  object-fit: contain;
  background: #111;
}

.edit-photo-empty {
  border: 2px dashed #dadce0;
  border-radius: 12px;
  background: #f8f9fa;
  text-align: center;
  padding: 1.75rem 1rem;
  color: #5f6368;
}

@media (max-width: 991.98px) {
  .edit-photo-pane {
    position: static;
  }

  .edit-photo-img {
    max-height: 240px;
  }
}

/* 新增票根：步驟與並排工作區 */
.entry-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.entry-step {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #80868b;
  font-size: 0.875rem;
  font-weight: 600;
}

.entry-step-num {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e8eaed;
  color: #5f6368;
  font-size: 0.75rem;
}

.entry-step.is-active {
  color: #174ea6;
}

.entry-step.is-active .entry-step-num {
  background: #1a73e8;
  color: #fff;
}

.entry-step.is-done {
  color: #137333;
}

.entry-step.is-done .entry-step-num {
  background: #ceead6;
  color: #137333;
}

.entry-await-photo {
  border: 0;
  border-radius: 10px;
  background: #f1f3f4;
  color: #5f6368;
  padding: 0.7rem 0.85rem;
  font-size: 0.875rem;
}

.entry-analyze-progress {
  border: 1px solid #d2e3fc;
  background: #e8f0fe;
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  color: #174ea6;
}

.entry-ticket-preview {
  max-height: 280px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.2);
}

/* ---------- 混合登錄：gate + 5001 分步 / OCR 一頁核對 ---------- */

.entry-card--wizard .entry-page-header {
  border-bottom: 0;
  margin-bottom: 0.85rem;
  padding-bottom: 0;
}

.entry-card--wizard .entry-page-title {
  font-size: 1.2rem;
}

.entry-gate {
  max-width: 28rem;
  margin: 0 auto;
}

.entry-page-heading {
  margin-bottom: 0.8rem !important;
  padding-bottom: 0 !important;
}

.entry-page-heading__title {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.entry-page-heading__title .page-title {
  margin: 0 !important;
}

.entry-ai-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.22rem 0.5rem;
  border: 1px solid #c6dafc;
  border-radius: 999px;
  background: #e8f0fe;
  color: #174ea6;
  font-size: 0.75rem;
  font-weight: 600;
}

.entry-page-heading .page-subtitle {
  margin: 0.35rem 0 0;
}

.entry-manual-start {
  min-height: 2.85rem;
  border: 1px solid #8ab4f8 !important;
  font-weight: 600;
  color: #174ea6 !important;
  border-radius: 12px;
}

.entry-manual-start:hover,
.entry-manual-start:focus-visible {
  background: #e8f0fe !important;
}

.entry-process-progress {
  max-width: 38rem;
  margin: 0 auto 0.85rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #d2e3fc;
  border-radius: 12px;
  background: #f8fbff;
}

.entry-process-progress ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.entry-process-progress li {
  position: relative;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 0.2rem;
  color: #9aa0a6;
  text-align: center;
}

.entry-process-progress li:not(:last-child)::after {
  position: absolute;
  top: 0.75rem;
  left: calc(50% + 0.85rem);
  width: calc(100% - 1.4rem);
  height: 2px;
  background: #dadce0;
  content: '';
}

.entry-process-progress li span {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #e8eaed;
  font-size: 0.72rem;
  font-weight: 700;
}

.entry-process-progress li small {
  font-size: 0.7rem;
  white-space: nowrap;
}

.entry-process-progress li.is-active,
.entry-process-progress li.is-complete {
  color: #174ea6;
  font-weight: 600;
}

.entry-process-progress li.is-active span {
  background: #1a73e8;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.14);
}

.entry-process-progress li.is-complete span {
  background: #d2e3fc;
  color: #174ea6;
}

.entry-process-progress li.is-complete:not(:last-child)::after {
  background: #8ab4f8;
}

.entry-process-progress li.is-error span {
  background: #d93025;
  color: #fff;
}

.entry-process-progress > p {
  margin: 0.45rem 0 0;
  color: #5f6368;
  font-size: 0.78rem;
  text-align: center;
}

.entry-owner-wrap,
.entry-step-fields {
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.entry-step-fields {
  max-width: 420px;
}

.entry-title--review {
  display: none;
}

.entry-fields--review {
  max-width: 560px;
  margin: 0 auto;
}

.entry-fields--review .entry-wiz-step {
  max-width: none;
  min-height: 0 !important;
  text-align: left;
  margin: 0 0 0.45rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #eef0f2;
  animation: none;
}

.entry-fields--review .entry-wiz-step:last-of-type {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.entry-fields--review .query-step__icon,
.entry-fields--review .query-step__hint,
.entry-fields--review .query-quick-options,
.entry-fields--review .query-popular-routes {
  display: none !important;
}

.entry-fields--review .entry-title--wiz {
  display: none;
}

.entry-fields--review .entry-title--review {
  display: inline;
}

.entry-fields--review .query-step__title {
  font-size: 0.78rem;
  font-weight: 650;
  margin-bottom: 0.3rem;
  text-align: left;
  color: #5f6368;
  letter-spacing: 0.02em;
}

.entry-fields--review .form-label {
  margin-bottom: 0.2rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #80868b;
}

.entry-fields--review .query-step__control,
.entry-fields--review .entry-owner-wrap,
.entry-fields--review .entry-step-fields {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.entry-fields--review .form-control-lg,
.entry-fields--review .form-select-lg,
.entry-fields--review .entry-touch-input,
.entry-fields--review .query-step__control {
  min-height: 2.4rem !important;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  font-size: 0.95rem !important;
  border-radius: 10px;
}

.entry-fields--review .entry-owner-wrap {
  margin-top: 0.45rem !important;
}

.entry-fields--review .entry-step-fields.row,
.entry-fields--review .row.g-3 {
  --bs-gutter-x: 0.55rem;
  --bs-gutter-y: 0.45rem;
}

.entry-fields--review .mt-3 {
  margin-top: 0.45rem !important;
}

.entry-fields--review .query-route-fields {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
  gap: 0.4rem !important;
  align-items: end;
  text-align: left;
}

.entry-fields--review .query-route-swap {
  width: 2.2rem;
  height: 2.2rem;
  margin: 0 0 0.1rem !important;
  transform: none !important;
  font-size: 0.95rem;
}

.entry-fields--review .query-type-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 0.4rem !important;
  max-width: none;
  margin: 0.4rem 0 0;
  justify-content: stretch;
}

.entry-fields--review .query-type-option > span {
  min-height: 0 !important;
  padding: 0.5rem 0.3rem;
  border-width: 1.5px;
  border-radius: 10px;
  align-items: center;
  text-align: center;
}

.entry-fields--review .query-type-option strong {
  font-size: 0.9rem;
}

.entry-fields--review .query-type-option small {
  display: none;
}

.entry-fields--review .query-type-option input:checked + span {
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.14);
}

.entry-card--wizard.is-ocr-review #ocrPhotoPanel {
  margin-bottom: 0.65rem !important;
}

.entry-card--wizard.is-ocr-review .entry-inline-note {
  margin-top: 0.35rem !important;
  padding: 0.45rem 0.65rem;
  font-size: 0.8rem;
}

.entry-card--wizard.is-ocr-review .entry-submit-bar {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
}

.entry-card--wizard.is-ocr-review .entry-submit-main {
  min-height: 2.75rem;
  font-size: 1rem;
}

.upload-shell > .page-header.is-ocr-review {
  margin-bottom: 0.55rem;
}

.upload-shell > .page-header.is-ocr-review .page-title {
  font-size: 1.2rem;
  margin-bottom: 0.15rem;
}

.upload-shell > .page-header.is-ocr-review .page-subtitle {
  display: none;
}

body.entry-ocr-review.has-entry-photo-dock #entryFieldsCol {
  padding-bottom: 4.5rem;
}

.entry-inline-note {
  font-size: 0.875rem;
  color: #174ea6;
  background: #e8f0fe;
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
}

.entry-capture-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.entry-capture-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 12px;
  border: 1.5px solid transparent;
  -webkit-tap-highlight-color: transparent;
}

.entry-capture-btn--cam {
  background: #1a73e8;
  color: #fff;
}

.entry-capture-btn--cam:hover,
.entry-capture-btn--cam:focus {
  background: #1765cc;
  color: #fff;
}

.entry-capture-btn--album {
  background: #fff;
  color: #174ea6;
  border-color: #8ab4f8;
}

.entry-capture-btn--album:hover,
.entry-capture-btn--album:focus {
  background: #e8f0fe;
  color: #174ea6;
}

.entry-touch-input {
  min-height: 2.85rem;
  font-size: 1rem !important;
}

.entry-submit-bar {
  position: static;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #e8eaed;
}

.entry-submit-main {
  width: 100% !important;
  max-width: none !important;
  min-height: 3.15rem;
  font-size: 1.05rem;
  border-radius: 12px;
  display: block !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.entry-switch-link {
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  color: #1a73e8 !important;
  padding: 0.35rem !important;
  min-height: auto !important;
}

.entry-status-line {
  font-size: 0.8125rem;
  color: #5f6368;
}

#photoInput.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.ocr-photo-panel.is-collapsed #ocrPreviewRow,
.ocr-photo-panel.is-collapsed #ocrAnalyzeProgress {
  display: none !important;
}

.entry-photo-dock {
  position: fixed;
  left: 50%;
  bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 1080;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  max-width: calc(100vw - 1.5rem);
  padding: 0.35rem 0.45rem 0.35rem 0.35rem;
  border-radius: 999px;
  background: rgba(32, 33, 36, 0.94);
  color: #fff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

.entry-photo-dock-hit {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  min-width: 0;
  text-align: left;
  cursor: pointer;
}

.entry-photo-dock-hit img {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  background: #5f6368;
  flex-shrink: 0;
}

.entry-photo-dock-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-right: 0.25rem;
}

.entry-photo-dock-text strong {
  font-size: 0.9rem;
  line-height: 1.2;
}

.entry-photo-dock-text small {
  font-size: 0.72rem;
  opacity: 0.75;
}

.entry-photo-dock-close {
  filter: invert(1);
  opacity: 0.75;
  padding: 0.5rem;
  margin: 0 0.15rem;
}

body.has-entry-photo-dock #entryFieldsCol {
  padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
}

.entry-photo-sheet {
  position: fixed;
  inset: 0;
  z-index: 1090;
}

.entry-photo-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.entry-photo-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(88vh, 720px);
  padding: 0.85rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  border-radius: 16px 16px 0 0;
  background: #fff;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.entry-photo-sheet-img {
  display: block;
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 10px;
  background: #f1f3f4;
}

body.entry-photo-sheet-open {
  overflow: hidden;
}

@media (min-width: 992px) {
  .entry-photo-dock,
  #entryTogglePhotoBtn {
    display: none !important;
  }

  .entry-submit-main {
    width: auto !important;
    min-width: min(100%, 14rem);
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .entry-fields--review .query-step__actions .entry-submit-main,
  #entryOcrSubmitBar .entry-submit-main {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}


/* 批次審核票根 */
.batch-inbox-cards {
  display: grid;
  gap: 0.85rem;
}
.batch-inbox-card {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #e0e3e7;
  border-radius: 12px;
  background: #fff;
}
.batch-inbox-thumb {
  display: block;
  width: 7.5rem;
  height: 7.5rem;
  object-fit: cover;
  border-radius: 8px;
  background: #f1f3f4;
  text-align: center;
  line-height: 7.5rem;
  font-size: 0.8rem;
  color: #5f6368;
  text-decoration: none;
}
.batch-inbox-card__name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  word-break: break-all;
}
.batch-inbox-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.45rem;
}
.batch-inbox-fields label {
  display: grid;
  gap: 0.15rem;
  font-size: 0.72rem;
  color: #5f6368;
}
.batch-inbox-fields input,
.batch-inbox-fields select {
  min-height: 2rem;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 0.2rem 0.4rem;
  font-size: 0.85rem;
}
.batch-inbox-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  font-size: 0.86rem;
}
.batch-inbox-choice.is-ok { color: #137333; font-weight: 600; }
.batch-inbox-choice.is-bad { color: #c5221f; font-weight: 600; }
@media (max-width: 575.98px) {
  .batch-inbox-card {
    grid-template-columns: 1fr;
  }
  .batch-inbox-thumb {
    width: 100%;
    height: 10rem;
  }
}

/* 管理員工具列：圖示為主 */
.admin-icon-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.admin-icon-tool {
  display: inline-flex !important;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0.4rem 0.9rem !important;
  border-radius: 999px !important;
  font-weight: 600;
}
.admin-icon-tool i {
  font-size: 1.1rem;
  line-height: 1;
}
.admin-match-simple {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  max-width: 38rem;
  margin: 0 auto;
  text-align: center;
}
.admin-match-simple p {
  max-width: 34rem;
  margin-inline: auto;
}
.admin-canned-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.admin-canned-card {
  border: 1px solid #e2e6ea;
  border-radius: 0.5rem;
  background: #fafbfc;
  padding: 0.65rem 0.75rem;
}
.admin-canned-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.admin-canned-card pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.78rem;
  line-height: 1.45;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #202124;
}

/* 管理者：導覽列下方功能列 */
.admin-manage-rail {
  position: sticky;
  top: 0;
  z-index: 1030;
  margin: -0.35rem auto 0.85rem;
  padding: 0;
}
.admin-manage-rail__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: 14px;
  background: linear-gradient(180deg, #f3f8ff 0%, #eef4ff 100%);
  box-shadow: inset 0 0 0 1px #d2e3fc, 0 4px 14px rgba(26, 115, 232, 0.08);
}
.admin-manage-rail__label {
  flex: 0 0 auto;
  margin-right: 0.15rem;
  padding: 0 0.35rem;
  color: #1a73e8;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.admin-rail-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 2.1rem;
  padding: 0.28rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #fff;
  color: #3c4043;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.admin-rail-chip i {
  font-size: 1rem;
  color: #1a73e8;
}
.admin-rail-chip:hover,
.admin-rail-chip:focus-visible {
  border-color: #c6dafc;
  background: #e8f0fe;
  outline: none;
}
.admin-rail-chip.is-active {
  border-color: #1a73e8;
  background: #1a73e8;
  color: #fff;
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.28);
}
.admin-rail-chip.is-active i {
  color: #fff;
}
.admin-rail-more {
  position: relative;
  margin-left: auto;
}
.admin-rail-more > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 2.1rem;
  padding: 0.28rem 0.7rem;
  border: 1px solid #dadce0;
  border-radius: 999px;
  background: #fff;
  color: #5f6368;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.admin-rail-more > summary::-webkit-details-marker {
  display: none;
}
.admin-rail-more[open] > summary {
  border-color: #1a73e8;
  color: #1a73e8;
  background: #e8f0fe;
}
.admin-rail-more__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 20;
  display: grid;
  min-width: 9.5rem;
  padding: 0.35rem;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(32, 33, 36, 0.16), 0 0 0 1px rgba(60, 64, 67, 0.08);
}
.admin-rail-more__menu a,
.admin-rail-more__menu button {
  display: block;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #202124;
  font-size: 0.86rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.admin-rail-more__menu a:hover,
.admin-rail-more__menu button:hover {
  background: #f1f3f4;
}
.admin-manage-workspace {
  margin-bottom: 1.1rem;
}
.upload-tools--admin-top {
  display: grid;
  gap: 0.75rem;
}
.upload-tools--admin-top > .dash-panel:not([open]) {
  opacity: 0.92;
}
@media (max-width: 640px) {
  .admin-manage-rail__label {
    display: none;
  }
  .admin-rail-chip span,
  .admin-rail-more > summary span {
    font-size: 0.78rem;
  }
  .admin-rail-more {
    margin-left: 0;
  }
}

/* 合併重複預覽 */
.merge-preview-list {
  display: grid;
  gap: 0.75rem;
}
.merge-preview-group {
  padding: 0.75rem 0.85rem;
  border: 1px solid #e0e3e7;
  border-radius: 12px;
  background: #fafbfc;
}
.merge-preview-group header {
  display: grid;
  gap: 0.2rem;
  margin-bottom: 0.45rem;
  font-size: 0.9rem;
}
.merge-preview-group header span {
  color: #5f6368;
  font-size: 0.82rem;
}
.merge-preview-result {
  font-size: 0.86rem;
  color: #174ea6;
}
.merge-preview-group ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.84rem;
}
.merge-preview-keep {
  color: #137333;
}
.merge-preview-remove {
  color: #c5221f;
}
.merge-preview-tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 650;
}
.merge-preview-keep .merge-preview-tag {
  background: #ceead6;
  color: #137333;
}
.merge-preview-remove .merge-preview-tag {
  background: #fce8e6;
  color: #c5221f;
}

.ticket-photo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.82rem;
  font-weight: 650;
  color: #1a73e8;
  text-decoration: none;
}
.ticket-photo-link:hover,
.ticket-photo-link:focus-visible {
  text-decoration: underline;
}
.ticket-photo-link--none {
  color: #9aa0a6;
  font-weight: 500;
  cursor: default;
}
.seller-icon-btn--disabled {
  opacity: 0.35;
  pointer-events: none;
}
