:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7f8;
  color: #17212b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f5f7f8;
}

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

.page {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 18px 14px 28px;
}

.panel {
  background: #ffffff;
  border: 1px solid #d9e0e5;
  border-radius: 8px;
  padding: 18px;
}

.panel + .panel {
  margin-top: 14px;
}

.title {
  margin: 0 0 6px;
  font-size: 24px;
  line-height: 1.2;
}

.muted {
  color: #607080;
  font-size: 14px;
}

.field {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.field span {
  font-weight: 650;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.input,
.select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #c9d3dc;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
}

.textarea {
  min-height: 92px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: 2px solid #2f7d6b;
  outline-offset: 1px;
}

.button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  background: #1f6f5f;
  color: #fff;
  font-weight: 750;
  cursor: pointer;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.secondary {
  background: #e8eef1;
  color: #17212b;
}

.form-actions {
  display: flex;
  gap: 10px;
}

.form-actions .button {
  flex: 1;
}

.message {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
}

.message.error {
  background: #ffecec;
  color: #8a1f1f;
  border: 1px solid #f5c2c2;
}

.message.ok {
  background: #eaf7ef;
  color: #16633a;
  border: 1px solid #bfe6ce;
}

.lookup-form {
  display: grid;
  gap: 12px;
}

.review-lookup-button {
  background: #f6c343;
  color: #17212b;
  white-space: normal;
  line-height: 1.25;
  padding: 10px 12px;
}

/* 首页两块区域用边框颜色区分：绿色是提交订单，黄色是获取评语。 */
.submit-panel {
  border: 2px solid #1f6f5f;
}

.review-lookup-panel {
  border: 2px solid #f6c343;
}

.review-comment.is-used {
  color: #8a949c;
  background: #f2f4f6;
}

.button.is-used {
  background: #e3e7ea;
  color: #8a949c;
  cursor: not-allowed;
}

.review-copy-notice {
  margin-top: 10px;
}

.review-lookup-results {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.review-result-card {
  border: 1px solid #dce4e8;
  border-radius: 6px;
  padding: 14px;
  background: #ffffff;
}

.review-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.review-result-head h3 {
  margin: 4px 0 0;
  font-size: 18px;
}

.review-target-warning {
  margin: 12px 0 4px;
  border: 1px solid #bfe6ce;
  border-radius: 6px;
  padding: 9px 10px;
  background: #eaf7ef;
  color: #16633a;
  font-weight: 750;
}

.review-comment {
  min-height: 120px;
}

.review-material-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 10px;
  margin-top: 12px;
}

.review-material-images img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border: 1px solid #dbe3e8;
  border-radius: 6px;
  background: #f0f3f5;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.preview-grid img,
.voucher-images img,
.thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f0f3f5;
  border: 1px solid #dbe3e8;
  border-radius: 6px;
}

.preview-grid img {
  aspect-ratio: 3 / 4;
  max-height: 150px;
}

.voucher {
  background: #fff;
  border: 2px solid #2f7d6b;
}

.voucher-page {
  width: min(100%, 1120px);
}

.success-mark {
  display: inline-block;
  margin-bottom: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e8f6ef;
  color: #16633a;
  font-weight: 750;
  font-size: 14px;
}

.submission-no {
  margin: 10px 0 14px;
  padding: 14px;
  border-radius: 8px;
  background: #17212b;
  color: #fff;
  text-align: center;
}

.submission-no strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
  letter-spacing: 0;
  word-break: break-word;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.info-item {
  border: 1px solid #dce4e8;
  border-radius: 6px;
  padding: 10px;
}

.info-item span {
  display: block;
  color: #607080;
  font-size: 12px;
}

.info-item strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  word-break: break-word;
}

.voucher-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 14px;
  align-items: start;
  justify-content: center;
  margin-top: 14px;
}

.voucher-images a {
  display: block;
  width: 100%;
  min-height: 220px;
}

.voucher-images img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 620px;
  object-fit: contain;
}

.voucher-images:has(a:only-child) {
  grid-template-columns: minmax(0, min(100%, 760px));
}

.voucher-images:has(a:nth-child(2):last-child) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.footer-note {
  margin-top: 14px;
  text-align: center;
  font-weight: 750;
}

