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

:root {
  --navy: #1a2a40;
  --navy-dark: #0f1c2e;
  --navy-light: #243b55;
  --gold: #c9a66b;
  --gold-light: #dfc08a;
  --gold-dark: #a8864f;
  --bg: #eef1f5;
  --bg-soft: #f7f9fc;
  --card: #ffffff;
  --text: #1e2a38;
  --muted: #6b7c8f;
  --line: #dde3ea;
  --danger: #d64545;
  --warn: #e09b2d;
  --ok: #2e9d5b;
  --info: #3b82c4;
  --sidebar-w: 248px;
  --header-h: 64px;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(26, 42, 64, 0.08);
  --shadow-sm: 0 2px 8px rgba(26, 42, 64, 0.06);
  /* 統一欄位樣式（對齊 datetime 圓角淺框） */
  --field-radius: 14px;
  --field-border: #E5E7EB;
  --field-border-hover: #D1D5DB;
  --field-pad-y: 12px;
  --field-pad-x: 16px;
  --field-min-h: 48px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--navy-light); text-decoration: none; transition: color .15s; }
a:hover { color: var(--gold-dark); text-decoration: none; }

/* ── App Shell ── */
.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy-dark) 0%, var(--navy) 100%);
  color: #e8edf3;
  overflow-y: auto;
  z-index: 30;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0,0,0,.12);
}

.brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--navy-dark);
  letter-spacing: -.02em;
}
.brand h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .04em;
}
.brand small {
  display: block;
  margin-top: 4px;
  color: rgba(255,255,255,.5);
  font-size: 11px;
}

.sidebar-nav { flex: 1; padding: 8px 0 16px; }

.nav-home {
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(100% - 20px);
  margin: 2px 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  box-sizing: border-box;
  transition: all .15s;
}
.nav-home .nav-label { display: flex; align-items: center; gap: 10px; flex: 1; }
.nav-home:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
  text-decoration: none;
}
.nav-home.active {
  background: rgba(201, 166, 107, .18);
  color: var(--gold-light);
  box-shadow: inset 3px 0 0 var(--gold);
}
.nav-icon {
  width: 18px;
  height: 18px;
  opacity: .85;
  flex-shrink: 0;
}
.nav-home.active .nav-icon { opacity: 1; color: var(--gold); }

.nav-acc { margin: 2px 0; }
.nav-acc-toggle {
  width: calc(100% - 20px);
  margin: 0 10px;
  background: none;
  border: 0;
  color: rgba(255,255,255,.75);
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  transition: all .15s;
}
.nav-acc-toggle .nav-label { display: flex; align-items: center; gap: 10px; flex: 1; }
.nav-acc-toggle::after {
  content: "▾";
  font-size: 10px;
  color: rgba(255,255,255,.4);
  transform: rotate(-90deg);
  transition: transform .15s;
}
.nav-acc.open .nav-acc-toggle {
  background: rgba(255,255,255,.06);
  color: #fff;
}
.nav-acc.open .nav-acc-toggle::after { transform: rotate(0deg); }
.nav-acc-toggle:hover { background: rgba(255,255,255,.08); color: #fff; }

.nav-acc-link {
  display: flex;
  align-items: center;
  width: calc(100% - 20px);
  margin: 2px 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  box-sizing: border-box;
  transition: all .15s;
}
.nav-acc-link .nav-label { display: flex; align-items: center; gap: 10px; flex: 1; }
.nav-acc-link::after {
  content: "▾";
  font-size: 10px;
  color: rgba(255,255,255,.4);
  transform: rotate(-90deg);
}
.nav-acc-link:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
  text-decoration: none;
}
.nav-acc-link.active {
  background: rgba(255,255,255,.06);
  color: #fff;
}

.nav-acc-panel { display: none; padding: 4px 0 8px 10px; }
.nav-acc.open .nav-acc-panel { display: block; }
.nav-acc-panel a {
  display: block;
  padding: 8px 12px 8px 40px;
  margin: 1px 10px;
  border-radius: 6px;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  font-size: 13px;
  transition: all .15s;
}
.nav-acc-panel a:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
  text-decoration: none;
}
.nav-acc-panel a.active {
  background: rgba(201, 166, 107, .15);
  color: var(--gold-light);
}

.nav-sub-label {
  margin: 10px 20px 4px 32px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: .06em;
}
.nav-sub-link {
  padding-left: 44px !important;
  font-size: 12px !important;
}

.nav-sub-acc { margin: 2px 10px 6px; }
.nav-acc-panel a.nav-sub-flat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 10px 6px;
  padding: 8px 12px 8px 32px;
  border-radius: 6px;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  box-sizing: border-box;
  transition: all .15s;
}
.nav-acc-panel a.nav-sub-flat::after {
  content: "▾";
  font-size: 9px;
  color: rgba(255,255,255,.35);
  transform: rotate(-90deg);
}
.nav-acc-panel a.nav-sub-flat:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
  text-decoration: none;
}
.nav-acc-panel a.nav-sub-flat.active {
  background: rgba(201, 166, 107, .12);
  color: var(--gold-light);
}
.nav-sub-toggle {
  width: 100%;
  background: none;
  border: 0;
  color: rgba(255,255,255,.65);
  text-align: left;
  padding: 8px 12px 8px 32px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-sub-toggle::after {
  content: "▾";
  font-size: 10px;
  color: rgba(255,255,255,.35);
  transform: rotate(-90deg);
  transition: transform .15s;
}
.nav-sub-acc.open .nav-sub-toggle { color: var(--gold-light); }
.nav-sub-acc.open .nav-sub-toggle::after { transform: rotate(0deg); }
.nav-sub-toggle:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-sub-panel { display: none; padding-bottom: 4px; }
.nav-sub-acc.open .nav-sub-panel { display: block; }
.nav-sub-panel a {
  display: block;
  padding: 7px 12px 7px 48px;
  margin: 1px 0;
  border-radius: 6px;
  color: rgba(255,255,255,.55);
  text-decoration: none;
  font-size: 12px;
  transition: all .15s;
}
.nav-sub-panel a:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
  text-decoration: none;
}
.nav-sub-panel a.active {
  background: rgba(201, 166, 107, .12);
  color: var(--gold-light);
}

.nav-db-link {
  display: block;
  margin: 2px 10px;
  padding: 10px 12px 10px 32px;
  border-radius: 6px;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
}
.nav-db-link:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
  text-decoration: none;
}
.nav-db-link.active {
  background: rgba(201, 166, 107, .15);
  color: var(--gold-light);
}

