@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700;800&family=Azeret+Mono:wght@400;600&display=swap');

:root {
  --line-bg: #f4f8f3;
  --line-surface: rgba(255, 255, 255, 0.9);
  --line-surface-strong: #ffffff;
  --line-border: rgba(16, 88, 58, 0.12);
  --line-shadow: 0 24px 60px rgba(24, 57, 41, 0.12);
  --line-shadow-soft: 0 10px 30px rgba(24, 57, 41, 0.08);
  --line-primary: #0d8b57;
  --line-primary-deep: #0a6d45;
  --line-accent: #dff3e8;
  --line-accent-strong: #c2e8d5;
  --line-ink: #183124;
  --line-muted: #667a6f;
  --line-warning: #c97b17;
  --line-danger: #b84f39;
  --line-info: #2e6f8e;
  --line-radius-xl: 28px;
  --line-radius-lg: 22px;
  --line-radius-md: 16px;
}

html,
body {
  min-height: 100%;
}

body {
  position: relative;
  margin: 0;
  color: var(--line-ink);
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(174, 225, 199, 0.9), transparent 28%),
    radial-gradient(circle at right 12% top 18%, rgba(255, 217, 170, 0.4), transparent 18%),
    linear-gradient(180deg, #eef6f0 0%, #f8fbf8 48%, #edf5f0 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
  filter: blur(8px);
}

body::before {
  width: 240px;
  height: 240px;
  top: 90px;
  right: -40px;
  border-radius: 40px;
  background: linear-gradient(135deg, rgba(13, 139, 87, 0.16), rgba(255, 255, 255, 0));
  transform: rotate(18deg);
}

body::after {
  width: 180px;
  height: 180px;
  left: -50px;
  bottom: 80px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(222, 243, 232, 0.85) 0%, rgba(222, 243, 232, 0) 68%);
}

.app-wrapper {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 20px 16px 120px;
}

.page-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
  padding: 24px 24px 22px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--line-radius-xl);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(246, 251, 248, 0.88)),
    linear-gradient(135deg, rgba(13, 139, 87, 0.08), rgba(255, 255, 255, 0));
  box-shadow: var(--line-shadow);
  backdrop-filter: blur(10px);
}

.page-hero-flat {
  padding: 4px 2px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.page-hero-flat::after {
  display: none;
}

.page-hero::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  top: -90px;
  right: -50px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(13, 139, 87, 0.12) 0%, rgba(13, 139, 87, 0) 72%);
}

