:root {
  color-scheme: light;
  font-family: Inter, "Microsoft YaHei UI", "PingFang SC", sans-serif;
  color: #203332;
  background: #f4f6f4;
  font-size: 15px;
  --ink: #203332;
  --muted: #586d67;
  --line: #d8e1dc;
  --teal: #12655e;
  --tint: #e3efeb;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button {
  min-height: 39px; padding: 8px 15px; border: 1px solid #c9d6d0;
  border-radius: 7px; background: white; color: var(--ink); cursor: pointer;
}
button:hover { background: #edf4f0; border-color: #91aaa0; }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible { outline: 3px solid #309587; outline-offset: 2px; }
button.primary { background: var(--teal); border-color: var(--teal); color: white; font-weight: 650; }
button.primary:hover { background: #0b514b; }
a { color: var(--teal); }
header {
  min-height: 65px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 14px; align-items: center;
  padding: 10px max(24px, calc((100% - 1300px) / 2));
}
header strong { font-size: 19px; color: #142a28; letter-spacing: .02em; }
header strong::before {
  content: ""; display: inline-block; width: 13px; height: 17px; margin-right: 10px;
  vertical-align: -1px; border-radius: 2px; background: linear-gradient(140deg,#33877b 0 46%,#e9f2ed 46% 56%,#15574f 56% 100%);
}
header small { border-left: 1px solid var(--line); padding-left: 15px; margin-left: 15px; color: var(--muted); }
.wrap { width: min(100%, 1350px); margin: auto; padding: 17px 25px 48px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.tabs { display: flex; gap: 4px; margin: 0 0 20px; border-bottom: 1px solid var(--line); }
.tabs button {
  min-height: 42px; background: transparent; border: 0; border-bottom: 2px solid transparent;
  border-radius: 0; color: var(--muted); padding: 8px 14px;
}
.tabs button:first-child { margin-left: -3px; }
.tabs button.selected { border-bottom-color: var(--teal); color: var(--teal); font-weight: 700; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(23px,2.2vw,32px); line-height: 1.25; margin-bottom: 9px; letter-spacing: -.02em; }
h2 { font-size: 19px; line-height: 1.45; margin-bottom: 13px; }
h3 { font-size: 15px; margin: 15px 0 7px; }
p, .pre { line-height: 1.65; }
.muted,.subtle,.meta,.count { color: var(--muted); font-size: 13px; }
.subtle { margin: 0; }
.task-hero {
  min-height: 144px; padding: clamp(18px,3vw,36px); overflow: hidden; border-radius: var(--radius);
  color: #fff; background: #123e3a linear-gradient(100deg,#103735,#184f49); 
  background-image: linear-gradient(90deg,rgba(8,36,34,.98),rgba(12,40,38,.75) 36%,rgba(10,32,30,.08) 76%), url("studio.webp");
  background-position: center, center 52%; background-size: cover;
}
.task-hero h1 { font-size: clamp(26px,2.6vw,37px); }
.task-hero .subtle { color: #d5e8e1; }
.task-hero button { background: #f4f8f5; border-color: #e4eee8; color: #184941; }
.task-hero .primary { background: #c2efda; border-color: #bee7d7; color: #123f37; }
.task-hero button:hover { background: white; }
.cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin: 15px 0 20px; }
.metric {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 70px; padding: 13px 18px 13px 31px; color: #445a54; background: #fff;
  border-color: var(--line); border-radius: var(--radius); text-align: left; font-weight: 600;
}
.metric::before {
  content: ""; position: absolute; left: 16px; width: 7px; height: 7px;
  border-radius: 50%; background: #277a70;
}
.metric[data-status="待反馈"]::before { background: #c28b2c; }
.metric[data-status="需调整"]::before { background: #be694c; }
.metric b { font-size: 27px; font-weight: 650; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); }
.metric:hover,.metric[aria-pressed="true"] { border-color: #588b7b; background: #eaf3ee; }
.filters { gap: 9px; margin: 0 0 10px; }
.filters select { width: auto; max-width: min(220px,100%); min-width: 112px; }
.filters input { flex: 0 1 250px; min-width: 155px; }
.filters .muted { margin-left: auto; white-space: nowrap; }
input, select, textarea {
  border: 1px solid #c3d1c8; background: #fff; border-radius: 7px; padding: 9px 11px;
  width: 100%; min-height: 39px; color: #203332;
}
input::placeholder, textarea::placeholder { color: #6c7e77; }
input[type="checkbox"] { width: auto; min-height: 0; }
textarea { min-height: 80px; resize: vertical; }
label { display: block; font-size: 14px; font-weight: 650; margin: 13px 0 6px; }
.check { display: flex; gap: 8px; align-items: center; }
.tablebox,.panel,.auth,dialog { background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.tablebox { overflow: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th,td { padding: 13px 15px; border-bottom: 1px solid #e5ece7; vertical-align: top; }
th { background: #eaf0ec; font-size: 12px; font-weight: 650; color: #435e54; white-space: nowrap; }
td { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
td p { margin: 3px 0 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fbf9; }
.tasktitle { padding: 0; min-height: auto; border: 0; color: #175f57; font-weight: 700; background: transparent; text-align: left; }
.tasktitle:hover { background: transparent; text-decoration: underline; }
.badge { display: inline-block; background: #eef0ee; color: #52625b; font-size: 12px; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.badge.review { background: #faeed4; color: #774d09; }
.badge.adjust { background: #fbe6dd; color: #90442c; }
.badge.doing { background: #deefeb; color: #175f57; }
.badge.closed { background: #e4ebe4; color: #3d6048; }
.danger,.error { color: #9b3925; }
.empty { padding: 46px 18px; color: var(--muted); text-align: center; }
.columns { display: grid; grid-template-columns: minmax(255px,.88fr) minmax(330px,1.22fr); gap: 22px; align-items: start; }
.columns>section { min-width: 0; }
.columns>section>h2:first-child { margin-top: 16px; }
.panel { margin: 14px 0; padding: 20px; }
.panel h2:last-child,.panel p:last-child { margin-bottom: 0; }
.history { border-left: 4px solid #b7cfc3; }
.history.feedback { border-left-color: #ce9b4b; background: #fffdf8; }
.history .meta { margin: 7px 0; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.count { font-weight: 400; margin-left: 7px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(210px,100%),1fr)); gap: 10px; margin-top: 10px; }
.gallery:empty { display: none; }
.asset { min-width: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.asset img,.asset video { width: 100%; height: 190px; display: block; object-fit: contain; background: #192824; }
.asset a { display: block; padding: 8px 10px; font-size: 13px; overflow-wrap: anywhere; }
.actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.smallbutton { font-size: 13px; padding: 5px 10px; min-height: 32px; }
.taskmeta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.taskmeta small { display: block; color: var(--muted); margin-bottom: 4px; }
.uploadlist { font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace,monospace; user-select: all; }
.error { white-space: pre-wrap; margin: 10px 0; }
.error:empty { margin: 0; }
dialog { width: min(630px,94vw); max-height: 90dvh; padding: 23px; color: var(--ink); box-shadow: 0 20px 70px #19372e38; }
dialog::backdrop { background: #10261f80; }
#notice { display: none; position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #164c43; color: #fff; border-radius: 8px; padding: 11px 18px; max-width: 92vw; z-index: 10; }
body:has(.auth) { min-height: 100vh; background: #eaf0eb; }
#app:has(.auth) { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth {
  width: min(900px,100%); position: relative; isolation: isolate; overflow: hidden;
  padding: clamp(28px,5vw,55px); padding-right: calc(min(900px,100%) * .45 + clamp(28px,5vw,55px));
  box-shadow: 0 18px 55px #25443712;
}
.auth::after {
  content: ""; position: absolute; z-index: -1; inset: 0 0 0 55%; background: #17453f url("studio.webp") 68% center / cover;
}
.auth h1 { margin: 2px 0 9px; }
.auth form { margin-top: 25px; }
.auth input { min-height: 43px; }
.auth .muted { margin: 6px 0 11px; }
.auth button { display: block; width: 100%; margin-top: 21px; }
@media(max-width:850px) {
  header { padding: 10px 16px; }
  header small { display: none; }
  .wrap { padding: 14px 15px 40px; }
  .tabs { margin-bottom: 14px; }
  .columns { grid-template-columns: minmax(0,1fr); gap: 0; }
  .columns:has(.sticky) { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .columns .sticky { display: contents; }
  .columns .sticky > :first-child { order: 0; }
  .columns .sticky + section { order: 1; }
  .columns .sticky > :nth-child(2) { order: 2; }
  .columns .sticky + section.panel { margin-top: 0; }
  .cards { gap: 8px; }
  th,td { padding: 11px 12px; }
  .tablebox:has(.tasktitle) table { min-width: 700px; }
  .filters .muted { margin-left: 0; }
}
@media(max-width:600px) {
  header .row { gap: 6px; }
  header strong { font-size: 17px; }
  header small { display: none; }
  .wrap { padding-inline: 12px; }
  .task-hero { min-height: 126px; padding: 18px; gap: 12px; }
  .task-hero .row { gap: 6px; }
  .task-hero button { padding: 7px 12px; }
  .cards { margin: 10px 0 15px; gap: 6px; }
  .metric { flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; min-height: 74px; padding: 11px 12px; font-size: 12px; }
  .metric::before { display: none; }
  .metric b { font-size: 23px; }
  .filters { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
  .filters input,.filters select { width: 100%; min-width: 0; max-width: none; }
  .filters .muted { justify-self: end; align-self: center; }
  td,th { padding: 10px; }
  .panel { padding: 16px; }
  #app:has(.auth) { padding: 15px; }
  .auth { max-width: 420px; padding: 101px 24px 30px; }
  .auth::after { inset: 0 0 auto; height: 77px; background-position: center 52%; }
}
@media(prefers-reduced-motion: no-preference) {
  button { transition: background-color .12s ease,border-color .12s ease; }
}
/* Preserve the table structure for assistive technology while keeping one task in view on phones. */
@media (max-width: 600px) {
  .tablebox:has(.tasktitle) { overflow: visible; }
  .tablebox:has(.tasktitle) table { display: block; min-width: 0; width: 100%; }
  .tablebox:has(.tasktitle) thead {
    position: absolute; height: 1px; width: 1px; margin: -1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
  }
  .tablebox:has(.tasktitle) tbody { display: block; }
  .tablebox:has(.tasktitle) tr:has(.tasktitle) {
    display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    align-items: start; gap: 7px 10px; border-bottom: 1px solid var(--line); padding: 14px 13px;
  }
  .tablebox:has(.tasktitle) tbody tr:last-child { border: 0; }
  .tablebox:has(.tasktitle) td { display: block; border: 0; padding: 0; font-size: 13px; }
  .tablebox:has(.tasktitle) td:first-child { grid-area: 1 / 1 / auto / 2; }
  .tablebox:has(.tasktitle) .tasktitle { font-size: 15px; }
  .tablebox:has(.tasktitle) td:nth-child(2) { grid-area: 2 / 2; text-align: right; }
  .tablebox:has(.tasktitle) td:nth-child(3) { grid-area: 2 / 1; }
  .tablebox:has(.tasktitle) td:nth-child(4) { grid-area: 1 / 2; text-align: right; }
  .tablebox:has(.tasktitle) td:nth-child(5),.tablebox:has(.tasktitle) td:nth-child(6) { color: var(--muted); font-size: 12px; }
  .tablebox:has(.tasktitle) td:nth-child(5).danger { color: #9b3925; }
  .tablebox:has(.tasktitle) td:nth-child(5)::before { content: "截止 "; }
  .tablebox:has(.tasktitle) td:nth-child(6) { text-align: right; }
  .tablebox:has(.tasktitle) td:nth-child(6)::before { content: "更新 "; }
}
.feedback-pictures { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(150px,100%),1fr)); gap:8px; margin-block:12px; }
.feedback-pictures:empty { display:none; }
.feedback-pictures figure { margin:0; min-width:0; overflow:hidden; border:1px solid var(--line); border-radius:8px; }
.feedback-pictures img { display:block; width:100%; height:100px; object-fit:contain; background:#f0f4f2; }
.feedback-pictures figcaption { display:flex; align-items:center; justify-content:space-between; gap:6px; padding:5px 8px; font-size:13px; }
.feedback-pictures figcaption span { overflow-wrap:anywhere; }
.feedback-pictures button { flex-shrink:0; }
.asset a.image-link { padding:0; cursor:zoom-in; }
.asset .image-link span { display:block; padding:8px 10px; }
