:root {
  --ifec-purple: #6347bf;
  --ifec-purple-dark: #4d349d;
  --ifec-orange: #ff8614;
  --ifec-yellow: #f8c71f;
  --ifec-ink: #27243a;
  --ifec-muted: #6d687a;
  --ifec-line: #e8e3f2;
  --ifec-bg: #fbf8f0;
  --ifec-soft: #f4eefc;
  --ifec-white: #fff;
  --ifec-success: #22a06b;
  --ifec-danger: #de3b40;
  --ifec-radius: 22px;
  --ifec-radius-sm: 14px;
  --ifec-shadow: 0 18px 45px rgba(80, 51, 136, 0.15);
  --ifec-shadow-sm: 0 8px 22px rgba(80, 51, 136, 0.1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", Arial, sans-serif;
  color: var(--ifec-ink);
  background:
    radial-gradient(circle at 0 12%, rgba(248, 199, 31, 0.28) 0 90px, transparent 92px),
    radial-gradient(circle at 100% 88%, rgba(255, 134, 20, 0.16) 0 120px, transparent 122px),
    linear-gradient(180deg, #fffaf0 0%, #f8f3ff 100%);
  line-height: 1.6;
}

a {
  color: var(--ifec-purple);
  text-decoration: none;
}

a:hover {
  color: var(--ifec-orange);
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(99, 71, 191, 0.12);
  backdrop-filter: blur(16px);
}

.site-header .container {
  max-width: 1180px;
  padding: 1rem 1.25rem;
}

.site-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-brand__mark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.site-brand__logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--ifec-orange), var(--ifec-yellow));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  box-shadow: var(--ifec-shadow-sm);
}

.site-brand h1 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.25;
}

.site-brand .tagline {
  margin: 0.2rem 0 0;
  color: var(--ifec-muted);
  font-size: 0.86rem;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

.container--wide {
  max-width: 1180px;
}

.site-footer {
  text-align: center;
  padding: 2rem 1rem 2.5rem;
  color: var(--ifec-muted);
  font-size: 0.9rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: 2rem;
  align-items: center;
  min-height: 520px;
}

.hero__eyebrow,
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 1rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(248, 199, 31, 0.25);
  color: #7a4b00;
  font-weight: 800;
  font-size: 0.88rem;
}

.hero h2 {
  margin: 0;
  font-size: clamp(2.3rem, 7vw, 5.2rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  color: var(--ifec-ink);
}

.hero h2 span {
  color: var(--ifec-purple);
}

.hero__lead {
  max-width: 620px;
  margin: 1.35rem 0 0;
  color: var(--ifec-muted);
  font-size: 1.08rem;
}

.hero__actions,
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.35rem;
}