.hero-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.brand-title,
.page-title {
  margin: 0;
  font-size: clamp(1.55rem, 2vw, 2.05rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.sub-title,
.page-subtitle {
  margin-top: 8px;
  color: var(--line-muted);
  font-size: 0.95rem;
}

.brand-chip,
.badge-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(13, 139, 87, 0.1);
  background: linear-gradient(135deg, var(--line-primary) 0%, #20a36b 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.83rem;
  box-shadow: 0 10px 24px rgba(13, 139, 87, 0.2);
}

.hero-note {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  color: var(--line-muted);
  font-size: 0.88rem;
}

.card,
.surface-card {
  border: 1px solid var(--line-border) !important;
  border-radius: var(--line-radius-lg) !important;
  background: var(--line-surface) !important;
  box-shadow: var(--line-shadow-soft) !important;
  backdrop-filter: blur(8px);
}

.card-body {
  padding: 1.25rem 1.25rem;
}

.section-title,
.card-title-strong {
  color: var(--line-ink);
  font-weight: 800;
  letter-spacing: 0.01em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--line-accent);
  color: var(--line-primary-deep);
  font-size: 0.78rem;
  font-weight: 700;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.stat-card {
  padding: 14px 16px;
  border: 1px solid rgba(13, 139, 87, 0.08);
  border-radius: var(--line-radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(243, 249, 245, 0.88));
}

.stat-label {
  color: var(--line-muted);
  font-size: 0.8rem;
}

.stat-value {
  margin-top: 4px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--line-ink);
}

.btn {
  border-radius: 14px;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(24, 57, 41, 0.12);
}

.btn-main {
  padding: 12px 14px;
}

.btn-success,
.btn-primary {
  border: none;
  background: linear-gradient(135deg, var(--line-primary) 0%, #22a167 100%);
  color: #fff !important;
}

.btn-outline-success {
  border-color: rgba(13, 139, 87, 0.25);
  color: var(--line-primary-deep);
  background: rgba(255, 255, 255, 0.76);
}

.btn-outline-success:hover,
.btn-outline-success:focus-visible {
  border-color: transparent;
  background: linear-gradient(135deg, var(--line-primary) 0%, #22a167 100%);
  color: #fff !important;
}

.btn-outline-secondary {
  border-color: rgba(102, 122, 111, 0.2);
  color: #55675e;
  background: rgba(255, 255, 255, 0.72);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible {
  color: #fff !important;
  background: linear-gradient(135deg, #72827b 0%, #526059 100%);
  border-color: transparent;
}

.btn-outline-primary,
.btn-outline-info {
  background: rgba(255, 255, 255, 0.78);
}

.form-label {
  font-weight: 700;
  color: #284137;
}

.form-control,
.form-select {
  min-height: 50px;
  border-radius: 14px;
  border-color: rgba(24, 57, 41, 0.12);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

textarea.form-control {
  min-height: 112px;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(13, 139, 87, 0.45);
  box-shadow: 0 0 0 0.25rem rgba(13, 139, 87, 0.12);
}

.input-group > .form-control,
.input-group > .form-select {
  min-height: 50px;
}

.input-group > .btn {
  border-radius: 14px;
}

.text-muted,
.small-muted,
.footer-text,
.form-text {
  color: var(--line-muted) !important;
}

.mono {
  font-family: "Azeret Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.alert {
  border: 1px solid transparent;
  border-radius: 18px;
}

.alert-info {
  color: #234a5d;
  background: #e5f3fb;
  border-color: #c9e7f6;
}

.alert-danger {
  color: #7d2f20;
  background: #fae8e4;
  border-color: #f2cfc8;
}

.alert-warning {
  color: #6d470b;
  background: #fff2dd;
  border-color: #f4ddb0;
}

.table {
  --bs-table-bg: transparent;
  margin-bottom: 0;
}

.table thead th {
  color: #4b6055;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: rgba(231, 241, 235, 0.92) !important;
  border-bottom-color: rgba(16, 88, 58, 0.12);
}

.table > :not(caption) > * > * {
  padding: 0.9rem 0.95rem;
  border-color: rgba(16, 88, 58, 0.08);
}

.list-group {
  gap: 10px;
}

.list-group-item {
  border: 1px solid rgba(16, 88, 58, 0.1);
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 20px rgba(24, 57, 41, 0.05);
}

.list-group-item-action:hover,
.list-group-item-action:focus {
  background: #f2faf5;
}

.list-group-item.active {
  color: var(--line-ink);
  border-color: rgba(13, 139, 87, 0.22);
  background: linear-gradient(180deg, #dff3e8, #edf8f1);
}

.table-card,
.detail-card {
  border: 1px solid var(--line-border);
  border-radius: var(--line-radius-lg);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--line-shadow-soft);
}

.timeline::before {
  background: linear-gradient(180deg, rgba(13, 139, 87, 0.18), rgba(13, 139, 87, 0.46));
}

.timeline-item::before {
  color: var(--line-primary);
}

.timeline-item.current::before {
  color: #f0a120;
}

.modal-content {
  border: 1px solid rgba(16, 88, 58, 0.1);
  border-radius: 24px;
  box-shadow: var(--line-shadow);
}

.barcode-fullscreen {
  background: rgba(255, 255, 255, 0.98);
}

.loading-shell {
  padding: 48px 18px;
  border-radius: var(--line-radius-lg);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--line-shadow-soft);
}

.floating-footer {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  z-index: 1200;
  width: min(100% - 20px, 760px);
  transform: translateX(-50%);
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(16, 88, 58, 0.12);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 50px rgba(24, 57, 41, 0.16);
  backdrop-filter: blur(14px);
}

.footer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  background: rgba(13, 139, 87, 0.08);
  color: var(--line-ink);
  font-weight: 800;
}

.footer-btn.is-primary {
  background: linear-gradient(135deg, var(--line-primary) 0%, #22a167 100%);
  color: #fff;
}

.footer-sheet {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 88px);
  z-index: 1190;
  width: min(100% - 20px, 760px);
  padding: 14px;
  border: 1px solid rgba(16, 88, 58, 0.12);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 60px rgba(24, 57, 41, 0.18);
  backdrop-filter: blur(16px);
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.footer-sheet.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.footer-sheet-title {
  margin-bottom: 10px;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--line-muted);
}

.footer-sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.footer-sheet-link {
  display: block;
  padding: 14px 16px;
  border: 1px solid rgba(16, 88, 58, 0.08);
  border-radius: 18px;
  background: rgba(244, 249, 246, 0.95);
  color: var(--line-ink);
  font-weight: 700;
  text-decoration: none;
}

.footer-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1180;
  background: rgba(255, 255, 255, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.footer-sheet-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.fade-up {
  animation: fadeUp 0.45s ease both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .app-wrapper {
    padding: 14px 12px 118px;
  }

  .page-hero {
    padding: 20px 18px;
    border-radius: 24px;
  }

  .hero-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .brand-chip,
  .badge-line {
    margin-top: 6px;
  }

  .card-body {
    padding: 1.05rem;
  }

  .footer-sheet-grid {
    grid-template-columns: 1fr;
  }
}