.sidebar-user {
  padding: 16px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0,0,0,.15);
}
.sidebar-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: var(--navy-dark);
  flex-shrink: 0;
}
.sidebar-user-info { min-width: 0; }
.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 11px;
  color: rgba(255,255,255,.5);
  margin-top: 2px;
}

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  margin-left: var(--sidebar-w);
  height: var(--header-h);
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 20;
  box-shadow: var(--shadow-sm);
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.breadcrumb strong { color: var(--navy); font-weight: 600; }
.breadcrumb span { color: var(--muted); }
.header-org { color: var(--muted); font-size: 13px; }
.header-org strong { color: var(--navy); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.user-chip {
  color: var(--text);
  font-size: 13px;
  padding: 6px 12px;
  background: var(--bg-soft);
  border-radius: 20px;
  border: 1px solid var(--line);
}

.content {
  margin-left: var(--sidebar-w);
  padding: 24px 28px 40px;
  min-height: calc(100vh - var(--header-h));
}

.page-title {
  margin: 0 0 20px;
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
}

.page-subtitle {
  margin: -12px 0 20px;
  color: var(--muted);
  font-size: 14px;
}

/* ── Flash ── */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 13px;
}
.flash-ok { background: #e8f7ee; color: var(--ok); border: 1px solid #b8e6c8; }
.flash-err { background: #fdecea; color: var(--danger); border: 1px solid #f5c6c6; }

/* ── Cards ── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s;
}
.card:hover { box-shadow: var(--shadow); }
.card h4 {
  margin: 0 0 10px;
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
}
.card .num {
  font-size: 28px;
  color: var(--navy);
  font-weight: 700;
  line-height: 1.2;
}
.card .hint {
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}
.card .trend {
  font-size: 12px;
  margin-top: 6px;
  font-weight: 500;
}
.trend-up { color: var(--ok); }
.trend-down { color: var(--danger); }

.stat-card {
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}
.stat-card .stat-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(201, 166, 107, .12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* ── Dashboard ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  margin-bottom: 20px;
}
.dashboard-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 20px;
  width: 100%;
}
.dashboard-main { display: flex; flex-direction: column; gap: 20px; }
.dashboard-side { display: flex; flex-direction: column; gap: 20px; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.panel-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
}
.panel-head a { font-size: 13px; color: var(--gold-dark); }
.panel-head a.btn { font-size: 12px; color: #fff; }

.eval-panel { display: grid; grid-template-columns: 180px 1fr; gap: 24px; align-items: center; }
.donut-wrap { position: relative; width: 160px; height: 160px; margin: 0 auto; }
.donut {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--pct, 0) * 1%), #e8edf2 0);
  display: flex;
  align-items: center;
  justify-content: center;
}
.donut-hole {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px var(--line);
}
.donut-hole .pct {
  font-size: 32px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}
.donut-hole .lbl {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.dim-list { display: flex; flex-direction: column; gap: 14px; }
.dim-row { display: flex; flex-direction: column; gap: 6px; }
.dim-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text);
}
.dim-label span:last-child { color: var(--muted); font-weight: 600; }
.dim-bar {
  height: 8px;
  background: #e8edf2;
  border-radius: 99px;
  overflow: hidden;
}
.dim-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-radius: 99px;
  transition: width .4s ease;
}

.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.todo-item:last-child { border-bottom: 0; padding-bottom: 0; }
.todo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.todo-dot.urgent { background: var(--danger); }
.todo-dot.normal { background: var(--warn); }
.todo-dot.ok { background: var(--ok); }
.todo-body { flex: 1; min-width: 0; }
.todo-title { font-size: 13px; font-weight: 500; color: var(--text); }
.todo-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.todo-meta.deadline { color: var(--danger); font-weight: 500; }

.dashboard-bottom {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}

.calendar { font-size: 13px; }
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cal-head button {
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
}
.cal-head button:hover { background: var(--bg-soft); color: var(--navy); }
.cal-head span { font-weight: 600; color: var(--navy); }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}
.cal-grid .dow {
  font-size: 11px;
  color: var(--muted);
  padding: 4px 0;
  font-weight: 600;
}
.cal-grid .day {
  padding: 6px 0;
  border-radius: 6px;
  color: var(--text);
  cursor: default;
}
.cal-grid .day.other { color: #c0cad4; }
.cal-grid .day.today {
  background: var(--navy);
  color: #fff;
  font-weight: 700;
}
.cal-grid .day.has-event {
  position: relative;
  font-weight: 600;
  color: var(--navy);
}
.cal-grid .day.has-event::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
}

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.badge-ok, .badge-success { background: #e8f7ee; color: var(--ok); }
.badge-info, .badge-progress { background: #e8f0fa; color: var(--info); }
.badge-warn { background: #fef3e2; color: var(--warn); }
.badge-danger { background: #fdecea; color: var(--danger); }
.badge-off { background: #f3e8e8; color: var(--danger); }
.badge-muted { background: #eef2f5; color: var(--muted); }

/* ── Tables ── */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
}
table.data th, table.data td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
}
table.data th {
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: none;
  letter-spacing: .02em;
  border: 0;
  padding: 2px 16px 0;
}
table.data td {
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
table.data td:first-child {
  border-left: 1px solid var(--line);
  border-radius: 14px 0 0 14px;
}
table.data td:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 14px 14px 0;
}
table.data tr:last-child td { border-bottom: 1px solid var(--line); }

.table-scroll { overflow-x: auto; }
.class-list th { white-space: nowrap; }
.class-list .date-sort { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }
.class-list .date-sort a {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
  background: #fff;
}
.class-list .date-sort a.is-active {
  color: #fff;
  border-color: var(--navy);
  background: var(--navy);
}
.class-list .col-center { text-align: center; }
.class-list .nowrap { white-space: nowrap; }
.class-list .type-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 2.5em;
  line-height: 1.25;
  font-weight: 600;
  color: var(--navy);
}
.class-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .06em;
  white-space: nowrap;
  background: #f6f0e4;
  color: #8a6430;
}
.class-status[data-status="草稿"] { background: #eef2f5; color: #64748b; }
.class-status[data-status="招生中"] { background: #e8f1ff; color: #1d4ed8; }
.class-status[data-status="執行中"] { background: #e8f7ef; color: #15803d; }
.class-status[data-status="已完成"] { background: #eef2ff; color: #3730a3; }
.class-status[data-status="已結案"] { background: #f1f5f9; color: #475569; }
.class-link-actions {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: 76px;
}
.class-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
}
.class-link-btn:hover { border-color: var(--gold); color: var(--navy); text-decoration: none; }
.class-op-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  min-width: 96px;
}
table.data tr:hover td { background: #f7f9fc; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 8px;
  padding: 9px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  transition: all .15s;
}
.btn:hover { text-decoration: none; opacity: .92; transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--navy-dark);
  box-shadow: 0 2px 8px rgba(201, 166, 107, .35);
}
.btn-navy {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 2px 8px rgba(26, 42, 64, .25);
}
.btn-ghost {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--gold);
  color: var(--gold-dark);
}
a.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 8px 14px 0;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  vertical-align: middle;
}
a.back-btn:hover {
  background: var(--bg-soft);
  border-color: #d1d5db;
  color: var(--navy);
  text-decoration: none;
}

