/* 工作台視覺：暖白底、墨綠導覽與可辨識的職務色彩。 */
:root[data-theme="light"] {
  --bg: var(--tone-f5f6f2, #f5f6f2);
  --sf: #fff;
  --tx: var(--tone-243b33, #243b33);
  --mu: var(--tone-79867f, #79867f);
  --bd: var(--tone-e5e9e1, #e5e9e1);
  --ac: var(--tone-245b46, #245b46);
  --n: var(--tone-e7eee3, #e7eee3);
  --nt: var(--tone-41683e, #41683e);
  --h: var(--tone-e0eeed, #e0eeed);
  --ht: var(--tone-377375, #377375);
  --yb: #fbf0d7;
  --y: #a0782e;
  --rb: #fae6e3;
  --r: #af5149;
  scroll-behavior: smooth;
}
body {
  font:
    14px/1.65 "Microsoft JhengHei",
    "PingFang TC",
    system-ui,
    sans-serif;
  user-select: text;
  letter-spacing: 0.015em;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  transition:
    background 0.18s,
    border-color 0.18s,
    box-shadow 0.18s;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--tone-96b99b, #96b99b);
  outline-offset: 3px;
}
button svg {
  pointer-events: none;
}
svg.icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
  flex: none;
}
[hidden] {
  display: none !important;
}
#ld {
  padding: 25vh 20px;
  text-align: center;
  color: var(--mu);
}
#app {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  max-width: none;
  padding: 0;
  gap: 0;
  min-height: 100vh;
  align-content: stretch;
  align-items: stretch;
}
.rail {
  background: var(--tone-183f34, #183f34);
  color: var(--tone-e4eddf, #e4eddf);
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 35px 18px 16px;
  display: flex;
  flex-direction: column;
  z-index: 2;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
  margin: 0 13px 50px;
}
.brand img {
  width: 42px;
  height: 42px;
}
.brand > span {
  font-size: 24px;
  letter-spacing: 5px;
  font-weight: 700;
  line-height: 1.4;
}
.brand small {
  display: block;
  font-size: 10px;
  letter-spacing: 1.8px;
  color: var(--tone-a0b7a8, #a0b7a8);
  font-weight: 400;
  margin-top: 3px;
  white-space: nowrap;
}
.rail-caption {
  padding: 0 17px;
  margin-bottom: 12px;
  color: var(--tone-86a595, #86a595);
  font-size: 11px;
  letter-spacing: 2px;
}
.rail nav {
  display: grid;
  gap: 7px;
}
.rail-link {
  border: 0;
  background: transparent;
  color: var(--tone-b5c7bc, #b5c7bc);
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: left;
  width: 100%;
  padding: 13px 17px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
}
.rail-link:hover {
  background: var(--tone-254d40, #254d40);
}
.rail-link.active {
  background: var(--tone-325b48, #325b48);
  color: var(--tone-f1f4e8, #f1f4e8);
}
.nav-dot {
  height: 5px;
  width: 5px;
  background: var(--tone-d3e1b1, #d3e1b1);
  border-radius: 50%;
  margin-left: auto;
}
.rail-note {
  margin: auto 13px 28px;
  padding-top: 65px;
  font-size: 12px;
  color: var(--tone-a2baaa, #a2baaa);
}
.rail-note > svg {
  display: block;
  width: 30px;
  height: 30px;
  margin-bottom: 15px;
  stroke: var(--tone-cedcab, #cedcab);
}
.rail-note b {
  display: block;
  color: var(--tone-dfebd8, #dfebd8);
  font-weight: 500;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}
.rail-note p {
  margin: 0;
  font-size: 11px;
}
.rail-rule {
  display: block;
  width: 25px;
  border-top: 1px solid var(--tone-58735e, #58735e);
  margin: 25px 0 16px;
}
.rail-note small {
  font-size: 10px;
  letter-spacing: 0.1em;
}
.rail-bottom {
  border-top: 1px solid var(--tone-355648, #355648);
  padding: 18px 8px 0;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  color: var(--tone-a9beaf, #a9beaf);
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tone-b5ca8d, #b5ca8d);
}
.version {
  margin-left: auto;
  color: var(--tone-769787, #769787);
}
.workspace {
  min-width: 0;
}
.topbar {
  height: 79px;
  border-bottom: 1px solid var(--bd);
  background: var(--tone-fcfdf9, #fcfdf9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 36px;
  margin: 0;
  grid-column: auto;
  position: relative;
}
.breadcrumb {
  font-size: 12px;
  color: var(--tone-8b968d, #8b968d);
  white-space: nowrap;
}
.breadcrumb span {
  padding: 0 12px;
  color: var(--tone-bdc5ba, #bdc5ba);
}
.breadcrumb b {
  font-weight: 500;
  color: var(--tone-48634f, #48634f);
}
.account {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.account #who {
  font-size: 12px;
  font-weight: 500;
  margin: 0;
  color: var(--tone-5f7265, #5f7265);
}
.account #cm {
  font-size: 11px;
  color: var(--tone-71836f, #71836f);
}
.account-divider {
  height: 20px;
  border-left: 1px solid var(--bd);
}
.account .b {
  font-size: 12px;
  padding: 7px 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.account .b svg {
  width: 15px;
  height: 15px;
}
main {
  padding: 30px 36px 0;
  max-width: 1670px;
  margin: auto;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--tone-899383, #899383);
  margin: 0 0 5px;
  font-weight: 500;
}
.page-heading h1 {
  font-size: 28px;
  letter-spacing: 2px;
  font-weight: 700;
  line-height: 1.5;
  margin: 0;
}
.heading-dot {
  color: var(--tone-96ae77, #96ae77);
}
.page-subtitle {
  margin: 6px 0 0;
  color: var(--tone-7b867c, #7b867c);
  font-size: 12px;
}
.today-label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  color: var(--tone-80907e, #80907e);
  padding-top: 24px;
}
.today-label svg {
  width: 15px;
  height: 15px;
}
.hero {
  height: 223px;
  border-radius: 13px;
  overflow: hidden;
  position: relative;
  background: var(--tone-153e31, #153e31) url("night-team.webp") center 47% /
    cover no-repeat;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    var(--tone-123728b3, #123728b3) 0%,
    var(--tone-12372865, #12372865) 36%,
    transparent 65%
  );
  z-index: -1;
}
.hero-copy {
  position: absolute;
  left: 34px;
  top: 26px;
  color: #f4f0dc;
}
.hero-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--tone-c8d3ad, #c8d3ad);
  font-size: 10px;
  letter-spacing: 2px;
}
.hero-label i {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--tone-b8ce91, #b8ce91);
  border-radius: 50%;
}
.hero h2 {
  font-size: 26px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 2px;
  margin: 12px 0 10px;
}
.hero p {
  font-size: 11px;
  color: var(--tone-b9c9b3, #b9c9b3);
  margin: 0;
}
.hero-index {
  position: absolute;
  right: 22px;
  bottom: 17px;
  color: var(--tone-d0dac3, #d0dac3);
  font-size: 9px;
  letter-spacing: 2px;
}
.overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0;
}
.metric {
  background: #fff;
  border: 1px solid var(--bd);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  min-width: 0;
}
.metric-icon {
  height: 43px;
  width: 43px;
  border-radius: 11px;
  background: var(--tone-f0f4e9, #f0f4e9);
  color: var(--tone-6d885b, #6d885b);
  display: grid;
  place-items: center;
  flex: none;
}
.metric:nth-child(2) .metric-icon {
  background: var(--tone-eaf2ee, #eaf2ee);
  color: var(--tone-6b9182, #6b9182);
}
.metric:nth-child(3) .metric-icon {
  background: #edf0f5;
  color: #7c8caa;
}
.metric:nth-child(4) .metric-icon {
  background: #fbf1dd;
  color: #ad9258;
}
.metric-title {
  font-size: 11px;
  color: var(--tone-85907f, #85907f);
}
.metric-value {
  font-size: 25px;
  line-height: 1.5;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.metric-value small {
  font-size: 11px;
  color: var(--tone-a1aa9a, #a1aa9a);
  margin-left: 6px;
  font-weight: 400;
}
.metric-note {
  font-size: 9px;
  color: var(--tone-9ba594, #9ba594);
  white-space: nowrap;
}
.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 306px;
  gap: 20px;
  align-items: start;
}
#mainc {
  display: block;
  min-width: 0;
  background: white;
  border: 1px solid var(--bd);
  border-radius: 12px;
  padding: 23px 23px 0;
  overflow: hidden;
  scroll-margin-top: 24px;
}
#side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: static;
  overflow: visible;
  max-height: none;
  padding: 0;
  min-width: 0;
}
#side > div:empty {
  display: none;
}
#side > * {
  margin: 0;
}
.calendar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.calendar-top h2 {
  font-size: 20px;
  margin: 3px 0 0;
  letter-spacing: 0.04em;
}
.calendar-top .eyebrow {
  font-size: 9px;
  letter-spacing: 1.6px;
}
.calendar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pill {
  font-size: 10px;
  color: #8b936d;
  background: #f0f2e4;
  border: 1px solid #e6e9d5;
  border-radius: 5px;
  padding: 3px 7px;
  white-space: nowrap;
}
.export-btn {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
}
.export-btn svg {
  width: 15px;
  height: 15px;
}
.b {
  border-radius: 6px;
  background: white;
  border-color: var(--bd);
  padding: 7px 10px;
  color: var(--tone-65735e, #65735e);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
}
.b.pri {
  background: var(--ac);
  border-color: var(--ac);
  color: var(--tone-f5f8ed, #f5f8ed);
}
.b.on {
  background: var(--tone-edf3e7, #edf3e7);
  border-color: var(--tone-7a9c6b, #7a9c6b);
  box-shadow: none;
  color: var(--tone-41653a, #41653a);
}
.b.rn {
  background: var(--n);
  color: var(--nt);
}
.b.rh {
  background: var(--h);
  color: var(--ht);
}
.b:hover {
  filter: none;
  background: var(--tone-f1f5ed, #f1f5ed);
  border-color: var(--tone-b6c6af, #b6c6af);
}
.b.pri:hover {
  background: var(--tone-1b4b39, #1b4b39);
}
.b[disabled] {
  opacity: 0.4;
}
.row {
  gap: 7px;
}
.mu {
  font-size: 11px;
  line-height: 1.8;
}
.nav {
  margin: 22px 0 14px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.month-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}
.nav select {
  border: 0;
  background: #f6f7f2;
  font-size: 11px;
  color: var(--tone-59704f, #59704f);
  padding: 6px 5px;
  border-radius: 5px;
}
.arrow {
  font-size: 18px;
  width: 27px;
  height: 29px;
  line-height: 1;
  padding: 0;
  border: 1px solid var(--bd);
}
.today-btn {
  font-size: 10px;
  padding: 4px 8px;
  margin-left: 3px;
}
.filter {
  display: flex;
  gap: 2px;
  background: var(--tone-f3f5ef, #f3f5ef);
  border-radius: 6px;
  padding: 3px;
}
.filter button {
  border: 0;
  border-radius: 4px;
  font-size: 10px;
  padding: 4px 10px;
  color: var(--tone-88937d, #88937d);
  background: transparent;
  cursor: pointer;
}
.filter button.active {
  background: #fff;
  color: var(--tone-3f6440, #3f6440);
  box-shadow: 0 1px 4px var(--tone-243b3310, #243b3310);
}
#hint:empty,
#fin:empty {
  display: none;
}
#hint {
  background: var(--tone-f3f7ee, #f3f7ee);
  padding: 8px 10px;
  margin-bottom: 12px;
  border-radius: 5px;
  font-size: 10px;
  color: var(--tone-7f916f, #7f916f);
}
.grid {
  gap: 5px;
}
.wk {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--tone-93a08c, #93a08c);
  font-weight: 400;
  padding: 8px 0 12px;
}
.wk:nth-child(6),
.wk:nth-child(7) {
  color: #aa9670;
}
.d {
  border: 1px solid var(--tone-edf0e7, #edf0e7);
  background: #fff;
  border-radius: 6px;
  min-height: 96px;
  gap: 5px;
  padding: 7px 5px;
  position: relative;
}
.d em {
  font-size: 11px;
  font-weight: 500;
  color: var(--tone-6d7a66, #6d7a66);
  display: block;
  line-height: 1.5;
  padding: 0 3px;
  margin-bottom: 2px;
}
.d.hd {
  background: #faf9f2;
}
.d.hd em {
  color: #ab9160;
}
.d.ps {
  opacity: 1;
}
.d.cl {
  background: var(--tone-f5f6f2, #f5f6f2);
  opacity: 1;
  border-color: var(--tone-edf0e7, #edf0e7);
}
.d.cl em {
  color: var(--tone-bdc4b7, #bdc4b7);
}
.d.cl .c {
  background: transparent;
  color: var(--tone-c0c6ba, #c0c6ba);
  font-size: 10px;
  font-weight: 400;
}
.d.today {
  border: 1.5px solid var(--tone-6c9363, #6c9363);
  background: var(--tone-f7faf2, #f7faf2);
}
.d.today em::after {
  content: "今日";
  position: absolute;
  right: 5px;
  top: 9px;
  font-size: 8px;
  color: var(--tone-719462, #719462);
  font-weight: 400;
}
.d:hover {
  border-color: var(--tone-94ac86, #94ac86);
  box-shadow: 0 2px 8px var(--tone-243b330a, #243b330a);
}
.d .c {
  font-size: 10px;
  padding: 3px 2px;
  line-height: 1.6;
  border-radius: 3px;
  font-weight: 500;
  min-height: 22px;
}
.c.n::before,
.c.h::before {
  content: none !important;
}
.c.n,
.c.h {
  text-decoration: none;
}
.d .c.n::after {
  content: " · 監工";
  font-size: 8px;
  opacity: 0.7;
}
.d .c.h::after {
  content: " · 工安";
  font-size: 8px;
  opacity: 0.7;
}
.empty-day {
  font-size: 9px;
  color: var(--tone-c3cabc, #c3cabc);
  padding: 0 3px;
  line-height: 2;
}
.calendar-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 17px 0 19px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  font-size: 9px;
  color: var(--tone-89947e, #89947e);
}
.legend span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.legend i {
  width: 6px;
  height: 6px;
  border-radius: 2px;
}
.legend-n {
  background: var(--tone-8aa578, #8aa578);
}
.legend-h {
  background: var(--tone-78a5a0, #78a5a0);
}
.legend-l {
  background: #d5b56b;
}
.legend-x {
  background: var(--tone-cbd0c3, #cbd0c3);
}
.footer-tip {
  color: var(--tone-b0b7a7, #b0b7a7);
  font-size: 9px;
  white-space: nowrap;
}
.box {
  padding: 20px;
  border-radius: 10px;
  border-color: var(--bd);
  margin: 0;
  background: white;
}
.box h2 {
  font-size: 13px;
  margin-bottom: 13px;
  color: var(--tone-48603d, #48603d);
  font-weight: 600;
}
.box p {
  font-size: 10px;
}
.box .sr {
  grid-template-columns: 61px minmax(20px, 1fr) auto;
  gap: 8px;
  margin-top: 15px;
  font-size: 9px;
}
.sr > .c {
  font-size: 10px;
  background: transparent;
  padding: 0;
  text-align: left;
}
.sr > span:last-child {
  font-size: 9px;
  color: var(--tone-8d987f, #8d987f);
  white-space: nowrap;
}
.bar {
  height: 5px;
  background: var(--tone-f1f3eb, #f1f3eb);
  display: flex !important;
}
.bar i {
  background: var(--tone-8ea47b, #8ea47b);
  border-radius: 3px;
}
.bar i + i {
  background: #cbbb8d !important;
}
.stat-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stat-heading > span {
  font-size: 9px;
  color: var(--tone-a3ae95, #a3ae95);
}
.stat-summary {
  padding: 10px;
  border-radius: 6px;
  background: var(--tone-f6f8f2, #f6f8f2);
  font-size: 10px;
  color: var(--tone-93a084, #93a084);
  margin-bottom: 14px;
}
.stat-legend {
  margin-top: 19px;
  padding-top: 13px;
  border-top: 1px solid var(--bd);
  font-size: 9px;
  display: flex;
  gap: 15px;
  color: var(--tone-9aa48d, #9aa48d);
}
.stat-legend i {
  width: 6px;
  height: 6px;
  display: inline-block;
  border-radius: 50%;
  background: var(--tone-8ea47b, #8ea47b);
  margin-right: 5px;
}
.stat-legend span + span i {
  background: #cbbb8d;
}
#adm {
  border: 1px solid var(--bd);
  border-radius: 10px;
  background: white;
  padding: 17px;
}
#adm::before {
  content: "排班操作";
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--tone-48603d, #48603d);
}
#adm .seg {
  width: 100%;
  display: flex;
}
#adm .seg > .pri {
  flex: 1;
  font-size: 11px;
}
#adm > .row:last-child {
  margin-top: 12px;
}
#adm .row:last-child .b {
  font-size: 10px;
}
#pal .seg {
  flex-wrap: wrap;
}
#pal .b {
  font-size: 10px;
  padding: 5px 8px;
}
#pal .box {
  padding: 17px;
}
#pal .mu {
  font-size: 10px;
}
.prow .nmt {
  font-size: 11px;
}
.prow .mu {
  font-size: 9px;
}
.prow .b {
  font-size: 10px;
  padding: 3px 5px;
}
.tag {
  font-size: 9px;
  padding: 2px 4px;
}
.sw {
  width: 28px;
  height: 17px;
}
.sw i::after {
  height: 13px;
  width: 13px;
}
.sw input:checked + i::after {
  transform: translateX(11px);
}
#cfg input,
#cfg select {
  font-size: 11px;
}
#cfg .box {
  padding: 17px;
}
.grip {
  padding-right: 2px;
}
.team-note {
  padding: 20px 18px;
  background: var(--tone-eef2e6, #eef2e6);
  border: 1px solid var(--tone-e1e7d6, #e1e7d6);
  border-radius: 10px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.team-note > svg {
  color: var(--tone-8b9c71, #8b9c71);
  width: 24px;
  height: 24px;
  flex: none;
}
.team-note b {
  font-size: 12px;
  font-weight: 500;
  color: var(--tone-6c8052, #6c8052);
}
.team-note p {
  font-size: 10px;
  color: var(--tone-94a17f, #94a17f);
  line-height: 1.9;
  margin: 7px 0 0;
}
.guest-note {
  padding: 20px;
  border: 1px solid var(--bd);
  border-radius: 10px;
  background: white;
}
.guest-note h2 {
  margin: 0 0 7px;
  font-size: 13px;
  color: var(--tone-536d42, #536d42);
}
.guest-note p {
  font-size: 11px;
  color: var(--tone-8b987e, #8b987e);
  line-height: 1.9;
  margin: 0 0 13px;
}
.guest-note .b {
  width: 100%;
}
.page-footer {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--tone-a9b09e, #a9b09e);
  padding: 22px 0 20px;
  gap: 12px;
}
.page-footer i {
  font-style: normal;
  margin: 0 6px;
}
#sheet {
  background: var(--tone-14291f70, #14291f70);
  backdrop-filter: blur(4px);
  z-index: 10;
  align-items: center;
  padding: 20px;
}
#sheet .pn {
  background: var(--tone-fcfdf9, #fcfdf9);
  box-shadow: 0 25px 90px var(--tone-14291f30, #14291f30);
  max-width: 550px;
  border: 1px solid var(--tone-e1e7d7, #e1e7d7);
  border-radius: 16px;
  padding: 27px;
  max-height: 88vh;
}
.pn h2 {
  color: var(--tone-355a3f, #355a3f);
}
.pn .mu {
  font-size: 12px;
}
.pn .b {
  font-size: 12px;
}
.pn input,
.pn select {
  padding: 11px 12px;
  font-size: 13px;
  border-radius: 7px;
}
.pn .row {
  margin-top: 14px;
}
.pn .card {
  padding: 12px 0;
}
.dialog-close {
  position: absolute;
  right: 15px;
  top: 15px;
  border: 0;
  background: var(--tone-f1f4ec, #f1f4ec);
  color: var(--tone-73856a, #73856a);
  border-radius: 50%;
  height: 29px;
  width: 29px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.pn {
  position: relative;
}
.login-art {
  display: block;
  width: 100%;
  height: 156px;
  object-fit: cover;
  object-position: center 53%;
  border-radius: 9px;
  margin: 10px 0 22px;
}
.login-kicker {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--tone-8d9d7d, #8d9d7d);
}
.login-title {
  font-size: 23px !important;
  margin: 5px 0 8px !important;
}
.login-label {
  display: block;
  font-size: 11px;
  color: var(--tone-6c805d, #6c805d);
  margin-top: 16px;
}
.login-label input,
.login-label select {
  margin-top: 6px;
}
#toast {
  background: var(--tone-234e3a, #234e3a);
  color: var(--tone-f1f5e8, #f1f5e8);
  padding: 12px 20px;
  border-radius: 9px;
  box-shadow: 0 5px 20px var(--tone-14291f20, #14291f20);
  font-size: 12px;
  z-index: 20;
  bottom: 25px;
}
.card .mu {
  font-size: 11px;
}
@media (min-width: 1550px) {
  .hero {
    height: 258px;
  }
  .hero-copy {
    top: 36px;
  }
  .hero h2 {
    font-size: 31px;
  }
  .d {
    min-height: 118px;
    padding: 9px;
  }
  .d .c {
    font-size: 12px;
  }
  .work-grid {
    grid-template-columns: minmax(0, 1fr) 335px;
  }
}
@media (max-width: 1250px) {
  #app {
    grid-template-columns: 180px minmax(0, 1fr);
  }
  .rail {
    padding: 30px 10px 16px;
  }
  .brand {
    margin-left: 10px;
    gap: 9px;
  }
  .brand > span {
    font-size: 21px;
  }
  .brand small {
    font-size: 8px;
  }
  .brand img {
    width: 36px;
    height: 36px;
  }
  .topbar {
    padding: 0 24px;
  }
  main {
    padding: 26px 24px 0;
  }
  .work-grid {
    grid-template-columns: minmax(0, 1fr) 265px;
    gap: 15px;
  }
  .metric {
    padding: 15px 12px;
    gap: 10px;
  }
  .metric-icon {
    width: 35px;
    height: 35px;
  }
  .metric-value {
    font-size: 23px;
  }
  #mainc {
    padding: 18px 15px 0;
  }
  .d .c {
    font-size: 9px;
  }
  .d .c.n::after,
  .d .c.h::after {
    display: none;
  }
  .calendar-top h2 {
    font-size: 18px;
  }
  .box {
    padding: 17px;
  }
  .calendar-actions {
    gap: 5px;
  }
  .export-btn {
    font-size: 10px;
  }
  .filter button {
    padding: 4px 7px;
  }
  .footer-tip {
    display: none;
  }
  .account {
    gap: 9px;
  }
  #who {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .account #cm {
    font-size: 10px;
  }
  .breadcrumb {
    font-size: 10px;
  }
}
@media (max-width: 1050px) {
  #app {
    grid-template-columns: 76px minmax(0, 1fr);
  }
  .brand {
    margin: 0 auto 40px;
  }
  .brand > span,
  .rail-caption,
  .rail-note,
  .rail-bottom,
  .rail-link > .nav-dot {
    display: none;
  }
  .rail-link {
    font-size: 0;
    justify-content: center;
    padding: 15px;
  }
  .rail-link svg {
    width: 21px;
    height: 21px;
  }
  .rail {
    padding: 28px 10px;
  }
  .work-grid {
    grid-template-columns: minmax(0, 1fr) 270px;
  }
  .metric-icon {
    display: none;
  }
  .metric {
    padding: 13px 17px;
  }
  .hero {
    height: 205px;
  }
  .calendar-actions .pill {
    display: none;
  }
  .calendar-top h2 {
    font-size: 17px;
  }
  .calendar-top .eyebrow {
    font-size: 8px;
  }
  .nav {
    flex-wrap: wrap;
  }
  .grid {
    gap: 3px;
  }
  .d {
    min-height: 89px;
    padding: 5px 2px;
  }
  .d .c {
    font-size: 9px;
  }
  .d em {
    font-size: 10px;
  }
  .d.today em::after {
    display: none;
  }
  .hero h2 {
    font-size: 24px;
  }
  .hero-copy {
    left: 26px;
    top: 22px;
  }
  .calendar-footer {
    padding: 14px 0;
  }
  .legend {
    gap: 8px;
    font-size: 8px;
  }
}
@media (max-width: 800px) {
  .work-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  #side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
  }
  #cfg,
  #mine {
    grid-column: 1/-1;
  }
  .d {
    min-height: 99px;
    padding: 6px;
  }
  .d .c {
    font-size: 11px;
  }
  .d.today em::after {
    display: block;
  }
  .metric-icon {
    display: grid;
  }
  .metric {
    padding: 13px;
    gap: 9px;
  }
  .metric-value {
    font-size: 21px;
  }
  .metric-note {
    font-size: 8px;
  }
  .metric-title {
    font-size: 10px;
  }
  .calendar-actions .pill {
    display: block;
  }
  .topbar {
    height: 65px;
  }
  .breadcrumb {
    display: none;
  }
  .account {
    width: 100%;
    justify-content: flex-end;
  }
  .calendar-top h2 {
    font-size: 21px;
  }
  .nav {
    margin-top: 18px;
  }
  .filter button {
    padding: 4px 12px;
  }
  .d .c.n::after,
  .d .c.h::after {
    display: inline;
  }
  .hero-index {
    font-size: 8px;
  }
  .page-heading h1 {
    font-size: 25px;
  }
  .today-label {
    font-size: 10px;
  }
  .overview {
    gap: 9px;
    margin: 16px 0;
  }
  .metric-icon {
    width: 29px;
    height: 29px;
  }
  .metric-icon svg {
    width: 16px;
    height: 16px;
  }
}
@media (max-width: 600px) {
  #app {
    display: block !important;
  }
  .rail {
    height: 64px;
    position: static;
    flex-direction: row;
    align-items: center;
    padding: 10px 15px;
    justify-content: space-between;
  }
  .brand {
    margin: 0;
    gap: 8px;
  }
  .brand img {
    width: 34px;
    height: 34px;
  }
  .brand > span {
    display: block;
    font-size: 18px;
    letter-spacing: 3px;
  }
  .brand small {
    display: none;
  }
  .rail nav {
    display: flex;
    gap: 3px;
  }
  .rail-link {
    padding: 10px;
  }
  .rail-link svg {
    height: 18px;
    width: 18px;
  }
  .topbar {
    height: 52px;
    padding: 0 17px;
    background: var(--tone-f7f9f3, #f7f9f3);
  }
  .account {
    gap: 9px;
  }
  .account #cm {
    font-size: 9px;
  }
  .account #who {
    font-size: 10px;
    max-width: 80px;
  }
  .account .b {
    font-size: 10px;
    padding: 5px 9px;
  }
  .account #cpw {
    padding: 5px;
  }
  .account-divider {
    height: 14px;
  }
  .account #lgb svg {
    width: 13px;
    height: 13px;
  }
  main {
    padding: 22px 14px 0;
  }
  .page-heading {
    margin-bottom: 18px;
    align-items: flex-start;
  }
  .page-heading h1 {
    font-size: 24px;
  }
  .eyebrow {
    font-size: 9px;
    letter-spacing: 1px;
  }
  .page-subtitle {
    font-size: 10px;
    max-width: 220px;
    line-height: 1.8;
  }
  .today-label {
    font-size: 9px;
    padding-top: 30px;
    gap: 4px;
  }
  .today-label svg {
    display: none;
  }
  .hero {
    height: 190px;
    border-radius: 10px;
    background-position: 59% center;
  }
  .hero-copy {
    left: 20px;
    top: 21px;
  }
  .hero h2 {
    font-size: 22px;
    letter-spacing: 1px;
    margin: 13px 0;
  }
  .hero p {
    font-size: 9px;
    max-width: 180px;
    line-height: 1.9;
  }
  .hero-label {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .hero-index {
    font-size: 7px;
    right: 12px;
    bottom: 11px;
  }
  .hero::before {
    background: linear-gradient(
      90deg,
      var(--tone-123728c9, #123728c9),
      var(--tone-12372870, #12372870) 55%,
      transparent
    );
  }
  .overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .metric {
    padding: 12px 15px;
    gap: 12px;
  }
  .metric-value {
    font-size: 23px;
  }
  .metric-note {
    font-size: 8px;
  }
  .metric-icon {
    height: 35px;
    width: 35px;
  }
  .metric-title {
    font-size: 10px;
  }
  #mainc {
    padding: 17px 10px 0;
    border-radius: 10px;
  }
  .calendar-top {
    padding: 0 4px;
  }
  .calendar-top h2 {
    font-size: 20px;
  }
  .calendar-actions {
    gap: 6px;
  }
  .calendar-actions .pill {
    font-size: 8px;
  }
  .export-btn {
    font-size: 10px;
    padding: 6px;
  }
  .export-btn svg {
    width: 12px;
    height: 12px;
  }
  .nav {
    margin: 16px 3px 10px;
    gap: 7px;
  }
  .nav select {
    font-size: 10px;
    padding: 5px 3px;
  }
  .month-controls {
    gap: 3px;
  }
  .arrow {
    width: 24px;
    height: 28px;
  }
  .filter button {
    font-size: 9px;
    padding: 3px 6px;
  }
  .today-btn {
    font-size: 9px;
    padding: 4px 5px;
    margin-left: 0;
  }
  .grid {
    gap: 3px;
  }
  .wk {
    font-size: 9px;
    padding: 6px 0 8px;
  }
  .d {
    min-height: 82px;
    padding: 5px 2px;
    gap: 4px;
  }
  .d em {
    font-size: 10px;
    padding: 0 3px;
  }
  .d .c {
    font-size: 9px;
    padding: 2px 0;
    min-height: 19px;
  }
  .d .c.n::after,
  .d .c.h::after {
    display: none;
  }
  .d.today em::after {
    display: none;
  }
  .d.cl .c {
    font-size: 8px;
  }
  .empty-day {
    font-size: 8px;
    padding: 0 2px;
  }
  .calendar-footer {
    padding: 13px 4px;
  }
  .legend {
    font-size: 8px;
    gap: 10px;
  }
  #side {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .box .sr {
    font-size: 10px;
    grid-template-columns: 65px minmax(20px, 1fr) auto;
  }
  .sr > span:last-child {
    font-size: 10px;
  }
  .team-note {
    padding: 18px;
  }
  .page-footer {
    font-size: 8px;
    flex-wrap: wrap;
    gap: 5px;
    padding-bottom: 20px;
  }
  .pn {
    padding: 23px !important;
  }
  #sheet {
    padding: 14px;
    align-items: flex-end;
  }
  .pn {
    border-radius: 15px !important;
    max-height: 88vh !important;
  }
  .login-art {
    height: 140px;
  }
  #hint {
    font-size: 9px;
    padding: 7px;
  }
  .box h2 {
    font-size: 13px;
  }
  #cfg,
  #mine {
    grid-column: auto;
  }
  #adm .seg {
    width: auto;
    flex: 1;
  }
  #adm .seg > .pri {
    font-size: 10px;
  }
  .hero-copy p {
    color: var(--tone-d5decb, #d5decb);
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
@media print {
  #app {
    display: none !important;
  }
  #sheet,
  #toast {
    display: none !important;
  }
}
/* 側欄依操作流程排列，避免沿用舊版的全頁 order 規則。 */
#side > * {
  order: initial;
}
