:root {
  color-scheme: light;
  --ink: #1f2521;
  --muted: #667068;
  --line: #d9dfd8;
  --paper: #f6f8f2;
  --panel: #ffffff;
  --accent: #13795b;
  --accent-strong: #0b5c43;
  --warn: #b45309;
  --danger: #a33a2c;
  --shadow: 0 18px 40px rgba(38, 52, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(19, 121, 91, 0.07) 1px, transparent 1px),
    linear-gradient(180deg, rgba(19, 121, 91, 0.06) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

.shell {
  width: min(1500px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0 20px;
  border-bottom: 2px solid var(--ink);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1;
}

h2 {
  font-size: 18px;
}

.actions,
.inputActions,
.filters,
.itemControls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

button,
.openLink {
  min-height: 38px;
  border: 1px solid var(--ink);
  background: var(--panel);
  color: var(--ink);
  padding: 8px 12px;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.openLink:hover {
  transform: translateY(-1px);
  box-shadow: 3px 3px 0 var(--ink);
}

button.primary {
  background: var(--accent);
  color: white;
}

button.danger {
  color: var(--danger);
  border-color: var(--danger);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 2px solid var(--ink);
  border-top: 0;
  background: var(--panel);
}

.metrics > div {
  padding: 18px;
  border-right: 1px solid var(--line);
}

.metrics > div:last-child {
  border-right: 0;
}

.metrics span {
  display: block;
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
}

.metrics small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 700;
}

.reviewPanel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  border: 2px solid var(--ink);
  border-top: 0;
  background: #ffffff;
  padding: 16px;
}

.reviewPanel[hidden] {
  display: none;
}

.reviewMeta {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.reviewMeta span {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
}

.reviewMeta strong {
  font-size: 20px;
  line-height: 1.35;
}

.reviewMeta small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.reviewControls {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: end;
}

.reviewControls label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.reviewControls input {
  width: 120px;
  border: 1px solid var(--ink);
  padding: 9px 10px;
  font-size: 18px;
  font-weight: 800;
}

.workspace {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.inputPane,
.listPane {
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
}

.inputPane {
  padding: 18px;
  position: sticky;
  top: 18px;
}

.hint {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border: 1px solid var(--ink);
  padding: 12px;
  line-height: 1.55;
  background: #fbfcf8;
}

.compactTextarea {
  min-height: 120px;
}

.summaryBox {
  min-height: 220px;
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  background: #f9faf4;
  padding: 12px;
  color: #2f382f;
  line-height: 1.55;
}

.listHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.filters button.active {
  background: var(--ink);
  color: white;
}

.empty {
  padding: 42px 16px;
  color: var(--muted);
  text-align: center;
}

.itemList {
  display: grid;
}

.item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.item.hasComments {
  background: #f0f8ef;
}

.item.closed {
  opacity: 0.72;
}

.itemMain {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 12px;
  min-width: 0;
}

.statusDot {
  width: 10px;
  height: 10px;
  margin-top: 12px;
  border-radius: 50%;
  background: var(--line);
  border: 1px solid var(--ink);
}

.item.hasComments .statusDot {
  background: var(--accent);
}

.fields {
  display: grid;
  gap: 8px;
}

.titleInput,
.urlInput,
.commentInput,
.stateInput {
  border: 1px solid var(--line);
  background: #fbfcf8;
  padding: 9px 10px;
  min-width: 0;
}

.titleInput {
  font-weight: 800;
}

.urlInput {
  color: var(--muted);
  font-size: 13px;
}

.storeOrderLine {
  border: 1px solid #b7d7c8;
  background: #edf8f1;
  color: var(--accent-strong);
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.5;
  padding: 8px 10px;
  white-space: pre-wrap;
}

.storeSegment,
.storeTotal {
  display: inline-block;
  margin-right: 18px;
}

.storeNumber {
  color: #c1121f;
  font-size: 20px;
  font-weight: 950;
  padding: 0 2px;
}

.itemControls {
  justify-content: end;
}

.itemControls label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.commentInput {
  width: 92px;
  font-size: 16px;
  color: var(--ink);
}

.stateInput {
  min-height: 38px;
}

.removeButton {
  color: var(--danger);
  border-color: var(--danger);
}

@media (max-width: 980px) {
  .shell {
    width: min(100% - 24px, 760px);
  }

  .topbar,
  .workspace,
  .reviewPanel,
  .item {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    align-items: start;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics > div:nth-child(2) {
    border-right: 0;
  }

  .metrics > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .inputPane {
    position: static;
  }

  .listHeader {
    display: grid;
    gap: 12px;
  }

  .itemControls {
    justify-content: start;
  }

  .reviewControls {
    justify-content: start;
  }
}
