:root {
  --bg: #f6f5f1;
  --paper: #fff;
  --ink: #1f2933;
  --muted: #626a72;
  --line: #e5e4de;
  --green: #216649;
  --soft: #eaf2ed;
  --warning: #915700;
  --red: #b42318;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  outline-offset: 4px;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 8px;
  padding: 11px 17px;
  min-height: 44px;
  font-size: 0.875rem;
  transition: background 0.15s;
}
button:hover {
  background: #f0f1ec;
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.primary:hover {
  background: #184f38;
}
.subtle {
  background: transparent;
  border-color: transparent;
}
.muted,
small {
  color: var(--muted);
}
small {
  font-size: 0.8125rem;
}
h1 {
  font-size: 1.875rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  margin: 0 0 12px;
}
h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 16px;
}
h3 {
  font-size: 1rem;
  margin: 0 0 8px;
}
p {
  line-height: 1.7;
}
.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  color: var(--green);
  font-weight: 600;
}
.login-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 12% 5%, #dee9de 0, transparent 50%), var(--bg);
  padding: 32px;
}
.login-card {
  width: min(100%, 430px);
  padding: 44px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 20px 80px #1c34260a;
}
.brand-mark {
  font-size: 1.6rem;
  font-weight: 600;
  border: 2px solid var(--green);
  color: var(--green);
  padding: 9px;
  display: inline-block;
  margin-bottom: 28px;
}
.brand-mark span {
  color: #b38b49;
}
.login-card h1 {
  font-size: 1.65rem;
}
.login-card label {
  margin: 20px 0;
}
.login-card button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin-top: 28px;
}
.privacy-note {
  font-size: 0.8rem;
  text-align: center;
  margin: 28px 0 0;
  color: var(--muted);
}
label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
}
input:not([type="checkbox"]),
select {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: white;
  width: 100%;
  margin-top: 8px;
  color: var(--ink);
}
input:focus,
select:focus {
  outline: 2px solid var(--green);
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.7;
}
.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}
[hidden] {
  display: none !important;
}
aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 210px;
  border-right: 1px solid var(--line);
  background: #eeeee7;
  padding: 36px 20px;
  display: flex;
  flex-direction: column;
}
.brand {
  font-size: 1.65rem;
  letter-spacing: -0.06em;
  font-weight: 650;
  text-decoration: none;
  color: var(--green);
  padding: 0 16px;
}
.brand span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.09em;
  margin-top: 8px;
}
nav {
  display: grid;
  gap: 8px;
  margin-top: 52px;
}
nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
}
nav a span {
  font-size: 1.2rem;
}
nav a.active {
  background: #dce7dd;
  color: #174f36;
  font-weight: 600;
}
.aside-footer {
  margin-top: auto;
  padding: 16px;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 2;
}
.aside-footer small {
  font-size: 0.65rem;
  letter-spacing: 0.13em;
}
.workspace {
  margin-left: 210px;
}
header {
  height: 84px;
  padding: 0 40px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
header > div {
  display: flex;
  align-items: center;
  gap: 14px;
}
.header-actions {
  gap: 8px;
}
main {
  max-width: 1450px;
  margin: auto;
  padding: 38px 40px 64px;
}
.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 30px;
}
.page-heading p {
  margin: 8px 0 0;
  font-size: 0.875rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 0.75rem;
  line-height: 1.4;
  background: #eeeee9;
  color: #626a72;
}
.badge.good {
  background: var(--soft);
  color: #216649;
}
.badge.warn {
  background: #fff2d9;
  color: var(--warning);
}
.badge.bad {
  background: #fceae9;
  color: var(--red);
}
.badge.blue {
  background: #eef0fc;
  color: #374aa6;
}
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
}
.overview-grid {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 24px;
}
.photo-stage {
  background: #eaeae4;
  min-height: 340px;
  height: clamp(300px, 36vw, 500px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  overflow: hidden;
}
.photo-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.photo-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 18px;
  gap: 12px;
}
.photo-caption p {
  margin: 0;
}
.schedule-card {
  display: flex;
  flex-direction: column;
  min-height: 250px;
}
.big-time {
  font-size: 3rem;
  letter-spacing: -0.07em;
  font-weight: 550;
  margin: 14px 0 0;
}
.schedule-card .actions {
  margin-top: auto;
  padding-top: 24px;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.stack {
  display: grid;
  gap: 20px;
  align-content: start;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 24px 0;
}
.metric {
  padding: 20px;
}
.metric-label {
  font-size: 0.8125rem;
  color: var(--muted);
}
.metric-value {
  font-size: 1.7rem;
  letter-spacing: -0.04em;
  margin: 12px 0 5px;
}
.metric-value.compact {
  font-size: 1.1rem;
  letter-spacing: 0;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-head h2 {
  margin: 0;
}
.tabs {
  display: flex;
  gap: 4px;
  background: #eaeae3;
  padding: 4px;
  border-radius: 9px;
  width: fit-content;
}
.tabs button {
  border: 0;
  background: transparent;
  min-width: 100px;
}
.tabs button.selected {
  background: white;
  box-shadow: 0 1px 4px #00000010;
}
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin: 22px 0;
}
.toolbar input {
  flex: 1;
  min-width: 180px;
  margin: 0;
}
.toolbar select {
  width: auto;
  margin: 0;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.photo-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  padding: 0;
  width: 100%;
}
.photo-card:hover {
  box-shadow: 0 6px 24px #1c342610;
  background: white;
  transform: translateY(-2px);
}
.photo-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  background: #eaeae4;
}
.photo-card-body {
  padding: 17px;
}
.photo-card p {
  margin: 9px 0;
  min-height: 3em;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.scores {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  gap: 16px;
  margin: 12px 0;
}
.badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 30px 0;
}
.empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--muted);
  line-height: 1.8;
}
.empty .symbol {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 16px;
}
.notice {
  border-left: 3px solid #aa8439;
  background: #fcf6e8;
  padding: 12px 16px;
  font-size: 0.875rem;
  line-height: 1.7;
  margin-bottom: 24px;
}
.error {
  color: var(--red);
  font-size: 0.875rem;
}
.progress-stage {
  padding: 12px;
  background: var(--soft);
  color: var(--green);
  border-radius: 8px;
  margin: 12px 0;
}
.schedule-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.form-section {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.form-section:first-child {
  padding-top: 0;
}
.form-section:last-child {
  border-bottom: 0;
}
.weekday-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.weekday-row label {
  display: flex;
  gap: 5px;
  align-items: center;
}
.weekday-row input {
  accent-color: var(--green);
}
.form-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 10px 0;
}
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}
.timeline li {
  padding: 14px 0 14px 18px;
  border-left: 2px solid var(--line);
  position: relative;
}
.timeline li:before {
  content: "";
  position: absolute;
  left: -5px;
  top: 22px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}
