:root {
  --primary: #10b981; /* 品牌主色（翡翠綠） */
  --primary-dark: #047857; /* 主色 hover/深色版 */
  --bg: #f8fafc; /* 冰川白背景 */
  --ink: #334155; /* 深灰藍文字 */
  --paper: #ffffff; /* 卡片底色 */
  --sub: #64748b; /* 次要文字（灰藍） */
  --line: #e2e8f0; /* 淺灰藍分隔線 */
  --accent: #f59e0b; /* 琥珀橘：代課警示色 */
  --blue: #3b82f6; /* 天際藍：分店篩選色 */
  --mint: #6ee7b7; /* 薄荷綠：品牌輔色 */
  --slate: #1e293b; /* 午夜藍：品牌輔色 */
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Nunito", "PingFang TC", "Microsoft JhengHei", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  line-height: 1.5;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.sheet {
  background: var(--paper);
  padding: 24px 22px 26px;
  margin-bottom: 15px;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.hero {
  text-align: center;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 900;
  margin: 0 0 8px;
  letter-spacing: 0.5px;
}

.hero h1 .c1 {
  color: var(--primary);
}

.hero h1 .c2 {
  color: var(--slate);
}

.stripe-bar {
  height: 8px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  margin: 0 auto;
  max-width: 320px;
}

.stripe-bar span {
  flex: 1;
}

.stripe-bar .s1 {
  background: var(--slate);
  flex-grow: 3;
}

.stripe-bar .s2 {
  background: var(--primary);
}

.stripe-bar .s3 {
  background: var(--mint);
}

.stripe-bar .s4 {
  background: var(--accent);
}

.stripe-bar .s5 {
  background: var(--blue);
  flex-grow: 2;
}

.week-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.week-toggle button {
  flex: 1;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--sub);
  font-size: 0.95rem;
  cursor: pointer;
}

.week-toggle button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
}

#weekRange {
  color: var(--sub);
  font-size: 0.85rem;
  margin: 6px 0 20px;
}

.filter-section {
  border: none;
  margin: 0 0 20px;
  padding: 0;
  --accent: var(--primary);
}

.filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  gap: 6px;
  height: 31px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.clear-btn {
  border: none;
  background: none;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-block;
}

.pill input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.pill label {
  display: inline-flex;
  align-items: center;
  height: 31px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pill input[type="checkbox"]:not(:checked) + label:hover {
  border-style: dashed;
  border-color: var(--accent);
  color: var(--accent);
}

.pill input[type="checkbox"]:checked + label {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.25) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.25) 50%,
    rgba(255, 255, 255, 0.25) 75%,
    transparent 75%,
    transparent
  );
  background-size: 1.5rem 1.5rem;
  animation: pill-stripes 2s linear infinite;
}

@keyframes pill-stripes {
  from {
    background-position: 1.5rem 0;
  }
  to {
    background-position: 0 0;
  }
}

.pill.hidden {
  display: none;
}

.empty-hint {
  color: var(--sub);
  font-size: 12px;
  padding: 6px 2px;
}

.search-wrap {
  position: relative;
  margin-bottom: 10px;
}

.section-search {
  width: 100%;
  font-size: 13px;
  padding: 9px 14px 9px 40px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-weight: 600;
}

.section-search:focus {
  outline: none;
  border-color: var(--accent);
}

.search-wrap .search-icons {
  position: absolute;
  left: 16px;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sub);
  pointer-events: none;
  font-size: 13px;
}

#resultCount {
  color: var(--sub);
  font-size: 0.85rem;
  margin: 16px 0 8px;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.9rem;
}

.result-table th,
.result-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.result-table th {
  background: var(--bg);
  color: var(--sub);
  font-weight: 600;
  font-size: 0.8rem;
}

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

.result-table tbody tr:hover {
  background: var(--bg);
}

.result-table tr.substitute {
  background: #fffbeb;
}

.result-table .badge {
  display: inline-block;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 4px;
  padding: 1px 6px;
  margin-right: 6px;
  white-space: nowrap;
}

.empty-state,
.hint {
  color: var(--sub);
  text-align: center;
  padding: 48px 16px;
}

.hidden {
  display: none !important;
}

.submit-btn-wrap {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 14px;
}

.submit-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 22px;
  border: none;
  background: var(--primary);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.submit-btn:hover {
  background: var(--primary-dark);
}

#scheduleSubmitBtn,
#backBtn {
  width: 80px;
  height: 80px;
  font-size: 28px;
}

.submit-btn.gray-btn {
  background: #cbd5e1;
  color: #475569;
  box-shadow: none;
}

.submit-btn.gray-btn:hover {
  background: #94a3b8;
  color: #ffffff;
}

#resultView {
  padding-bottom: 88px;
}

#filterForm {
  padding-bottom: 88px;
}

footer {
  margin-top: 32px;
  color: var(--sub);
  font-size: 0.8rem;
  text-align: center;
}

@media (max-width: 600px) {
  .result-table {
    display: block;
    overflow-x: auto;
  }
}