/* 報名欄位／選項拖曳排序 */
.dnd-seq-cell {
  white-space: nowrap;
  vertical-align: middle;
}
.dnd-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 28px;
  margin-right: 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: #6b7a90;
  cursor: grab;
  user-select: none;
  letter-spacing: -2px;
  font-size: 12px;
  line-height: 1;
}
.dnd-handle:active { cursor: grabbing; }
.dnd-seq {
  display: inline-block;
  min-width: 1.4em;
  font-weight: 600;
  color: var(--navy);
}
tr.dnd-dragging td {
  background: #eef4fb !important;
  opacity: 0.85;
}
table.sortable-table tbody tr.dnd-row td {
  cursor: default;
}

/* 報名欄位新增：單列 */
.reg-field-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  align-items: end;
  padding: 14px 16px;
  background: var(--bg-soft, #f6f8fb);
  border: 1px solid var(--line);
  border-radius: var(--radius, 10px);
}
.reg-field-add-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 120px;
}
.reg-field-add-item.grow {
  flex: 1 1 220px;
  min-width: 180px;
}
.reg-field-add-item label,
.attendance-open-item label {
  font-size: 12px;
  font-weight: 600;
  color: #5a6a7e;
}
.reg-field-add-item input,
.reg-field-add-item select,
.attendance-open-item input,
.attendance-open-item select {
  width: 100%;
  min-height: 38px;
}
.reg-field-add-action {
  display: flex;
  align-items: end;
  padding-bottom: 1px;
}

/* 開啟出勤場次：單列美化 */
.attendance-open-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  align-items: end;
  padding: 16px 18px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius, 10px);
}
.attendance-open-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 110px;
}
.attendance-open-item.grow {
  flex: 1 1 180px;
  min-width: 160px;
}
.attendance-open-item.narrow {
  width: 96px;
  min-width: 88px;
  flex: 0 0 auto;
}
.attendance-open-action {
  display: flex;
  align-items: end;
  margin-left: auto;
}

/* 名冊編輯列 */
.roster-edit-row td {
  background: #f8fafc;
  padding: 12px 14px !important;
}
.roster-edit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 14px;
  align-items: end;
}
.roster-edit-grid label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #5a6a7e;
  margin-bottom: 4px;
}
.roster-edit-grid input,
.roster-edit-grid select {
  width: 100%;
  min-height: 36px;
}
.roster-edit-actions {
  display: flex;
  gap: 8px;
  align-items: end;
}
@media (max-width: 900px) {
  .roster-edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Forms ── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  max-width: 860px;
  box-shadow: var(--shadow-sm);
}
/* panel 內不再套第二層卡片框 */
.panel > .form-grid,
.panel .form-grid {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 4px 0 0;
  max-width: none;
  border-radius: 0;
}
.form-grid .full { grid-column: 1 / -1; }
label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 13px; font-weight: 500; letter-spacing: 0.01em; }

/* 全站欄位：圖二樣式（大圓角／淺邊框／充裕內距） */
input:not([type]),
input[type=text], input[type=password], input[type=email], input[type=number],
input[type=date], input[type=datetime-local], input[type=time], input[type=month],
input[type=week], input[type=file], input[type=tel], input[type=url],
input[type=search], select, textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: var(--field-min-h);
  padding: var(--field-pad-y) var(--field-pad-x);
  border: 1px solid var(--field-border);
  border-radius: var(--field-radius);
  font-size: 14px;
  line-height: 1.45;
  /* 網頁字型（Noto Sans TC）會讓 Windows 注音無法組字，欄位改用系統字型 */
  font-family: "Microsoft JhengHei UI", "Microsoft JhengHei", "PingFang TC", sans-serif;
  color: var(--text);
  background: #fff;
  box-shadow: none;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