.hero__visual {
  min-height: 410px;
  border-radius: 34px;
  background:
    linear-gradient(90deg, var(--ifec-yellow) 0 33.333%, var(--ifec-orange) 33.333% 66.666%, var(--ifec-purple) 66.666% 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  box-shadow: var(--ifec-shadow);
}

.hero-tile {
  color: #fff;
  padding: 2rem 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.hero-tile:first-child {
  color: var(--ifec-ink);
}

.hero-tile strong {
  display: block;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero-tile span {
  display: block;
  margin-top: 0.4rem;
  font-weight: 800;
}

.hero-tile__avatar {
  align-self: center;
  width: min(120px, 80%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.2rem;
}

.section {
  margin-top: 2rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.section-header h2,
.section-header h3 {
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.72rem 1.2rem;
  border: 0;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--ifec-orange);
  color: var(--ifec-white);
  box-shadow: 0 4px 0 #d96d10;
}

.btn-primary:hover {
  color: #fff;
  background: #f0780f;
}

.btn-secondary {
  background: var(--ifec-purple);
  color: var(--ifec-white);
  box-shadow: 0 4px 0 var(--ifec-purple-dark);
}

.btn-secondary:hover {
  color: #fff;
  background: var(--ifec-purple-dark);
}

.btn-outline {
  background: #fff;
  border: 2px solid var(--ifec-line);
  color: var(--ifec-purple);
}

.btn-outline:hover {
  border-color: var(--ifec-purple);
}

.card,
.panel,
.tier-card,
.auth-card,
.dashboard-card,
.table-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(99, 71, 191, 0.12);
  border-radius: var(--ifec-radius);
  box-shadow: var(--ifec-shadow-sm);
}

.card {
  padding: 1.45rem 1.6rem;
  margin-bottom: 1rem;
}

.card h2,
.card h3,
.panel h3 {
  margin-top: 0;
  color: var(--ifec-purple);
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.panel {
  padding: 1.35rem;
  position: relative;
  overflow: hidden;
}

.panel::after {
  content: "";
  position: absolute;
  inset: auto -30px -40px auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(248, 199, 31, 0.18);
}

.panel--purple {
  border-top: 6px solid var(--ifec-purple);
}

.panel--orange {
  border-top: 6px solid var(--ifec-orange);
}

.panel--yellow {
  border-top: 6px solid var(--ifec-yellow);
}

.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--ifec-radius-sm);
  margin-bottom: 1rem;
  font-weight: 700;
}

.alert-error {
  background: #fff0f0;
  color: #9b1c1c;
  border: 1px solid #ffd3d3;
}

.alert-success {
  background: #eefbf4;
  color: #276749;
  border: 1px solid #c9f0d8;
}

.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
  margin-top: 1.5rem;
}

.tier-card {
  padding: 2rem;
  min-height: 280px;
  text-align: left;
  border: 0;
  position: relative;
  overflow: hidden;
}

.tier-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 71, 191, 0.1), rgba(255, 134, 20, 0.1));
  opacity: 0;
  transition: opacity 0.2s;
}

.tier-card:hover::before {
  opacity: 1;
}

.tier-card h3 {
  position: relative;
  margin: 0 0 0.5rem;
  color: var(--ifec-purple);
  font-size: 2rem;
}

.tier-card p,
.tier-card button {
  position: relative;
}

.tier-card__icon {
  width: 78px;
  height: 78px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin-bottom: 1.2rem;
  background: var(--ifec-soft);
}

.quiz-shell {
  max-width: 900px;
  margin: 0 auto;
}

.quiz-progress {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  color: var(--ifec-muted);
  font-weight: 700;
}

.question-block {
  padding: 1.3rem;
  margin-bottom: 1rem;
}

.question-block fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

.question-block legend {
  width: 100%;
  font-weight: 900;
  color: var(--ifec-ink);
  margin-bottom: 1rem;
  font-size: 1.08rem;
}

.option-label {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.75rem 0.9rem;
  margin: 0.5rem 0;
  border: 1px solid var(--ifec-line);
  border-radius: var(--ifec-radius-sm);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.option-label:hover {
  background: #fffaf0;
  border-color: var(--ifec-yellow);
  transform: translateX(2px);
}

.score-banner {
  background: linear-gradient(135deg, var(--ifec-yellow), var(--ifec-orange));
  color: var(--ifec-ink);
  padding: 1.6rem;
  border-radius: var(--ifec-radius);
  text-align: center;
  font-size: 1.35rem;
  font-weight: 900;
  margin-bottom: 1.5rem;
  box-shadow: var(--ifec-shadow-sm);
}

.result-item {
  padding: 1rem 1.15rem;
  margin-bottom: 0.85rem;
  border-radius: var(--ifec-radius-sm);
  background: #fff;
  border: 1px solid var(--ifec-line);
  border-left: 7px solid #ccc;
  box-shadow: 0 3px 12px rgba(80, 51, 136, 0.06);
}

.result-item.correct {
  border-left-color: var(--ifec-success);
}

.result-item.wrong {
  border-left-color: var(--ifec-danger);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 800;
  margin-bottom: 0.4rem;
  color: var(--ifec-ink);
}

.form-group input,
.form-group select {
  width: 100%;
  max-width: 100%;
  min-height: 46px;
  padding: 0.72rem 0.85rem;
  border: 1px solid var(--ifec-line);
  border-radius: var(--ifec-radius-sm);
  background: #fff;
  font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--ifec-purple);
  box-shadow: 0 0 0 4px rgba(99, 71, 191, 0.12);
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1fr);
  gap: 0;
  max-width: 940px;
  margin: 2rem auto;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: var(--ifec-shadow);
  background: #fff;
}