.admin-shell {
  width: min(100%, 1160px);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.password-panel {
  margin: 12px 0 16px;
  border: 1px solid #dce4e8;
  border-radius: 6px;
  padding: 12px;
  background: #f8fafb;
}

.stats-bar {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.stat-card {
  min-height: 58px;
  border: 1px solid #dce4e8;
  border-radius: 6px;
  padding: 8px 10px;
  background: #ffffff;
  color: #17212b;
  cursor: pointer;
  text-align: left;
}

.stat-card span {
  display: block;
  color: #607080;
  font-size: 12px;
  font-weight: 650;
}

.stat-card strong {
  display: block;
  margin-top: 3px;
  font-size: 22px;
  line-height: 1;
}

.stat-card.active {
  border-color: #1f6f5f;
  background: #eaf7ef;
}

.option-stats {
  display: grid;
  gap: 28px;
  margin: 18px 0 14px;
}

.option-platform-group {
  display: grid;
  gap: 8px;
}

.option-platform-group h2 {
  margin: 0 0 -4px;
  color: #17212b;
  font-size: 24px;
  line-height: 1.15;
}

.task-panel {
  border: 2px solid #1f6f5f;
}

.task-claim-button {
  background: #f6c343;
  color: #17212b;
}

.task-claim-result {
  margin-top: 14px;
}

.task-claim-card {
  border: 2px solid #1f6f5f;
  border-radius: 8px;
  padding: 14px;
  background: #f4fbf7;
}

.task-claim-card h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.task-keywords span,
.task-instructions span {
  display: block;
  margin-bottom: 6px;
  color: #607080;
  font-size: 13px;
  font-weight: 650;
}

.task-keywords ol {
  margin: 0 0 14px;
  padding-left: 22px;
}

.task-keywords li {
  margin-bottom: 6px;
  font-size: 17px;
}

.task-instructions p {
  margin: 0 0 14px;
  line-height: 1.7;
}

.task-product-preview img,
.task-product-image img {
  display: block;
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border: 1px solid #dbe3e8;
  border-radius: 6px;
  background: #f0f3f5;
}

.task-product-image {
  margin-bottom: 14px;
}

.task-emphasis {
  margin: 0 0 14px;
  border-radius: 6px;
  padding: 12px;
  background: #fffaf0;
  border: 1px solid #f0d9a8;
  line-height: 1.5;
  white-space: pre-wrap;
}

.task-image-preview img {
  display: block;
  width: 100%;
  max-width: 240px;
  max-height: 200px;
  object-fit: contain;
  border: 1px solid #dbe3e8;
  border-radius: 6px;
  background: #f0f3f5;
}

.task-go-submit {
  display: block;
  padding: 13px;
  text-align: center;
  text-decoration: none;
  line-height: 1.2;
}

.input.is-locked {
  background: #f2f4f6;
  color: #55606a;
}

.bulk-praise-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bulk-praise-actions .button {
  flex: 1;
  min-width: 200px;
}

.option-platform-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.option-platform-head h2 {
  margin: 0;
}

.option-range-note {
  color: #607080;
  font-size: 13px;
  font-weight: 650;
}

.option-platform-head .row-action {
  margin-left: auto;
}

.trend-controls {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.trend-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trend-chart-box {
  position: relative;
  height: 380px;
}

.option-product-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.option-product-card {
  min-height: 58px;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.option-product-card span {
  min-height: 16px;
}

.option-product-card strong {
  margin-top: 8px;
  text-align: center;
}

.settings-form {
  display: grid;
  gap: 16px;
}

.settings-section {
  display: grid;
  gap: 10px;
}

.settings-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.settings-section h3 {
  margin: 0;
  font-size: 16px;
}

.settings-list {
  display: grid;
  gap: 10px;
}

.review-material-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.review-workspace {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  min-height: 620px;
}

.review-product-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 14px;
  border-right: 1px solid #dce4e8;
}

.review-product-sidebar h3,
.review-workspace-title h3 {
  margin: 0;
}

.review-product-button {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid #dce4e8;
  border-radius: 6px;
  padding: 10px;
  background: #fff;
  color: #17212b;
  text-align: left;
  cursor: pointer;
}

.review-product-button span {
  color: #607080;
  font-size: 12px;
}

.review-product-button.active {
  border-color: #1f6f5f;
  background: #eaf7ef;
}

.review-workspace-main,
.review-ai-form,
.review-manual-form,
.review-material-edit {
  display: grid;
  gap: 12px;
}

.review-workspace-title,
.review-material-card-head,
.review-ai-controls,
.review-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.review-workspace-title p {
  margin: 4px 0 0;
}

.review-ai-form,
.review-manual-form,
.review-material-card {
  border: 1px solid #dce4e8;
  border-radius: 6px;
  padding: 12px;
  background: #f8fafb;
}

.review-ai-controls {
  justify-content: flex-start;
}

.review-ai-controls .field {
  min-width: 150px;
}

.review-tabs {
  justify-content: flex-start;
}

.review-material-card {
  background: #fff;
}

.button.danger {
  border-color: #b74242;
  color: #9c2f2f;
}

.review-material-row {
  grid-template-columns: minmax(130px, 0.5fr) minmax(260px, 1fr) auto;
}

.review-material-comment {
  margin: 0 0 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.review-material-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-material-thumbs img {
  display: block;
  width: 76px;
  height: 76px;
  object-fit: contain;
  border: 1px solid #dbe3e8;
  border-radius: 6px;
  background: #f0f3f5;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.5fr) minmax(240px, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid #dce4e8;
  border-radius: 6px;
  padding: 12px;
  background: #ffffff;
}

.channel-setting-row {
  grid-template-columns: minmax(120px, 0.5fr) minmax(180px, 0.6fr);
}

.product-setting-row {
  grid-template-columns: minmax(120px, 0.45fr) minmax(220px, 0.65fr) minmax(260px, 1fr);
}

.setting-checks,
.product-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check-row.compact {
  min-height: auto;
  margin-top: 0;
  padding: 7px 9px;
  font-size: 13px;
  font-weight: 650;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(130px, 0.8fr) minmax(150px, 0.9fr) auto auto;
  gap: 10px;
  align-items: end;
  margin: 12px 0 6px;
}

.filter-field {
  display: grid;
  gap: 6px;
}

.filter-field span {
  color: #526272;
  font-size: 13px;
  font-weight: 650;
}

.active-filter {
  margin: 8px 0 12px;
}

.empty-row {
  padding: 24px 10px;
  color: #607080;
  text-align: center;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1020px;
}

th,
td {
  border-bottom: 1px solid #e1e7eb;
  padding: 10px;
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  color: #526272;
  background: #f8fafb;
}

.row-action {
  width: auto;
  min-height: 36px;
  padding: 0 12px;
}

.subline {
  display: block;
  margin-top: 3px;
  color: #607080;
  font-size: 12px;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.status-pill.ok {
  background: #e8f6ef;
  color: #16633a;
}

.status-pill.pending {
  background: #fff4df;
  color: #7a4a00;
}

.status-pill.neutral {
  background: #edf2f5;
  color: #526272;
}

.thumb {
  width: 54px;
  height: 54px;
}

.thumb-hover {
  position: relative;
  width: 54px;
  height: 54px;
}

.thumb-preview {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  display: none;
  gap: 10px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  padding: 10px;
  border: 1px solid #c9d3dc;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgb(23 33 43 / 22%);
  overflow: auto;
  pointer-events: none;
}

.thumb-hover:hover .thumb-preview,
.thumb-hover:focus-within .thumb-preview {
  display: grid;
}

.thumb-preview.one-image {
  grid-template-columns: 400px;
}

.thumb-preview.two-images {
  grid-template-columns: repeat(2, 400px);
}

.thumb-preview.many-images {
  grid-template-columns: repeat(2, 400px);
}

.thumb-preview img {
  display: block;
  width: 400px;
  height: auto;
  max-height: 560px;
  object-fit: contain;
  border: 1px solid #dbe3e8;
  border-radius: 6px;
  background: #f0f3f5;
}

.detail-panel {
  margin-top: 16px;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(15 23 31 / 52%);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  max-height: calc(100vh - 36px);
  overflow: hidden;
  border: 1px solid #c9d3dc;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgb(15 23 31 / 30%);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #e1e7eb;
}

.modal-header .title {
  margin: 0;
}

.modal-body {
  max-height: calc(100vh - 118px);
  overflow: auto;
  padding: 18px;
}

.modal-body > hr:first-child {
  display: none;
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.info-item.wide {
  grid-column: 1 / -1;
}

.workflow-form {
  margin: 16px 0;
}

.workflow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  margin-top: 16px;
  border: 1px solid #dce4e8;
  border-radius: 6px;
  padding: 10px 12px;
  font-weight: 750;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.admin-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 14px;
}

.admin-images img {
  width: 100%;
  max-height: 620px;
  object-fit: contain;
  border: 1px solid #dce4e8;
  border-radius: 6px;
  background: #f0f3f5;
}

@media (max-width: 560px) {
  .page {
    padding: 10px 8px 18px;
  }

  .panel {
    padding: 14px;
  }

  .title {
    font-size: 21px;
  }

  .info-grid {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .info-item {
    padding: 8px;
  }

  .info-item strong {
    font-size: 14px;
  }

  .submission-no strong {
    font-size: 22px;
  }

  .voucher-images {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .voucher-images a {
    min-height: 180px;
  }

  .voucher-images img {
    max-height: none;
  }

  .preview-grid {
    gap: 5px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-actions {
    flex-direction: column;
  }

  .modal {
    align-items: stretch;
    padding: 8px;
  }

  .modal-dialog {
    max-height: calc(100vh - 16px);
  }

  .modal-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px;
  }

  .modal-body {
    max-height: calc(100vh - 116px);
    padding: 12px;
  }

  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-actions {
    justify-content: flex-start;
  }

  .workflow-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .settings-row,
  .channel-setting-row,
  .product-setting-row,
  .review-material-row {
    grid-template-columns: 1fr;
  }

  .review-workspace {
    grid-template-columns: 1fr;
  }

  .review-product-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding-right: 0;
    padding-bottom: 12px;
    border-right: 0;
    border-bottom: 1px solid #dce4e8;
  }

  .review-product-sidebar h3 {
    grid-column: 1 / -1;
  }

  .option-product-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stats-bar {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .stat-card {
    min-height: 68px;
    padding: 9px 10px;
  }

  .stat-card strong {
    font-size: 24px;
  }

  .thumb-preview {
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .thumb-preview.one-image,
  .thumb-preview.two-images,
  .thumb-preview.many-images {
    grid-template-columns: minmax(0, 1fr);
  }

  .thumb-preview img {
    width: calc(100vw - 44px);
    max-height: 420px;
  }

  .filter-bar {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