input:not([type]),
input[type=text], input[type=password], input[type=email],
input[type=tel], input[type=url], input[type=search], textarea {
  -webkit-appearance: auto;
  appearance: auto;
  line-height: normal;
}
input[type=number], select {
  -webkit-appearance: none;
  appearance: none;
}
.tt-password {
  -webkit-text-security: disc;
  text-security: disc;
}
.tt-password:focus,
.tt-password.is-revealed,
.tt-password.is-composing {
  -webkit-text-security: none;
  text-security: none;
}
input[type=file] {
  min-height: auto;
  padding: 10px 14px;
  line-height: 1.3;
}
input::placeholder, textarea::placeholder {
  color: #9CA3AF;
  opacity: 1;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239CA3AF' d='M1.2 1.3L6 6.1l4.8-4.8 1.2 1.2L6 8.5 0 2.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-color: #fff;
  padding-right: 40px;
  cursor: pointer;
}
input[type=date]::-webkit-calendar-picker-indicator,
input[type=datetime-local]::-webkit-calendar-picker-indicator,
input[type=time]::-webkit-calendar-picker-indicator,
input[type=month]::-webkit-calendar-picker-indicator,
input[type=week]::-webkit-calendar-picker-indicator {
  opacity: 0.55;
  cursor: pointer;
  margin-left: 8px;
}
input:hover, select:hover, textarea:hover {
  border-color: var(--field-border-hover);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--tt-gold, var(--gold));
  box-shadow: 0 0 0 3px rgba(196, 165, 116, 0.2);
  background: #fff;
}
textarea {
  min-height: 110px;
  resize: vertical;
}
.form-grid.wide { max-width: none; }
.master-pick {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: var(--field-min-h);
  padding: 4px 6px 4px 0;
  border: 1px solid var(--field-border);
  border-radius: var(--field-radius);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.master-pick:focus-within {
  border-color: var(--tt-gold, var(--gold));
  box-shadow: 0 0 0 3px rgba(196, 165, 116, 0.2);
}
.master-pick input[type=text] {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  min-height: 0;
  height: 36px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.master-pick input[type=text]:hover,
.master-pick input[type=text]:focus {
  border: 0;
  background: transparent;
  box-shadow: none;
}
.master-pick .btn {
  flex: 0 0 auto;
  align-self: center;
  height: 28px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
}
.master-pick .btn:hover { transform: none; opacity: 1; }
.master-pick .pick-query:hover { background: #243652; }
.master-pick .pick-clear {
  background: transparent;
  color: var(--muted);
  border: 0;
  padding: 0 8px;
}
.master-pick .pick-clear:hover { color: var(--text); background: var(--bg-soft); }
.tt-dialog .pick-choose {
  height: 28px;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  box-shadow: none;
}
.tt-dialog .pick-choose:hover { transform: none; }
.tt-dialog .pick-choose.is-on {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.master-pick.duty-pick {
  flex-wrap: wrap;
  height: auto;
  align-items: center;
  padding: 4px 6px 4px 8px;
}
.duty-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}
.duty-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 2px 4px 2px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--navy);
  font-size: 12px;
  line-height: 1.4;
}
.duty-chip button {
  border: 0;
  background: transparent;
  color: var(--muted);
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.duty-chip button:hover { background: #e2e8f0; color: var(--text); }
.master-pick.duty-pick input[data-duty-placeholder] { flex: 1 1 140px; }

/* 勾選列改為同系圓角淺框 */
.form-grid label:has(> input[type=checkbox]),
.form-grid label:has(> input[type=radio]) {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  min-height: var(--field-min-h);
  padding: 10px 14px;
  border: 1px solid var(--field-border);
  border-radius: var(--field-radius);
  background: #fff;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
}
.form-grid label:has(> input[type=checkbox]):hover,
.form-grid label:has(> input[type=radio]):hover {
  border-color: var(--field-border-hover);
  background: #F9FAFB;
}
.form-grid input[type=checkbox],
.form-grid input[type=radio] {
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  -webkit-appearance: auto;
  appearance: auto;
  accent-color: var(--tt-navy, var(--navy));
}
.option-row input[name=optionText] {
  min-height: 42px;
}

.service-list {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  max-width: 720px;
}
.service-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  margin-bottom: 8px;
}
.service-item::before {
  content: "•";
  color: var(--accent);
  font-weight: 700;
  margin-right: 4px;
}
.empty-hint {
  margin-top: 20px;
  color: var(--muted);
  font-size: 14px;
}

.page-lead { color: var(--muted); margin: -4px 0 20px; font-size: 14px; }

.manual-toc { max-width: 860px; }
.manual-toc-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.manual-toc-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.manual-toc-row .manual-toc-btn { flex: 1; margin: 0; }
.manual-toc-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff 0%, #f7f9fc 100%);
  color: var(--navy);
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 28, 46, .04);
  transition: border-color .15s, box-shadow .15s, transform .15s, background .15s;
}
.manual-toc-btn:hover {
  border-color: var(--gold);
  box-shadow: 0 6px 16px rgba(26, 42, 64, .08);
  transform: translateY(-1px);
  color: var(--navy);
  text-decoration: none;
  background: #fff;
}
.manual-toc-btn--sub {
  background: #fff;
  padding: 12px 14px;
}
.manual-toc-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  background: rgba(201, 166, 107, .18);
}
.manual-toc-label { flex: 1; font-size: 14px; font-weight: 600; line-height: 1.35; }
.manual-toc-arrow {
  color: var(--gold-dark);
  opacity: .55;
  font-size: 14px;
  transition: transform .15s, opacity .15s;
}
.manual-toc-btn:hover .manual-toc-arrow { opacity: 1; transform: translateX(3px); }
.manual-toc-group h3 {
  margin: 28px 0 12px;
  font-size: 15px;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 10px;
}
.manual-toc-group h3::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.manual-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.manual-side-nav {
  position: sticky;
  top: 16px;
  background: linear-gradient(180deg, #fff 0%, #f5f7fb 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 0 10px;
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(15, 28, 46, .06);
}
.manual-back {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 10px 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  background: rgba(26, 42, 64, .04);
  transition: background .15s, border-color .15s;
}
.manual-back-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 12px;
}
.manual-back:hover {
  background: rgba(201, 166, 107, .15);
  border-color: rgba(201, 166, 107, .35);
  color: var(--navy);
  text-decoration: none;
}
.manual-side-scroll {
  overflow: auto;
  padding: 0 10px 8px;
}
.manual-nav-item {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0 0 6px;
}
.manual-nav-item .manual-nav-btn {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  margin: 0;
}
.manual-nav-item .manual-nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.manual-status {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
  padding: 0;
}
.manual-status select {
  width: 84px;
  min-width: 84px;
  min-height: 28px;
  padding: 2px 20px 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  background-position: right 7px center;
  background-size: 8px 6px;
}
.manual-status select.is-done {
  background-color: #e8f7ee;
  color: #1f8a4c;
  border-color: #8ed4ab;
}
.manual-status select.is-todo {
  background-color: #fdecea;
  color: #c23838;
  border-color: #f0b4b4;
}
.manual-group-pct { letter-spacing: 0; }
.manual-nav-btn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  margin: 0 0 6px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.35;
  box-sizing: border-box;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.manual-nav-btn:hover {
  background: #fff;
  border-color: var(--border);
  color: var(--navy);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(15, 28, 46, .05);
}
.manual-nav-btn.active {
  background: linear-gradient(90deg, rgba(201, 166, 107, .22), rgba(201, 166, 107, .08));
  border-color: rgba(201, 166, 107, .45);
  color: var(--navy);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--gold);
}
.manual-nav-btn--sub { padding-left: 10px; }
.manual-nav-num {
  flex-shrink: 0;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--navy);
  background: rgba(26, 42, 64, .06);
}
.manual-nav-btn.active .manual-nav-num,
.manual-nav-btn:hover .manual-nav-num {
  background: rgba(201, 166, 107, .28);
  color: var(--navy-dark);
}
.manual-nav-label { flex: 1; }
.manual-side-group { margin-top: 12px; padding-top: 4px; }
.manual-side-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 2px 8px;
}
.manual-side-group-head .manual-side-group-title { margin: 0; }
.manual-add-btn {
  border: 0;
  background: var(--navy);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  cursor: pointer;
}
.manual-add-dialog {
  border: 0;
  border-radius: 16px;
  padding: 18px;
  width: min(420px, 92vw);
}
.manual-add-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.manual-version-dialog {
  border: 0;
  border-radius: 16px;
  padding: 18px;
  width: min(760px, 94vw);
  max-height: 90vh;
  overflow: auto;
}
.manual-version-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.manual-version-dialog .mind-stage { height: 420px; }
.manual-version-block { margin: 8px 0 18px; }
.manual-version-block h3 { margin: 0 0 8px; font-size: 16px; }
table.data tr.is-viewing td { background: #eef3f9; }
.slug-prefix {
  padding: 8px 10px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-family: ui-monospace, monospace;
  color: #374151;
}
.manual-add-actions { display: flex; gap: 8px; }
.flow-choice { display: grid; gap: 8px; margin-top: 14px; }
.flow-choice .btn { width: 100%; }
.flow-draw[hidden] { display: none !important; }
.flow-image-form {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.manual-service-list { list-style: none; margin: 8px 0 16px; padding: 0; display: grid; gap: 8px; }
.manual-service-list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.mind-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.mind-stage {
  position: relative;
  height: 640px;
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background:
    radial-gradient(circle at 1px 1px, rgba(26, 42, 64, .07) 1px, transparent 0) 0 0 / 22px 22px,
    linear-gradient(180deg, #f8fafc, #fff);
}
.mind-board[data-editable="false"] .mind-stage {
  height: auto;
  min-height: 0;
  overflow: hidden;
}
.mind-lines { position: absolute; inset: 0; width: 1600px; height: 900px; pointer-events: none; overflow: visible; }
.mind-lines line,
.mind-lines path { fill: none; stroke: #8aa0b8; stroke-width: 2; }
.mind-canvas { position: relative; width: 1600px; height: 900px; }
.mind-board[data-editable="false"] .mind-canvas,
.mind-board[data-editable="false"] .mind-lines { width: auto; height: auto; }
.mind-node {
  position: absolute;
  min-width: 120px;
  max-width: 240px;
  padding: 10px 16px;
  border: 1px solid #d5deea;
  border-radius: 999px;
  background: #fff;
  color: #1a2a40;
  cursor: grab;
  user-select: none;
  box-shadow: 0 8px 18px rgba(26, 42, 64, .08);
  line-height: 1.35;
}
.mind-board[data-editable="true"] .mind-node {
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
  caret-color: #1a2a40;
}
.mind-board[data-editable="true"] .mind-node-root { caret-color: #fff; }
.mind-board[data-editable="true"] .mind-node:focus {
  outline: 2px solid #c9a66b;
  outline-offset: 2px;
}
.mind-board[data-editable="false"] .mind-node { cursor: default; }
.mind-node-root {
  background: #1a2a40;
  color: #fff;
  font-weight: 700;
  border-color: #1a2a40;
  box-shadow: 0 10px 22px rgba(26, 42, 64, .18);
}
.mind-node.is-selected { outline: 2px solid #c9a66b; outline-offset: 2px; }
.mind-json { display: none; }
.mind-board[hidden],
img.mind-upload[hidden] { display: none !important; }
.mind-upload { display: block; max-width: 100%; margin: 12px 0; border-radius: 12px; border: 1px solid #e5e7eb; }
.manual-side-group-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 2px 8px;
  padding: 6px 10px;
  border-radius: 999px;
  width: fit-content;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--navy);
  background: rgba(201, 166, 107, .2);
}
.manual-main h5 { margin: 14px 0 6px; font-size: 14px; color: var(--navy); }
.manual-link-list {
  list-style: none;
  margin: 16px 0;
  padding: 0;
  display: grid;
  gap: 10px;
  max-width: 480px;
}
.manual-link-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.manual-link-btn:hover {
  border-color: var(--gold);
  box-shadow: 0 6px 16px rgba(26, 42, 64, .08);
  transform: translateY(-1px);
  color: var(--navy);
  text-decoration: none;
}
.manual-cta { padding: 12px 20px; border-radius: 10px; }

.flow-editor { margin: 12px 0 8px; }
.flow-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, #fff, #f5f7fb);
}
.flow-toolbar-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-right: 2px;
}
.flow-toolbar-sep {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 4px;
}
.flow-tool {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--navy);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.flow-tool:hover {
  border-color: var(--gold);
  box-shadow: 0 2px 8px rgba(26,42,64,.06);
}
.flow-tool.active {
  background: rgba(201, 166, 107, .2);
  border-color: var(--gold);
  color: var(--navy-dark);
}
.flow-tool-danger { color: #8b2e2e; }
.flow-hint {
  margin: 0;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--muted);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: #fbfcfe;
}
.flow-canvas-wrap {
  border: 1px solid var(--border);
  border-radius: 0 0 12px 12px;
  overflow: auto;
  background: #fbfcfe;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.flow-editor + .flow-canvas-wrap { border-radius: 0 0 12px 12px; }
.flow-canvas-wrap:first-child,
.manual-main > .flow-canvas-wrap {
  border-radius: 12px;
}
.flow-canvas {
  width: 100%;
  min-height: 520px;
  display: block;
  cursor: crosshair;
}
.flow-node.selected rect,
.flow-node.selected polygon {
  stroke: var(--gold-dark) !important;
  stroke-width: 2.2 !important;
  filter: drop-shadow(0 2px 4px rgba(201,166,107,.35));
}
.flow-edge.selected { stroke: var(--gold-dark) !important; stroke-width: 2.4 !important; }
.flow-node-text {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #1a2a40;
  line-height: 1.25;
  word-break: break-word;
  pointer-events: none;
  font-family: "Noto Serif TC", "Source Han Serif TC", "Songti TC", serif;
}
.flow-json { display: none; }

.form-list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.site-edit-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.9fr);
  gap: 16px;
  align-items: start;
}
.site-preview {
  position: sticky;
  top: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}
.site-preview-head {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #1a2a40;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
}
.cover-crop-backdrop[hidden] { display: none !important; }
.cover-crop-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.cover-crop-dialog {
  width: min(720px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.2);
}
.cover-crop-stage {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #111;
  border-radius: 12px;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}
.cover-crop-stage canvas { width: 100%; height: 100%; display: block; }
.cover-crop-zoom { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.cover-crop-zoom input { flex: 1; }
.site-preview iframe {
  display: block;
  width: 100%;
  height: min(78vh, 820px);
  min-height: 520px;
  border: 0;
  background: #fff;
}
@media (max-width: 1100px) {
  .site-edit-split { grid-template-columns: 1fr; }
  .site-preview { position: static; }
}
.manual-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
}
.form-section-title {
  margin: 18px 0 4px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(26, 42, 64, .05);
  color: var(--navy);
  font-weight: 700;
  font-size: 14px;
}
.training-form .check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding-top: 4px;
}
.training-form .check-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--navy);
  font-weight: 500;
}
.training-form .check-inline input { width: auto; }
table.data tr.row-selected td {
  background: rgba(201, 166, 107, .12);
}