.auth-panel {
  padding: 2.2rem;
  background: linear-gradient(135deg, var(--ifec-purple), #7b5ee0);
  color: #fff;
}

.auth-panel--orange {
  background: linear-gradient(135deg, var(--ifec-orange), #f5b642);
  color: var(--ifec-ink);
}

.auth-panel h2 {
  margin: 0 0 0.8rem;
  font-size: 2.2rem;
  line-height: 1.05;
}

.auth-panel p {
  margin: 0;
  opacity: 0.92;
}

.auth-card {
  border: 0;
  box-shadow: none;
  border-radius: 0;
  padding: 2.2rem;
}

.auth-card h3 {
  margin-top: 0;
  color: var(--ifec-purple);
  font-size: 1.6rem;
}

.demo-hint {
  padding: 0.8rem 1rem;
  border-radius: var(--ifec-radius-sm);
  background: #fff8df;
  color: #755000;
  font-size: 0.92rem;
  margin-top: 1rem;
}

.dashboard-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  padding: 1.6rem;
  margin-bottom: 1rem;
  border-radius: var(--ifec-radius);
  background: linear-gradient(135deg, #fff, #f4efff);
  border: 1px solid var(--ifec-line);
  box-shadow: var(--ifec-shadow-sm);
}

.dashboard-hero h2 {
  margin: 0;
  color: var(--ifec-purple);
}

.dashboard-hero p {
  margin: 0.35rem 0 0;
  color: var(--ifec-muted);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat-card {
  padding: 1.35rem;
  border-radius: var(--ifec-radius);
  background: #fff;
  box-shadow: var(--ifec-shadow-sm);
  border: 1px solid var(--ifec-line);
}

.stat-card__label {
  margin: 0;
  color: var(--ifec-muted);
  font-weight: 800;
}

.stat-card__value {
  margin: 0.3rem 0 0;
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--ifec-purple);
}

.table-card {
  padding: 1rem;
  overflow: hidden;
}

.table-card__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin: 0 0 0.8rem;
}

.table-card__header h3 {
  margin: 0;
  color: var(--ifec-purple);
}

.table-scroll {
  overflow-x: auto;
}

table.data-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: #fff;
}

table.data-table th,
table.data-table td {
  padding: 0.78rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid #f0edf6;
  vertical-align: top;
}

table.data-table th {
  background: #f5f0ff;
  color: var(--ifec-purple-dark);
  font-weight: 900;
}

table.data-table tr:hover td {
  background: #fffaf0;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.58rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 900;
}

.badge-basic {
  background: #e8f4fd;
  color: #2b6cb0;
}

.badge-advanced {
  background: #fff0dc;
  color: #b35300;
}

.badge-active {
  background: #e8f8ef;
  color: #276749;
}

.badge-inactive {
  background: #f3f0f0;
  color: #7b6a6a;
}

@media (max-width: 860px) {
  .site-brand {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header__actions {
    justify-content: flex-start;
  }

  .hero,
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero__visual {
    min-height: 320px;
  }

  .dashboard-hero,
  .section-header,
  .table-card__header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .container {
    padding: 1.25rem 1rem;
  }

  .site-brand h1 {
    font-size: 1rem;
  }

  .hero__visual {
    grid-template-columns: 1fr;
  }

  .hero-tile {
    min-height: 180px;
  }

  .auth-panel,
  .auth-card {
    padding: 1.4rem;
  }

  .btn {
    width: 100%;
  }
}