.timeline p {
  margin: 5px 0;
  font-size: 0.875rem;
}
.history-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.history-row:last-child {
  border-bottom: 0;
}
.history-row img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
}
.history-row p {
  margin: 5px 0;
  font-size: 0.875rem;
}
.resource {
  margin: 22px 0;
}
.resource > div {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.875rem;
}
progress {
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  accent-color: var(--green);
}
progress::-webkit-progress-bar {
  background: #eeeee9;
}
progress::-webkit-progress-value {
  background: var(--green);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 30px;
  width: min(980px, 94vw);
  max-height: 90dvh;
  color: var(--ink);
}
dialog::backdrop {
  background: #17231bc0;
  backdrop-filter: blur(3px);
}
#confirm {
  max-width: 500px;
}
.dialog-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
}
.detail-grid img {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  background: #eaeae4;
  border-radius: 8px;
}
.detail-grid p {
  font-size: 0.875rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #243d30;
  color: white;
  padding: 14px 22px;
  border-radius: 10px;
  z-index: 10;
  max-width: 90vw;
  box-shadow: 0 4px 22px #0002;
  font-size: 0.875rem;
}
.inline-value {
  font-variant-numeric: tabular-nums;
}
.loading {
  padding: 60px;
  text-align: center;
  color: var(--muted);
}
@media (min-width: 1500px) {
  .photo-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 1050px) {
  aside {
    width: 175px;
    padding: 30px 12px;
  }
  .workspace {
    margin-left: 175px;
  }
  main {
    padding: 28px 24px;
  }
  header {
    padding: 0 24px;
  }
  .overview-grid {
    grid-template-columns: 1.35fr 1fr;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .header-actions small {
    display: none;
  }
  .schedule-layout {
    grid-template-columns: 1fr;
  }
  .photo-stage {
    min-height: 280px;
  }
}
@media (max-width: 700px) {
  aside {
    inset: auto 0 0;
    width: 100%;
    height: 76px;
    padding: 0 8px;
    border-right: 0;
    border-top: 1px solid var(--line);
    z-index: 5;
    background: #fffffff5;
  }
  aside .brand,
  .aside-footer {
    display: none;
  }
  nav {
    display: flex;
    justify-content: space-around;
    margin: 0;
    gap: 0;
  }
  nav a {
    flex-direction: column;
    gap: 3px;
    padding: 10px 6px;
    font-size: 0.6875rem;
    min-width: 54px;
    border-radius: 0;
  }
  nav a span {
    font-size: 1.15rem;
  }
  nav a.active {
    background: transparent;
    color: var(--green);
  }
  .workspace {
    margin-left: 0;
  }
  header {
    height: 70px;
    padding: 0 16px;
    gap: 8px;
  }
  header > div {
    gap: 8px;
  }
  header button {
    padding: 8px;
    font-size: 0.75rem;
  }
  #device-name {
    font-size: 0.875rem;
  }
  .header-actions {
    gap: 0;
  }
  main {
    padding: 28px 16px 110px;
  }
  .page-heading {
    align-items: start;
  }
  h1 {
    font-size: 1.6rem;
  }
  .page-heading p {
    font-size: 0.8rem;
  }
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .photo-stage {
    height: 340px;
  }
  .panel {
    padding: 18px;
  }
  .metrics {
    gap: 12px;
  }
  .metric {
    padding: 16px;
  }
  .metric-value {
    font-size: 1.45rem;
  }
  .photo-grid {
    gap: 12px;
  }
  .photo-card-body {
    padding: 12px;
  }
  .photo-card p {
    font-size: 0.8125rem;
  }
  .scores {
    gap: 8px;
    font-size: 0.75rem;
  }
  .badge {
    font-size: 0.6875rem;
  }
  .toolbar {
    gap: 8px;
  }
  .toolbar input {
    flex-basis: 100%;
  }
  .toolbar select {
    flex: 1;
    font-size: 0.8125rem;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .detail-grid img {
    max-height: 42vh;
  }
  dialog {
    padding: 20px;
    max-height: 85dvh;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .history-row {
    grid-template-columns: 48px 1fr;
    gap: 12px;
  }
  .history-row > div:last-child {
    grid-column: 2;
  }
  .history-row img {
    width: 48px;
    height: 48px;
  }
  .login-card {
    padding: 30px;
  }
  .login-screen {
    padding: 20px;
  }
  #toast {
    bottom: 90px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