@media (max-width: 900px) {
  .manual-layout { grid-template-columns: 1fr; }
  .manual-side-nav { position: static; max-height: none; }
  .form-list-head { flex-direction: column; }
}


/* ── Tabs ── */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
}
.tabs a {
  padding: 7px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
}
.tabs a:hover { text-decoration: none; background: var(--bg-soft); border-color: var(--gold-light); }
.tabs a.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.sub-tabs { margin-top: -8px; }

.progress {
  height: 8px;
  background: #e8edf2;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}
.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-radius: 99px;
}

.check-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.check-row input { width: auto; }
.section-card { margin-bottom: 18px; }
.qr-box { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.qr-box img { width: 140px; height: 140px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.public-wrap {
  max-width: 560px;
  margin: 40px auto;
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.swot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.version-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; }
.work-cards { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.work-cards .card h3 { margin: 0 0 8px; color: var(--navy); font-size: 16px; }
.work-cards .card p { color: var(--muted); font-size: 13px; margin: 0; }
.work-cards .card .links { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.year-switch { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; max-width: 520px; }
.year-switch label { margin: 0; white-space: nowrap; }
.phase-nav { margin-bottom: 16px; }
.phase-nav .tabs a.active { background: var(--navy); border-color: var(--navy); }
.doc-list { margin: 0 0 12px 18px; color: var(--muted); font-size: 13px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 16px; margin: 12px 0; }
.check-grid label { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text); margin: 0; }
.check-grid input { width: auto; margin-top: 3px; }
h3 { margin: 20px 0 10px; font-size: 16px; color: var(--navy); font-weight: 600; }
.field-error { color: var(--danger); font-size: 12px; margin-top: 4px; }
.pager { margin-top: 12px; display: flex; gap: 8px; }

/* ── Login ── */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 480px;
}
.login-hero {
  background: linear-gradient(160deg, var(--navy-dark) 0%, var(--navy) 50%, #2a4a6b 100%);
  color: #fff;
  padding: 60px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.login-hero-content { position: relative; z-index: 1; max-width: 480px; }
.login-hero-badge {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid rgba(201,166,107,.4);
  border-radius: 20px;
  font-size: 12px;
  color: var(--gold-light);
  margin-bottom: 24px;
}
.login-hero h1 {
  margin: 0 0 16px;
  font-size: 42px;
  font-weight: 700;
  line-height: 1.2;
}
.login-hero h1 em {
  font-style: normal;
  color: var(--gold);
}
.login-hero p.lead {
  font-size: 16px;
  color: rgba(255,255,255,.7);
  margin: 0 0 36px;
  line-height: 1.7;
}
.login-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.login-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(201,166,107,.2);
  border: 1px solid var(--gold);
  color: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.login-step-text { font-size: 14px; color: rgba(255,255,255,.8); }
.login-step-text strong { display: block; color: #fff; font-size: 14px; margin-bottom: 2px; }

.login-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--bg-soft);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.login-card h2 { margin: 0 0 6px; color: var(--navy); font-size: 22px; font-weight: 700; }
.login-card p.lead { color: var(--muted); margin: 0 0 24px; font-size: 14px; }
.demo-box {
  margin-top: 20px;
  background: var(--bg-soft);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
}
.demo-box strong { color: var(--navy); display: block; margin-bottom: 8px; }
.demo-box table { width: 100%; }
.demo-box td { padding: 3px 0; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--navy-dark), var(--navy));
}

/* ── Sidebar logout ── */
.sidebar-logout {
  margin-left: auto;
  flex-shrink: 0;
}
.sidebar-logout .btn {
  color: rgba(255,255,255,.7);
  border-color: rgba(255,255,255,.2);
  padding: 4px 10px;
  font-size: 12px;
}
.sidebar-logout .btn:hover {
  color: #fff;
  border-color: rgba(255,255,255,.4);
  background: rgba(255,255,255,.08);
}

/* ── Year menu (header) ── */
.year-menu {
  position: relative;
}
.year-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.year-menu-toggle:hover,
.year-menu.open .year-menu-toggle {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 166, 107, .15);
}
.year-menu-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.year-menu-toggle strong {
  font-size: 14px;
  color: var(--navy);
}
.year-menu-caret {
  font-size: 11px;
  color: var(--muted);
  transition: transform .15s;
}
.year-menu.open .year-menu-caret {
  transform: rotate(180deg);
}
.year-menu-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 260px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 35, 55, .14);
  z-index: 40;
  overflow: hidden;
}
.year-menu.open .year-menu-panel {
  display: block;
}
.year-menu-section {
  padding: 12px;
  max-height: 280px;
  overflow-y: auto;
}
.year-menu-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.year-menu-empty {
  font-size: 13px;
  color: var(--muted);
  padding: 8px 4px;
}
.year-menu-item {
  margin: 0;
}
.year-menu-item button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.year-menu-item button:hover {
  background: rgba(201, 166, 107, .12);
}
.year-menu-item button.active {
  background: rgba(201, 166, 107, .2);
  color: var(--navy);
  font-weight: 600;
}
.year-menu-tag {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 99px;
  background: var(--navy);
  color: #fff;
}
.year-menu-footer {
  border-top: 1px solid var(--line);
  padding: 10px 12px;
}
.year-menu-footer a {
  display: block;
  text-align: center;
  padding: 9px 10px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--navy-dark);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}
