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

:root {
  --ink: #17263b;
  --muted: #758196;
  --line: #e6ebf0;
  --surface: #ffffff;
  --canvas: #f5f8fa;
  --teal: #0c8f92;
  --teal-dark: #087174;
  --teal-soft: #e4f5f4;
  --orange: #ef8a2f;
  --orange-soft: #fff0df;
  --green: #31a55b;
  --purple: #7b6eea;
  --shadow: 0 8px 24px rgba(26, 55, 74, 0.06);
  font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 236px; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 25px 16px 18px; position: fixed; inset: 0 auto 0 0; z-index: 3; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 12px 30px; font-size: 19px; font-weight: 800; letter-spacing: .04em; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--teal); color: white; font-size: 17px; box-shadow: 0 5px 11px rgba(12, 143, 146, .23); }
.nav-list { display: grid; gap: 5px; }
.nav-link { border: 0; color: var(--muted); background: transparent; border-radius: 10px; display: flex; align-items: center; gap: 12px; padding: 12px 13px; text-align: left; font-size: 15px; font-weight: 600; transition: .2s ease; }
.nav-link:hover { background: #f1f6f7; color: var(--ink); }
.nav-link.is-active { background: var(--teal-soft); color: var(--teal-dark); }
.nav-icon { width: 19px; text-align: center; font-size: 19px; line-height: 1; }
.sidebar-foot { display: flex; align-items: center; gap: 9px; border-top: 1px solid var(--line); margin-top: auto; padding: 17px 7px 0; }
.sidebar-foot strong { display: block; font-size: 13px; }
.sidebar-foot span { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.profile-avatar, .topbar-avatar { display: grid; place-items: center; border-radius: 50%; background: #d6eff0; color: var(--teal-dark); font-weight: 800; }
.profile-avatar { width: 34px; height: 34px; font-size: 13px; }
.sidebar-foot .icon-button { margin-left: auto; }

.main-content { flex: 1; margin-left: 236px; min-width: 0; }
.topbar { height: 74px; padding: 0 5.3vw; display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.84); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 2; }
.breadcrumb { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; }
.breadcrumb strong { color: var(--ink); font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 17px; }
.topbar-avatar { width: 31px; height: 31px; font-size: 12px; }
.icon-button { border: 0; background: transparent; color: var(--muted); width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center; font-size: 18px; position: relative; }
.icon-button:hover { background: #f0f4f6; color: var(--ink); }
.notification i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); top: 4px; right: 3px; border: 1px solid white; }
.mobile-menu { display: none; }

.page-view { max-width: 1280px; margin: 0 auto; padding: 45px 5.3vw 70px; }
.page-view[hidden] { display: none; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
.compact-heading { margin-bottom: 24px; }
.eyebrow { color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: .12em; margin: 0 0 8px; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(28px, 3vw, 36px); letter-spacing: -.04em; line-height: 1.2; margin-bottom: 9px; }
h2 { font-size: 17px; letter-spacing: -.02em; margin-bottom: 0; }
.heading-copy { color: var(--muted); margin-bottom: 0; font-size: 14px; }
.primary-button, .secondary-button { min-height: 43px; border-radius: 10px; padding: 0 18px; display: inline-flex; justify-content: center; align-items: center; gap: 7px; border: 1px solid transparent; font-size: 14px; font-weight: 700; transition: .2s ease; }
.primary-button { background: var(--teal); color: white; box-shadow: 0 5px 12px rgba(12, 143, 146, .2); }
.primary-button:hover { background: var(--teal-dark); transform: translateY(-1px); }
.secondary-button { border-color: var(--line); color: var(--ink); background: white; }
.secondary-button:hover { border-color: #cbd6de; background: #fafcfc; }

.overview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 44px; }
.overview-card { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 18px 19px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; box-shadow: var(--shadow); }
.overview-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; font-size: 21px; font-weight: 700; }
.overview-icon.teal { color: var(--teal); background: var(--teal-soft); }
.overview-icon.orange { color: var(--orange); background: var(--orange-soft); }
.overview-icon.purple { color: var(--purple); background: #efedff; }
.overview-card span:not(.overview-icon) { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.overview-card strong { font-size: 25px; line-height: 1; }
.overview-card small { color: var(--muted); font-size: 11px; align-self: end; white-space: nowrap; }
.overview-card small b { color: var(--green); font-weight: 700; }

.section-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 17px; }
.section-heading > div { display: flex; align-items: center; gap: 10px; }
.count-pill { color: var(--teal-dark); background: var(--teal-soft); border-radius: 100px; padding: 3px 9px; font-size: 11px; font-weight: 700; }
.search-field { display: flex; align-items: center; gap: 7px; background: white; border: 1px solid var(--line); border-radius: 9px; padding: 0 11px; height: 37px; color: var(--muted); }
.search-field input { width: 150px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.search-field input::placeholder { color: #a0aab8; }
.event-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.event-card { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 17px; display: grid; grid-template-columns: 124px 1fr; gap: 18px; min-height: 198px; box-shadow: var(--shadow); }
.event-visual { border-radius: 11px; min-height: 164px; display: flex; align-items: flex-end; padding: 12px; color: white; position: relative; overflow: hidden; }
.event-visual::before, .event-visual::after { content: ''; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.23); }
.event-visual::before { width: 130px; height: 130px; top: -35px; right: -35px; }
.event-visual::after { width: 75px; height: 75px; top: 28px; right: -24px; }
.event-visual.tailya { background: linear-gradient(145deg, #d54b2a, #8e1d25); }
.event-visual.bbq { background: linear-gradient(145deg, #17445d, #102d52); }
.event-visual.team { background: linear-gradient(145deg, #508d88, #246362); }
.event-visual.survey { background: linear-gradient(145deg, #8278d5, #51489b); }
.event-visual span { font-size: 29px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.2)); position: relative; z-index: 1; }
.event-content { min-width: 0; display: flex; flex-direction: column; }
.event-title-row { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.event-title-row h3 { margin: 1px 0 8px; font-size: 19px; letter-spacing: -.03em; }
.status { border-radius: 100px; padding: 4px 9px; white-space: nowrap; color: var(--teal-dark); background: var(--teal-soft); font-size: 10px; font-weight: 700; }
.status.closed { color: #737e8b; background: #f1f3f5; }
.event-meta { display: grid; gap: 6px; margin-bottom: auto; color: var(--muted); font-size: 12px; }
.event-meta span { display: flex; gap: 8px; align-items: center; }
.event-progress { margin-top: 12px; }
.progress-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.progress-label strong { color: var(--ink); }
.progress-track { height: 5px; background: #edf0f2; border-radius: 10px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--teal); }
.event-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.text-button { border: 0; background: transparent; color: var(--teal-dark); font-size: 12px; font-weight: 700; padding: 0; }
.text-button:hover { text-decoration: underline; }
.outline-button { border: 1px solid #d6e5e5; color: var(--teal-dark); background: white; border-radius: 8px; font-size: 11px; padding: 7px 10px; font-weight: 700; }
.outline-button:hover { background: var(--teal-soft); }
.more-button { margin-left: auto; }
.empty-state { grid-column: 1/-1; text-align: center; padding: 48px; color: var(--muted); border: 1px dashed #cad5db; border-radius: 14px; background: rgba(255,255,255,.6); }

.create-layout { max-width: 790px; display: grid; gap: 16px; }
.form-card, .chart-card, .attendee-card, .respond-card { background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.form-card { padding: 23px; }
.card-title { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 21px; }
.card-title h2 { margin-bottom: 4px; }
.card-title p, .card-heading p { color: var(--muted); font-size: 12px; margin: 5px 0 0; }
.step-number { display: grid; place-items: center; flex: 0 0 auto; width: 28px; height: 28px; border-radius: 8px; color: var(--teal-dark); background: var(--teal-soft); font-size: 13px; font-weight: 800; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 7px; color: #526174; font-size: 12px; font-weight: 600; }
.field b, .radio-field b { color: var(--orange); }
.field.full { grid-column: 1/-1; }
.field input, .field select, .field textarea { border: 1px solid #dbe3e8; border-radius: 8px; outline: 0; background: #fcfdfd; color: var(--ink); padding: 11px 12px; font-size: 13px; transition: .2s; width: 100%; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(12,143,146,.1); }
.template-options { display: grid; gap: 9px; }
.template-option { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px; color: var(--ink); }
.template-option:hover, .template-option.is-selected { border-color: #9dd3d4; background: #fbfefe; }
.template-art { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 9px; font-size: 21px; }
.tailya-art { background: #ffe4d5; }.bbq-art { background: #ddebf6; }.blank-art { background: #edf1f3; color: var(--muted); }
.template-option strong, .template-option small { display: block; }.template-option strong { font-size: 13px; margin-bottom: 3px; }.template-option small { color: var(--muted); font-size: 11px; }
.checkmark { opacity: 0; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: white; background: var(--teal); font-size: 12px; }
.template-option.is-selected .checkmark { opacity: 1; }
.question-list { display: grid; gap: 8px; }
.question-row { display: flex; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; }
.drag-handle { color: #a7b2bf; letter-spacing: 2px; font-size: 13px; }.question-row strong { font-size: 13px; font-weight: 600; }.question-row small { color: var(--muted); font-size: 11px; margin-left: auto; }.question-row .icon-button { width: 22px; height: 22px; font-size: 16px; }
.add-question { width: 100%; margin-top: 11px; padding: 11px; border: 1px dashed #9acbcd; border-radius: 9px; color: var(--teal-dark); background: #fbfefe; font-size: 12px; font-weight: 700; }.add-question:hover { background: var(--teal-soft); }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 3px; }

.stats-heading { align-items: center; }.stats-heading h1 { margin: 10px 0 4px; }.back-link { border: 0; background: transparent; padding: 0; color: var(--teal-dark); font-size: 12px; font-weight: 700; }.back-link:hover { text-decoration: underline; }
.stats-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(290px, .9fr); gap: 16px; align-items: start; }.stats-main { display: grid; gap: 16px; }.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }.metric-card { border: 1px solid var(--line); border-radius: 13px; background: white; padding: 17px; box-shadow: var(--shadow); }.metric-label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; }.metric-card strong { display: block; font-size: 32px; letter-spacing: -.06em; line-height: 1; }.metric-note { display: block; color: var(--muted); font-size: 11px; margin-top: 8px; }.metric-note b { color: var(--teal); font-weight: 700; margin-left: 4px; }.accent-green strong { color: var(--green); }.accent-orange strong { color: var(--orange); }
.chart-card, .attendee-card { padding: 20px; }.card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }.updated-label { color: var(--muted); font-size: 11px; }.bar-chart { height: 250px; display: flex; align-items: end; justify-content: space-evenly; gap: 35px; padding: 24px 18px 3px; margin-top: 14px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent 49px, #edf1f3 50px); }.bar-column { width: 24%; height: 100%; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 7px; }.bar-column > span { font-size: 12px; color: var(--ink); }.bar { width: min(68px, 68%); border-radius: 7px 7px 0 0; min-height: 18px; }.bar-teal { background: var(--teal); }.bar-orange { background: var(--orange); }.bar-gray { background: #b8c2ce; }.bar-column small { color: var(--muted); font-size: 11px; }
.attendee-card { min-width: 0; }.attendee-card h2 span { color: var(--muted); font-size: 12px; font-weight: 500; }.attendee-search { margin: 20px 0 11px; }.attendee-search input { width: 100%; }.attendee-list { display: grid; }.attendee-row { display: flex; align-items: center; gap: 9px; border-top: 1px solid var(--line); padding: 11px 0; }.attendee-row > div:nth-child(2) { min-width: 0; }.attendee-row strong { display: block; font-size: 12px; }.attendee-row small { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }.attendee-row .status { margin-left: auto; color: var(--green); background: #e4f6e9; font-size: 10px; }.mini-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; color: white; font-size: 11px; font-weight: 800; }.mini-avatar.blue { background: #5caec0; }.mini-avatar.orange { background: #ef9a39; }.mini-avatar.navy { background: #3b5b80; }.mini-avatar.purple { background: #8774c9; }.mini-avatar.teal { background: #3caaa5; }

.respond-wrap { width: min(100%, 540px); margin: 0 auto; }.respond-header { padding: 27px 0 19px; }.event-badge { display: inline-block; color: var(--teal-dark); background: var(--teal-soft); border-radius: 100px; padding: 5px 10px; font-size: 11px; font-weight: 800; margin-bottom: 14px; }.respond-header h1 { margin-bottom: 5px; }.respond-header p { color: var(--muted); font-size: 13px; margin-bottom: 0; }.respond-card { padding: 24px; display: grid; gap: 17px; }.radio-field { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 14px; color: #526174; font-size: 13px; }.radio-field legend { color: #526174; font-size: 12px; font-weight: 600; margin-bottom: 9px; width: 100%; }.radio-field label { display: flex; align-items: center; gap: 6px; }.radio-field input { accent-color: var(--teal); }.full-button { width: 100%; margin-top: 2px; }
.toast { position: fixed; left: 50%; bottom: 25px; z-index: 8; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: #1e3346; color: white; border-radius: 9px; padding: 11px 16px; font-size: 13px; box-shadow: 0 10px 25px rgba(20,37,51,.2); transition: .25s ease; }.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 980px) { .sidebar { width: 205px; }.main-content { margin-left: 205px; }.topbar { padding: 0 4vw; }.page-view { padding-left: 4vw; padding-right: 4vw; }.stats-layout { grid-template-columns: 1fr; }.attendee-card { order: 2; }.attendee-list { grid-template-columns: repeat(2, 1fr); column-gap: 22px; }.attendee-row:nth-child(-n+2) { border-top: 0; } }
@media (max-width: 740px) { .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: 8px 0 24px rgba(10,30,40,.08); }.sidebar.is-open { transform: translateX(0); }.main-content { margin-left: 0; }.mobile-menu { display: grid; }.topbar { height: 63px; }.breadcrumb span:first-child, .breadcrumb span:nth-child(2) { display: none; }.page-view { padding-top: 32px; }.page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 25px; }.page-heading .primary-button { width: 100%; }.overview-grid { grid-template-columns: 1fr; gap: 10px; margin-bottom: 33px; }.overview-card { padding: 14px 16px; }.overview-card small { margin-left: auto; }.section-heading { align-items: flex-start; gap: 14px; flex-direction: column; }.search-field, .search-field input { width: 100%; }.event-grid { grid-template-columns: 1fr; }.event-card { grid-template-columns: 105px 1fr; padding: 12px; gap: 13px; }.event-visual { min-height: 175px; }.event-title-row h3 { font-size: 17px; }.event-actions { flex-wrap: wrap; }.create-layout { width: 100%; }.field-grid { grid-template-columns: 1fr; }.field.full { grid-column: auto; }.stats-heading { flex-direction: column; }.stats-heading .secondary-button { width: 100%; }.metric-grid { grid-template-columns: 1fr; gap: 9px; }.metric-card { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 14px 16px; }.metric-card strong { grid-column: 2; grid-row: 1 / span 2; }.metric-label { margin-bottom: 3px; }.metric-note { margin-top: 0; }.bar-chart { gap: 8px; }.attendee-list { grid-template-columns: 1fr; }.attendee-row:nth-child(n) { border-top: 1px solid var(--line); }.form-card { padding: 18px; }.form-actions { justify-content: stretch; }.form-actions > * { flex: 1; } }
@media (max-width: 420px) { .event-card { grid-template-columns: 1fr; }.event-visual { min-height: 110px; align-items: center; justify-content: center; }.event-visual span { font-size: 35px; }.event-actions { margin-top: 12px; }.search-field input { min-width: 0; } }

/* Public entry: visitors only see the current event registration form. */
.public-mode .sidebar, .public-mode .topbar { display: none; }
.public-mode .main-content { margin-left: 0; }
.public-mode .page-view:not(#view-respond) { display: none !important; }
.public-mode .page-view[hidden] { display: none !important; }
.public-mode #view-respond { min-height: 100vh; padding-top: 22px; }
.public-mode .respond-wrap { width: min(100%, 540px); }
.public-header { display: flex; align-items: center; justify-content: space-between; padding: 0 0 25px; }
.public-header .brand { padding: 0; font-size: 17px; }
.public-admin-link { border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; padding: 8px 0; }
.public-admin-link:hover { color: var(--teal-dark); }
.public-admin-link span { color: var(--teal); font-size: 16px; margin-right: 4px; }
.public-intro { margin: 17px 0 22px; }
.public-intro h1 { margin-bottom: 7px; }
.public-intro p:not(.eyebrow) { color: var(--muted); font-size: 13px; margin-bottom: 0; }
.respond-header { border: 1px solid #d8ecec; border-radius: 13px; background: linear-gradient(135deg, #f2fbfb, #fff); padding: 17px 18px; margin-bottom: 15px; }
.respond-header .event-badge { margin-bottom: 9px; }
.respond-header p { margin: 0; }
.respond-success { text-align: center; border: 1px solid var(--line); border-radius: 14px; padding: 36px 24px; background: white; box-shadow: var(--shadow); }
.success-icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 50%; color: white; background: var(--green); font-size: 24px; font-weight: 800; }
.respond-success h2 { margin-bottom: 8px; }
.respond-success p { color: var(--muted); font-size: 13px; margin-bottom: 21px; }
.login-overlay { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 20px; background: rgba(17, 34, 49, .38); backdrop-filter: blur(5px); }
.login-overlay[hidden] { display: none; }
.login-card { width: min(100%, 390px); position: relative; border: 1px solid var(--line); border-radius: 17px; background: white; padding: 30px; box-shadow: 0 22px 70px rgba(16, 36, 49, .2); }
.login-close { position: absolute; top: 14px; right: 14px; }
.lock-icon { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 18px; border-radius: 14px; color: var(--teal-dark); background: var(--teal-soft); font-size: 23px; }
.login-card h2 { font-size: 22px; margin-bottom: 8px; }
.login-copy { color: var(--muted); font-size: 13px; margin-bottom: 23px; }
.login-error { color: #d45b47; font-size: 12px; margin: -6px 0 0; }
.login-card .full-button { margin-top: 5px; }

@media (max-width: 740px) { .public-mode #view-respond { padding: 18px 5vw 48px; }.public-header { padding-bottom: 17px; }.login-card { padding: 26px 21px; } }
