:root{
  --bg: #fffaf5;
  --surface: #ffffff;
  --surface-soft: #fff2e8;
  --ink: #3d302b;
  --muted: #7b6860;
  --line: #ead9cd;
  --brand: #c86958;
  --brand-dark: #904638;
  --accent: #6e9279;
  --warning: #b57628;
  --danger: #b94e45;
  --ok: #4e8064;
  --shadow: 0 16px 36px rgba(112, 76, 55, 0.12);
  --shadow-card: 0 6px 18px rgba(112, 76, 55, 0.10);
  --shadow-card-hover: 0 18px 40px rgba(112, 76, 55, 0.18);
  --ink-strong: #2a201b;
  --focus-ring: 0 0 0 3px rgba(200, 105, 88, 0.30);
  --radius: 8px;
  --radius-sm: 5px;
  --max: 1180px;
}
*{
  box-sizing: border-box;
}
html{
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}
body{
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  line-height: 1.65;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
}
#app:focus{
  outline: none;
}
#app{
  overflow-x: clip;
}
a{
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea{
  font: inherit;
}
img{
  display: block;
  max-width: 100%;
}
video{
  display: block;
  max-width: 100%;
}
.icon{
  flex: 0 0 auto;
  width: 1em;
  height: 1em;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  vertical-align: -0.12em;
}
.metric-icon,
.input-with-icon,
.admin-sidebar a,
.nav-toggle{
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.input-with-icon{
  position: relative;
  display: flex;
  width: 100%;
}
.input-with-icon .icon{
  position: absolute;
  left: 0.75rem;
  top: 50%;
  z-index: 1;
  color: var(--muted);
  transform: translateY(-50%);
}
.input-with-icon .input,
.input-with-icon .select{
  padding-left: 2.25rem;
}
.metric-icon{
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--brand-dark);
}
.btn .icon,
.admin-sidebar .icon,
.nav-toggle .icon{
  width: 1em;
  height: 1em;
}
.tag,
.status{
  gap: 0.35rem;
}
.tag .icon,
.status .icon{
  width: 0.95em;
  height: 0.95em;
}
.site-header{
  position: fixed;
  top: 0.75rem;
  left: clamp(0.75rem, 3vw, 2rem);
  right: clamp(0.75rem, 3vw, 2rem);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 74px;
  padding: 0.65rem clamp(1rem, 3vw, 2rem);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(234, 217, 205, 0.85);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 34px rgba(116, 52, 52, 0.12);
  min-width: 0;
  overflow: hidden;
}
.site-header > *{
  position: relative;
  z-index: 1;
}
.site-header+#app{
  padding-top: 6.25rem;
}
.member-label{
  display: inline;
}
.count{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.3rem;
  min-height: 1.3rem;
  margin-left: 0.15rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--brand);
  color: white;
  font-size: 0.75rem;
  line-height: 1;
}
.count[hidden]{
  display: none !important;
}
.nav-toggle{
  display: none;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  box-shadow: none;
}
.nav-toggle:hover,
.nav-toggle[aria-expanded="true"]{
  border-color: var(--brand);
  color: var(--brand-dark);
}
.nav-toggle>*{
  pointer-events: none;
}
.page{
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2rem);
}
.page-title h1{
  margin: 0;
  font-size: clamp(1.6rem, 3.8vw, 2.8rem);
  line-height: 1.05;
  letter-spacing: 0;
}
.page-title p{
  max-width: 46rem;
  color: var(--muted);
  font-size: 1.08rem;
}
.inline-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 42px;
  padding: 0.65rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: white;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.2;
  transition: transform 140ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.btn:hover{
  background: var(--brand-dark);
  transform: translateY(-1px);
}
.btn:active{
  transform: translateY(0) scale(0.97);
}
.btn:focus-visible{
  outline: none;
  box-shadow: var(--focus-ring);
}
.btn.secondary{
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.btn.secondary:hover{
  background: var(--surface-soft);
}
.btn.ghost{
  background: transparent;
  border-color: var(--line);
  color: var(--brand-dark);
}
.btn.danger{
  background: var(--danger);
}
.btn.small{
  min-height: 34px;
  padding: 0.45rem 0.65rem;
  font-size: 0.88rem;
}
.btn:disabled{
  cursor: not-allowed;
  opacity: 0.56;
  transform: none;
}
.panel,
.admin-card,
.form-card{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.form-card > .btn:first-of-type{
  margin-top: 1rem;
}
.admin-modal-card .panel > .inline-actions:last-child{
  margin-top: 1rem;
}
.section-head{
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.form-card h2{
  margin: 0 0 1.2rem;
  font-size: clamp(1.25rem, 2.6vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
  color: var(--ink-strong);
}
.panel h2{
  margin: 0.6rem 0 0.8rem;
  font-size: clamp(1.25rem, 2.6vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
  color: var(--ink-strong);
}
.muted{
  color: var(--muted);
  overflow-wrap: anywhere;
}
.grid{
  display: grid;
  gap: 1rem;
}
.grid>*,
.admin-shell>*{
  min-width: 0;
}
.grid.three{
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid.two{
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.panel,
.admin-card,
.form-card{
  padding: 1rem;
}
.admin-card h3{
  margin: 0 0 0.3rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.tag,
.status{
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--brand-dark);
  font-size: 0.82rem;
  font-weight: 700;
}
.status.danger{
  background: #fde8e5;
  color: var(--danger);
}
.tag,
.status{
  box-shadow: inset 0 0 0 1px rgba(61, 48, 43, 0.06);
}
.status.danger{
  box-shadow: inset 0 0 0 1px rgba(185, 78, 69, 0.22);
}
.admin-toolbar{
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin: 1rem 0;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.admin-toolbar>*{
  min-width: 0;
}
.input,
.select,
.textarea{
  width: 100%;
  min-height: 42px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--ink);
}
.textarea{
  min-height: 112px;
  resize: vertical;
}
.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible,
input:not([type="checkbox"]):not([type="radio"]):focus-visible,
select:focus-visible,
textarea:focus-visible{
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible{
  outline: none;
  box-shadow: var(--focus-ring);
}
label{
  display: grid;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}
.field-error{
  color: var(--danger);
  font-size: 0.84rem;
  min-height: 1.2em;
}
.dialog-overlay{
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(61, 48, 43, 0.35);
}
.dialog-card{
  display: flex;
  width: min(480px, 100%);
  max-height: calc(100dvh - 2rem);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(61, 48, 43, 0.12);
  background: var(--surface);
}
.dialog-side{
  width: 140px;
  flex-shrink: 0;
  padding: 1.5rem 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.6rem;
}
.dialog-side-icon{
  font-size: 1.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dialog-side-icon .icon{
  width: 28px;
  height: 28px;
}
.dialog-side-label{
  font-size: 0.82rem;
  font-weight: 700;
}
.dialog-main{
  flex: 1;
  min-width: 0;
  padding: 1.3rem 1.5rem;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.dialog-close{
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dialog-close:hover{
  color: var(--ink);
}
.dialog-main{
  position: relative;
}
.dialog-title{
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
  padding-right: 1.5rem;
}
.dialog-subtitle{
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 1rem;
}
.dialog-body{
  flex: 1;
}
.dialog-overlay .dialog-body .form-card,
.dialog-overlay .dialog-body .panel{
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}
.dialog-body .inline-actions{
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1.1rem;
}
.dialog-body .panel{
  margin-bottom: 0;
}

@media (max-width: 500px) {
.dialog-card{
    flex-direction: column;
    max-width: 360px;
  }
.dialog-side{
    width: 100%;
    flex-direction: row;
    padding: 0.8rem 1.2rem;
  }
.dialog-side-icon{
    font-size: 1.3rem;
  }
.dialog-side-label{
    font-size: 0.85rem;
  }}
.member-message-modal{
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(61, 48, 43, 0.42);
}
.member-message-modal-wrap{
  position: relative;
  width: min(760px, 100%);
  max-height: min(720px, calc(100dvh - 2rem));
}
.member-message-modal-card{
  width: 100%;
  max-height: inherit;
  padding: 1rem;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.member-message-modal-close{
  position: sticky;
  top: 0;
  z-index: 3;
  float: right;
  margin: 0 0 0.5rem 0.75rem;
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--surface);
}
.member-thread-head{
  display: grid;
  gap: 0.65rem;
  min-height: 2.75rem;
  padding-right: 4.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}
.member-thread-head h2{
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.2;
}
.admin-shell{
  --admin-topbar-height: 56px;
  display: block;
  min-height: 100vh;
  background: #f5f0eb;
  color: var(--ink);
}
.admin-sidebar{
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  width: 240px;
  height: auto;
  min-height: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  color: var(--ink);
}
.admin-sidebar nav{
  display: grid;
  flex: 1;
  gap: 0;
  overflow-y: auto;
  padding: 0.75rem 0;
}
.admin-sidebar a{
  position: relative;
  width: 100%;
  min-height: 42px;
  padding: 0.62rem 1.25rem;
  border-left: 3px solid transparent;
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 700;
}
.admin-sidebar a.active,
.admin-sidebar a:hover{
  background: #fff7f2;
  border-left-color: var(--brand);
  color: var(--brand-dark);
}
.admin-topbar{
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  height: var(--admin-topbar-height);
  margin: 0 calc(clamp(1rem, 3vw, 1.5rem) * -1) 1.25rem;
  padding: 0 clamp(1rem, 3vw, 1.5rem);
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}
.admin-shell .page-title h1{
  font-size: clamp(1.5rem, 2.6vw, 2rem);
}
.admin-shell .admin-card,
.admin-shell .panel,
.admin-shell .form-card,
.admin-shell .table-wrap,
.admin-shell .admin-toolbar{
  border-color: var(--line);
  box-shadow: 0 2px 8px rgba(61, 48, 43, 0.08);
}
.admin-shell .btn{
  background: var(--brand);
}
.admin-shell .btn:hover{
  background: var(--brand-dark);
}
.admin-shell .btn.danger{
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.admin-shell .btn.danger:hover{
  background: #9f3d36;
  border-color: #9f3d36;
}
.admin-shell .btn.secondary,
.admin-shell .btn.ghost{
  background: #ffffff;
  border-color: var(--line);
  color: var(--ink);
}
.admin-shell th{
  background: #fff7f2;
  color: var(--muted);
}
.admin-table-sticky-head{
  position: fixed;
  z-index: 34;
  display: none;
  overflow: hidden;
  background: #fff7f2;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 14px -16px rgba(61, 48, 43, 0.72);
  pointer-events: none;
}
.admin-table-sticky-head table{
  transform: translateX(calc(var(--admin-table-scroll-left, 0px) * -1));
}
.admin-shell .page-title{
  margin-bottom: 1rem;
}
.admin-shell .admin-toolbar{
  align-items: end;
}
.pagination-bar{
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.pagination-bar > .pagination-control{
  margin: 0 auto;
}
.pagination-meta{
  font-size: 0.875rem;
  color: var(--muted);
  white-space: nowrap;
}
.pagination-control{
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.pagination-control button{
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 0.875rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.pagination-control button:hover:not(:disabled){
  background: #fff7f2;
  border-color: var(--brand);
  color: var(--brand);
}
.pagination-control button.active{
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  cursor: default;
}
.pagination-control button:disabled{
  opacity: 0.45;
  cursor: not-allowed;
}
.pagination-jump{
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: var(--muted);
}
.pagination-jump input[type="number"]{
  width: 3.2rem;
  height: 2rem;
  padding: 0 0.35rem;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.875rem;
  -moz-appearance: textfield;
}
.pagination-jump input[type="number"]::-webkit-outer-spin-button,
.pagination-jump input[type="number"]::-webkit-inner-spin-button{
  -webkit-appearance: none;
  margin: 0;
}
.pagination-jump button{
  height: 2rem;
  padding: 0 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 0.875rem;
  cursor: pointer;
}
.pagination-jump button:hover{
  background: #fff7f2;
  border-color: var(--brand);
  color: var(--brand);
}
.pagination-bar > .pagination-meta{
  order: 1;
}
.pagination-bar > .pagination-control{
  order: 2;
}
.pagination-bar > .pagination-jump{
  order: 3;
}

@media (max-width: 640px) {
.pagination-bar{
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
.pagination-bar > .pagination-meta,
.pagination-bar > .pagination-control,
.pagination-bar > .pagination-jump{
    order: 0;
  }
.pagination-bar > .pagination-control{
    margin: 0;
  }
.pagination-meta{
    text-align: center;
  }
.pagination-control{
    gap: 0.35rem;
  }
.pagination-jump{
    display: flex;
    align-items: center;
    gap: 0.4rem;
  }}
.admin-shell .admin-toolbar label{
  flex: 1 1 220px;
  color: var(--muted);
  font-weight: 700;
}
.admin-shell td .inline-actions{
  flex-wrap: nowrap;
}
.admin-shell table .btn.small{
  white-space: nowrap;
}
.admin-modal{
  z-index: 60;
}
.admin-modal-wrap{
  width: min(1080px, 100%);
}
.admin-modal-card{
  display: grid;
  gap: 1rem;
}
.admin-modal-controlbar{
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: -0.25rem;
  padding-bottom: 0.35rem;
}
.admin-modal-header-actions{
  display: flex;
  min-width: 0;
}
.admin-modal-controlbar .member-message-modal-close{
  position: static;
  flex: 0 0 auto;
  float: none;
  margin: 0;
  box-shadow: none;
}
.admin-modal-jump-menu{
  position: relative;
  min-width: 0;
}
.admin-modal-jump-menu summary{
  list-style: none;
  min-height: 36px;
  white-space: nowrap;
  cursor: pointer;
}
.admin-modal-jump-menu summary::-webkit-details-marker{
  display: none;
}
.admin-modal-jump-menu summary .icon{
  transform: rotate(180deg);
}
.admin-modal-jump-menu[open] summary .icon{
  transform: rotate(0deg);
}
.admin-modal-jump-menu-list{
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 5;
  display: grid;
  gap: 0.25rem;
  min-width: 10rem;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.admin-modal-jump-menu-list .btn{
  justify-content: flex-start;
  width: 100%;
  white-space: nowrap;
}
.admin-modal .member-message-modal-close{
  justify-self: end;
  width: auto;
}
.admin-modal .admin-modal-card{
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}
.admin-modal .admin-modal-scroll{
  padding: 1rem;
  overflow-y: auto;
  min-height: 0;
  max-height: none;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}
.admin-modal-header-b{
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, var(--surface-soft), #fff7f0);
  border-bottom: 1px solid var(--line);
}
.admin-modal-header-b-text{
  min-width: 0;
}
.admin-modal-header-b-text h2{
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.35;
  color: var(--brand-dark);
}
.admin-modal-header-b-text .sub{
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-modal-header-b-actions{
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.admin-modal-header-b .btn.small.secondary,
.admin-modal-header-b .admin-modal-jump-menu summary{
  background: rgba(255, 255, 255, 0.85);
  border-color: var(--line);
}
.admin-modal-header-b .btn.small.secondary:hover{
  background: var(--surface);
}
.admin-modal-header-b .admin-modal-close-b{
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border-color: var(--line);
}
.admin-modal-header-b .admin-modal-jump-menu{
  position: relative;
  min-width: 0;
}
.admin-modal-header-b .admin-modal-jump-menu summary{
  list-style: none;
  min-height: 36px;
  white-space: nowrap;
  cursor: pointer;
}
.admin-modal-header-b .admin-modal-jump-menu summary::-webkit-details-marker{
  display: none;
}
.admin-modal-header-b .admin-modal-jump-menu summary .icon{
  transform: rotate(180deg);
}
.admin-modal-header-b .admin-modal-jump-menu[open] summary .icon{
  transform: rotate(0deg);
}
.admin-modal-header-b .admin-modal-jump-menu-list{
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 5;
  display: grid;
  gap: 0.25rem;
  min-width: 10rem;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.admin-modal-header-b .admin-modal-jump-menu-list .btn{
  justify-content: flex-start;
  width: 100%;
  white-space: nowrap;
}
.admin-modal .form-card,
.admin-modal .panel{
  box-shadow: none;
}
.admin-modal .textarea{
  min-height: 120px;
}
.metric-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}
.metric{
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem 0.85rem;
  align-items: center;
  padding: 0.7rem 0.85rem 0.7rem 1rem;
  position: relative;
  overflow: hidden;
  border-left: none;
  box-shadow: var(--shadow-card);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.metric::before{
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--metric-bar-color, linear-gradient(var(--brand), var(--brand-dark)));
}
.metric:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}
.metric-icon{
  grid-row: 1 / 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--brand-dark);
  font-size: 1rem;
}
.metric-body{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
}
.metric .muted{
  font-size: 0.78rem;
  color: var(--muted);
}
.metric strong{
  font-size: 1.55rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink-strong);
}
.table-wrap{
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}
.admin-shell .table-wrap :is(a, button, input, select, textarea, label, summary, [role="button"], [tabindex]){
  cursor: auto;
}
.admin-shell .table-wrap :is(a, button, [role="button"]){
  cursor: pointer;
}
table{
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}
th,
td{
  padding: 0.8rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th{
  background: #fff7f0;
  color: var(--muted);
  font-size: 0.86rem;
}
.toast{
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  max-width: min(360px, calc(100vw - 2rem));
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  background: #322824;
  color: white;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}
.toast[popover]{
  inset: auto 1rem max(1rem, env(safe-area-inset-bottom)) auto;
  margin: 0;
  border: 0;
  overflow-wrap: anywhere;
}
.toast[popover]::backdrop{ pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after{
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }}

@media (max-width: 1024px) {
.metric-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }}

@media (max-width: 820px) {
.site-header{
    overflow: visible;
  }
.nav-toggle{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    position: absolute;
    top: 50%;
    right: clamp(1rem, 3vw, 2rem);
    transform: translateY(-50%);
    z-index: 35;
  }
.member-label{
    display: inline;
  }
.admin-shell{
    display: block;
  }
.admin-sidebar{
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 45;
    width: min(82vw, 240px);
    transform: translateX(-100%);
    transition: transform 220ms ease;
  }
.admin-sidebar.open{
    transform: translateX(0);
  }
.admin-topbar{
    position: fixed;
    left: 0;
    right: 0;
    justify-content: space-between;
    flex-wrap: nowrap;
    margin: 0;
    z-index: 35;
  }}

@media (max-width: 620px) {
.page{
    padding: 1rem clamp(1rem, 5vw, 1.25rem);
  }
.page-title h1{
    font-size: 1.75rem;
  }
.grid.three,
.grid.two,
.metric-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }
.metric{
    padding: 0.65rem 0.75rem 0.65rem 0.9rem;
  }
.metric-icon{
    width: 30px;
    height: 30px;
    font-size: 0.92rem;
  }
.metric strong{
    font-size: 1.4rem;
  }
.member-message-modal{
    padding: 0.5rem;
  }
.admin-shell td .inline-actions{
    flex-wrap: wrap;
  }
.admin-modal-controlbar{
    gap: 0.45rem;
  }
.admin-modal-jump-menu summary{
    max-width: calc(100vw - 8rem);
    overflow: hidden;
    text-overflow: ellipsis;
  }
.admin-modal-header-b{
    grid-template-columns: 1fr;
    gap: 0.65rem;
    padding: 0.9rem 1rem;
  }
.admin-modal-header-b-actions{
    order: -1;
    justify-content: flex-end;
  }
.admin-modal-header-b-text .sub{
    white-space: normal;
  }
.admin-modal .admin-modal-scroll{
    padding: 0.75rem;
  }}

@media (max-width: 640px) {
.member-message-modal.admin-modal{
    align-items: center;
    padding: 0.5rem;
  }
.member-message-modal.admin-modal .admin-modal-card{
    min-height: 0;
    max-height: inherit;
  }
.member-message-modal.admin-modal .admin-modal-controlbar{
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
  }}
/* AppDialog 操作語意色與共用浮動通知顯示狀態。 */
.dialog-add .dialog-side { background: linear-gradient(135deg, #e9f3eb, #d4e8db); color: var(--ok); }
.dialog-rename .dialog-side { background: linear-gradient(135deg, var(--surface-soft), #f7e3d6); color: var(--brand); }
.dialog-delete .dialog-side { background: linear-gradient(135deg, #fdf2f0, #f7dad5); color: var(--danger); }
.dialog-default .dialog-side { background: linear-gradient(135deg, var(--surface-soft), #f7e3d6); color: var(--brand); }
.toast.show { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .toast[popover] { transform: none; transition: opacity 160ms ease !important; }
}
/* 全站狀態徽章語意色。 */
.status.ok { background: #e9f3eb; color: var(--ok); box-shadow: inset 0 0 0 1px rgba(78, 128, 100, 0.22); }
.status.warn { background: #fff0d9; color: var(--warning); box-shadow: inset 0 0 0 1px rgba(181, 118, 40, 0.24); }