.year-menu-footer a:hover {
  filter: brightness(1.05);
}

/* ── Eval dashboard (評核管理) ── */
.eval-dash .ready-num { color: var(--ok); }
.eval-dash .partial-num { color: var(--info); }
.eval-dash .missing-num { color: var(--danger); }
.mini-bar {
  display: inline-block;
  width: 64px;
  height: 6px;
  background: #e8edf2;
  border-radius: 99px;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 6px;
}
.mini-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
}
.mini-pct {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.prep-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}
.prep-badge.ready { background: #e8f7ef; color: var(--ok); }
.prep-badge.partial { background: #e8f0fa; color: var(--info); }
.prep-badge.missing { background: #fdeceb; color: var(--danger); }
.indicator-link {
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.indicator-link:hover {
  color: var(--gold-dark);
  border-bottom-color: var(--gold);
}
.eval-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}
.eval-detail-grid > .panel {
  display: flex;
  flex-direction: column;
  min-height: 168px;
  height: 100%;
}
.eval-detail-grid > .panel > .hint,
.eval-detail-grid > .panel > p {
  flex: 0 0 auto;
}
.eval-detail-grid > .panel > .panel-actions {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.course-plan-panel {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  min-height: 180px;
}
.course-plan-panel .panel-actions {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.eval-subhead {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
}
.eval-subhead.required { color: #b45309; }
.eval-subhead.support { color: #1d4ed8; margin-top: 18px; }
.eval-check-list {
  margin: 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
.eval-doc-list {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
}
.eval-doc-list.evidence-check-list {
  list-style: none;
  padding-left: 0;
  gap: 0;
}
.evidence-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.evidence-row:last-child { border-bottom: none; }
.evidence-main {
  min-width: 0;
  flex: 1;
  line-height: 1.45;
}
.evidence-title { font-weight: 600; color: #0f2744; }
.evidence-status-boxes {
  display: inline-flex;
  gap: 6px;
  flex-shrink: 0;
  margin: 0;
}
.evidence-status-boxes.readonly { pointer-events: none; opacity: 0.75; }
.status-box {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  padding: 7px 12px;
  border: 1.5px solid #d7dde7;
  border-radius: 10px;
  background: #fff;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
  user-select: none;
}
.status-box input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.status-box:hover {
  border-color: #aeb8c7;
  box-shadow: 0 1px 2px rgba(15, 39, 68, 0.06);
}
.status-box.todo.active {
  background: #fdeceb;
  border-color: #e07a7a;
  color: #a32d2d;
  box-shadow: inset 0 0 0 1px rgba(211, 69, 69, 0.12);
}
.status-box.done.active {
  background: #e8f7ef;
  border-color: #3dad6e;
  color: #1b6b42;
  box-shadow: inset 0 0 0 1px rgba(47, 158, 100, 0.15);
}
.db-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}
.db-switch a {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
}
.db-switch a.active,
.db-switch a:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.row-actions { white-space: nowrap; }
.row-actions form { display: inline; margin-left: 6px; }
.status-box.na.active {
  background: #eef2f6;
  border-color: #8b97a8;
  color: #3d4a5c;
  box-shadow: inset 0 0 0 1px rgba(61, 74, 92, 0.12);
}
.eval-doc-list.required li::marker { color: #b45309; }
.eval-doc-list.support li::marker { color: #1d4ed8; }
.eval-doc-links a {
  color: #0f2744;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.eval-doc-links a:hover {
  color: var(--gold-dark, #9a7b2f);
  border-bottom-color: var(--gold, #c9a24a);
}
.eval-doc-links .hint {
  font-weight: 400;
  color: #5b6b7c;
}
.i1-groups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.i1-group .panel-head h3 { margin-bottom: 4px; }
.i1-item-list,
.i1-item-list-plain {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.i1-item-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid #e5e9ef;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  background: #fbfcfe;
}
.i1-item-link:hover {
  border-color: #c9a24a;
  background: #fffdf8;
}
.i1-item-link strong { color: #0f2744; font-size: 14px; }
.i1-item-link span { color: #5b6b7c; font-size: 12px; line-height: 1.45; }
.i1-group-actions { margin-top: 12px; }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.dash-card { padding: 20px; }
.course-dashboard-grid .dash-card {
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.course-dashboard-grid .dash-card-value {
  margin-top: 6px;
  word-break: break-word;
}
.course-dashboard-grid .dash-card-value .tt-badge {
  font-size: 14px;
  font-weight: 700;
}
.dash-num {
  font-size: 32px;
  font-weight: 700;
  color: #0f2744;
  margin-top: 8px;
}
@media (max-width: 900px) {
  .dash-cards { grid-template-columns: 1fr; }
  .course-dashboard-grid { grid-template-columns: 1fr; }
}
.eval-rules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 12px;
}
@media (max-width: 900px) {
  .eval-detail-grid, .eval-rules-grid, .i1-groups { grid-template-columns: 1fr; }
}
.doc-check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.doc-check-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f7f9fb;
  border: 1px solid var(--line);
}
.doc-check-list li.ok { background: #f3faf6; border-color: #cfe9d9; }
.doc-check-list li.warn { background: #fff8f0; border-color: #f0e0c8; }
.doc-check-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--line);
}
.doc-check-list li.ok .doc-check-mark {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.doc-check-list li.warn .doc-check-mark {
  background: #f5a623;
  border-color: #f5a623;
  color: #fff;
}
.doc-check-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}
.doc-check-detail {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.quick-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quick-links a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--navy);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.quick-links a:hover {
  border-color: var(--gold);
  background: rgba(201, 166, 107, .08);
}

@media print {
  .sidebar, .header, .btn, form, .tabs, .flash { display: none !important; }
  .content { margin: 0; padding: 0; }
}

@media (max-width: 1100px) {
  .dashboard-grid, .dashboard-bottom { grid-template-columns: 1fr; }
  .eval-panel { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .form-grid { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: 1fr; }
  .login-hero { padding: 40px 28px; min-height: auto; }
  .login-hero h1 { font-size: 28px; }
  .sidebar { position: static; width: 100%; }
  .header, .content { margin-left: 0; }
}

/* Course map auto-draw */
.course-map-tree { display: flex; flex-direction: column; gap: 18px; padding: 8px 4px 4px; }
.cm-major { border-left: 3px solid #2f6fed; padding-left: 14px; }
.cm-node { display: inline-block; padding: 8px 14px; border-radius: 8px; margin: 4px 0; font-size: 13px; line-height: 1.35; }
.cm-node-major { background: #e8f0fe; color: #0f2744; font-weight: 700; font-size: 15px; }
.cm-mids { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; padding-left: 8px; }
.cm-mid { min-width: 180px; flex: 1; border-left: 2px solid #9bb8f0; padding-left: 12px; }
.cm-node-mid { background: #f3f7fd; color: #1e3a5f; font-weight: 600; }
.cm-courses { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; padding-left: 6px; }
.i1-item-link.active-demand {
  border-color: var(--gold);
  background: rgba(201, 166, 107, .12);
}

.evidence-apply { margin: 0; flex-shrink: 0; }
.evidence-apply .btn[disabled] { opacity: .55; cursor: not-allowed; }
.org-tree-wrap { overflow-x: auto; padding: 8px 0 4px; }
.org-chart, .org-chart ul {
  display: flex;
  justify-content: center;
  padding-left: 0;
  margin: 0;
  list-style: none;
}
.org-chart ul { padding-top: 18px; }
.org-chart li {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding: 18px 10px 0;
}
.org-chart li::before,
.org-chart li::after {
  content: "";
  position: absolute;
  top: 0;
  width: 50%;
  height: 18px;
  border-top: 1px solid #c4b48a;
}
.org-chart li::before { right: 50%; }
.org-chart li::after { left: 50%; border-left: 1px solid #c4b48a; }
.org-chart li:only-child::before,
.org-chart li:only-child::after { display: none; }
.org-chart li:first-child::before,
.org-chart li:last-child::after { border: 0; }
.org-chart li:last-child::before { border-right: 1px solid #c4b48a; }
.org-chart > li::before,
.org-chart > li::after { display: none; }
.org-tree-wide .org-node { width: 280px; }
.org-tree-wide .org-node-collapsed { width: 220px; }
.chart-thumb {
  border: 1px solid #e6dcc8;
  background: #fff;
  border-radius: 12px;
  padding: 6px;
  cursor: pointer;
}
.chart-thumb img { display: block; max-width: 280px; max-height: 180px; }
.org-node-summary {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: center;
  font-weight: 600;
  color: #0f2744;
  cursor: pointer;
  padding: 4px 2px;
  font-size: 13px;
}
.org-node {
  position: relative;
  width: 220px;
  background: #fff;
  border: 1px solid #d6c4a2;
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 2px rgba(15, 39, 68, .04);
}
.org-node-cols { display: flex; flex-direction: column; gap: 8px; }
.org-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  font-size: 12px;
  color: #64748b;
}
.org-col input,
.org-col textarea { width: 100%; }
.org-node::before {
  content: "";
  position: absolute;
  top: -18px;
  left: 50%;
  height: 18px;
  border-left: 1px solid #c4b48a;
}
.org-chart > li > .org-node::before { display: none; }
.org-node input,
.org-node textarea {
  width: 100%;
  border: 1px solid #e6dcc8;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
  line-height: normal;
  font-family: "Microsoft JhengHei UI", "Microsoft JhengHei", "PingFang TC", sans-serif;
}
.org-node textarea { min-height: 52px; resize: vertical; }
.org-node-actions { display: flex; gap: 6px; justify-content: center; }
.org-tree-readonly .org-node-actions { display: none; }
.org-tree-readonly .org-node input,
.org-tree-readonly .org-node textarea {
  border: none;
  background: transparent;
  text-align: center;
  font-weight: 600;
  color: #0f2744;
  resize: none;
}
.evidence-preview-box { margin-top: 10px; }
.evidence-preview {
  display: block;
  width: 100%;
  max-height: 720px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f9fc;
}
iframe.evidence-preview { height: 640px; background: #fff; }
img.evidence-preview { height: auto; object-fit: contain; }

input:not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=reset]):not([type=hidden]):not([type=file]):not([type=image]):not([type=range]):not([type=color]),
textarea {
  font-family: "Microsoft JhengHei UI", "Microsoft JhengHei", "PingFang TC", sans-serif;
  line-height: normal;
}

.sys-announce {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
}
.sys-announce article {
  background: #fff8e8;
  border: 1px solid #ead7a4;
  border-radius: 12px;
  padding: 12px 14px;
}
.sys-announce strong { display: block; margin-bottom: 4px; color: #7a5b16; }
.sys-announce p { margin: 0; white-space: pre-wrap; color: #3f3a32; line-height: 1.55; }
.hint { color: #64748b; font-size: 13px; margin: 0 0 12px; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.inline-form input[type=password], .inline-form input[type=text] {
  width: 140px;
  padding: 6px 8px;
}

.org-logo-row { display: flex; align-items: flex-start; gap: 16px; }
.org-logo-preview {
  width: 72px; height: 72px; object-fit: contain;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.cal-nav { display: flex; align-items: center; gap: 10px; }
.cal-toolbar-actions { display: flex; align-items: center; gap: 12px; }
.tt-dialog-backdrop.cal-add-dialog[hidden] { display: none !important; }
.tt-dialog-backdrop.cal-add-dialog.is-open { display: flex; }
.cal-add-dialog .tt-dialog { width: min(720px, 100%); }
.cal-add-dialog .form-grid { background: transparent; border: 0; box-shadow: none; padding: 0; max-width: none; }
.cal-add-dialog [hidden] { display: none !important; }
.cal-add-dialog button.tt-source-card { width: 100%; font: inherit; appearance: none; }
.cal-form-actions { display: flex; justify-content: space-between; gap: 8px; }
.cal-legend { display: flex; gap: 8px; margin-bottom: 12px; }
.cal-tag { font-size: 12px; border-radius: 999px; padding: 2px 8px; }
.cal-tag.course { background: #e7f0fb; color: #1d4e89; }
.cal-tag.activity { background: #e7f6ee; color: #1d6b45; }
.cal-tag.todo { background: #fff4d6; color: #8a5a00; }
.cal-tag.receivable { background: #fde8e4; color: #9a3412; }
.cal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, .8fr);
  column-gap: 16px;
  row-gap: 4px;
  align-items: start;
}
.month-cal-head {
  grid-column: 1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.month-cal-head span,
.month-cal-dow { text-align: center; font-size: 12px; color: #64748b; padding: 4px 0; }
.month-cal { grid-column: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-day { grid-column: 2; grid-row: 2; }
.month-cal > a {
  min-height: 88px; border: 1px solid #e6ebf2; border-radius: 8px; padding: 6px;
  background: #fff; color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: 3px;
}
.month-cal > a.other { opacity: .35; pointer-events: none; }
.month-cal > a.today { border-color: #1d4e89; }
.month-cal > a.selected { background: #f4f8fd; box-shadow: inset 0 0 0 1px #1d4e89; }
.month-cal-num { font-size: 12px; font-weight: 700; }
.month-cal-chip {
  font-size: 11px; line-height: 1.3; border-radius: 4px; padding: 1px 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.month-cal-chip.course { background: #e7f0fb; color: #1d4e89; }
.month-cal-chip.activity { background: #e7f6ee; color: #1d6b45; }
.month-cal-chip.todo { background: #fff4d6; color: #8a5a00; }
.month-cal-chip.receivable { background: #fde8e4; color: #9a3412; }
.cal-day { border: 1px solid #e6ebf2; border-radius: 12px; padding: 14px; background: #fff; }
.cal-day h3 { margin: 0 0 10px; }
.cal-day h4 { margin: 12px 0 6px; font-size: 14px; }
.cal-day ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cal-day li { display: flex; flex-direction: column; gap: 2px; }
.cal-day li small, .cal-day .muted { color: #64748b; font-size: 12px; }
.todo-list li { flex-direction: row; align-items: flex-start; gap: 8px; }
.todo-list li.done strong { text-decoration: line-through; color: #64748b; }
.todo-list form { margin: 0; }
.todo-list button { border: 0; background: transparent; color: #1d4e89; cursor: pointer; padding: 0; font-size: 12px; }
@media (max-width: 900px) {
  .cal-layout { grid-template-columns: 1fr; }
  .month-cal-head, .month-cal, .cal-day { grid-column: 1; grid-row: auto; }
}
