/* Report content styles; shared-shell.css owns the workbench navigation. */
:root {
  --red: #d52c1f;
  --red-soft: #fff1ee;
  --blue: #0d308f;
  --blue-soft: #eef3ff;
  --ink: #232c3d;
  --muted: #758092;
  --line: #e5e8ee;
  --canvas: #f5f6f8;
  --radius: 12px;
  font-family: "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  font-size: 14px;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--canvas);
  line-height: 1.6;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
button,
a {
  transition:
    color 0.15s,
    background 0.15s,
    border-color 0.15s;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  display: block;
  max-width: 100%;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h2 {
  font-size: 18px;
  line-height: 1.4;
  font-weight: 700;
}
h3 {
  font-size: 15px;
  line-height: 1.5;
  font-weight: 650;
}
svg {
  width: 18px;
  height: 18px;
  display: block;
}
[data-icon] {
  display: inline-flex;
  flex: 0 0 auto;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.muted,
.cell-note,
.shop-tag {
  color: var(--muted);
}
.btn.accent {
  color: var(--red);
  background: var(--red-soft);
  border-color: transparent;
}
.btn.accent:hover {
  background: #ffe4de;
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #f4f5f7;
  font-size: 24px;
  line-height: 1;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 7px;
  border-radius: 5px;
  font-size: 11px;
  line-height: 1.5;
  white-space: nowrap;
  font-weight: 500;
}
.badge.neutral {
  background: #f0f2f5;
  color: #7b8493;
}
.badge.good {
  background: var(--blue-soft);
  color: var(--blue);
}
.badge.warn {
  background: var(--red-soft);
  color: #b82d21;
}
.data-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  margin-bottom: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
}
.data-banner > div {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.data-banner strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.data-banner strong:before {
  content: "";
  width: 6px;
  height: 6px;
  background: #9fa7b3;
  border-radius: 50%;
}
.data-banner[data-status="online"] strong:before {
  background: #39816a;
}
.data-banner[data-status="offline"] strong:before {
  background: var(--red);
}
#data-note,
#sync-summary {
  color: var(--muted);
  font-size: 12px;
}
#sync-summary {
  flex-shrink: 0;
}
.scope-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.scope-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.select-shell {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  height: 38px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  color: #8a93a2;
  min-width: 0;
}
.select-shell select {
  border: 0;
  background: transparent;
  padding: 0 20px 0 0;
  height: 36px;
  width: 200px;
  max-width: 100%;
  color: #465164;
  font-size: 12px;
  text-overflow: ellipsis;
}
.date-select select {
  width: 98px;
}
.date-label {
  color: #929aa7;
  font-size: 11px;
  white-space: nowrap;
}
.display-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef0f3;
  flex-shrink: 0;
}
.display-toggle button {
  padding: 5px 10px;
  min-height: 28px;
  border: 0;
  background: none;
  border-radius: 5px;
  color: #9199a6;
  font-size: 12px;
  white-space: nowrap;
}
.display-toggle .active {
  color: #465164;
  background: white;
  box-shadow: 0 1px 3px #1d283d0c;
}
.display-toggle .active {
  color: var(--red);
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.kpi {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 19px 20px 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
}
.kpi-label {
  font-size: 12px;
  color: var(--muted);
}
.kpi-value {
  font-size: clamp(23px, 2.1vw, 32px);
  font-weight: 750;
  letter-spacing: -0.8px;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.kpi:nth-child(2) .kpi-value {
  color: var(--red);
}
.kpi-foot {
  color: #929aa7;
  font-size: 11px;
  line-height: 1.6;
  min-height: 18px;
}
.ranking-head,
.section-heading,
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.ranking-head p,
.section-heading p,
.panel-heading p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}
.ranking-grid {
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.ranking-column {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
}
.ranking-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #f7f9ff;
  border-bottom: 1px solid var(--line);
}
.low .ranking-title {
  background: #fff8f6;
}
.ranking-title h3 {
  font-size: 14px;
}
.ranking-title > span {
  color: #8d97a6;
  font-size: 11px;
}
.rank-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  align-items: center;
}
.rank-card + .rank-card {
  border-top: 1px solid var(--line);
}
.rank-art {
  display: block;
  border: 1px solid #edf0f4;
  background: #f8f9fb;
  padding: 0;
  border-radius: 9px;
  overflow: hidden;
  width: 132px;
  height: 132px;
}
.rank-art .creative-art {
  width: 100%;
  height: 100%;
}
.rank-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: flex-start;
}
.rank-top,
.card-top {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 8px;
}
.shop-tag {
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  line-height: 1.55;
}
.rank-footer {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  width: 100%;
}
.rank-footer > .btn {
  flex-shrink: 0;
}
.rank-data {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  font-variant-numeric: tabular-nums;
}
.rank-data > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.rank-data > div:last-child {
  text-align: right;
}
.rank-data span {
  color: #9aa2ae;
  font-size: 10px;
}
.rank-data strong {
  color: var(--blue);
  font-size: 25px;
  line-height: 1.25;
  font-weight: 750;
}
.low .rank-data strong {
  color: var(--red);
}
.rank-data b {
  color: #526075;
  font-size: 12px;
  line-height: 1.9;
  font-weight: 550;
}
.coverage-panel {
  overflow: hidden;
}
.coverage-panel .panel-heading {
  padding: 18px 20px;
  margin: 0;
}
.daily-panel {
  margin-top: 18px;
  padding: 18px 20px;
}
.daily-panel .panel-heading {
  margin: 0;
}
.trend {
  padding-top: 16px;
}
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: left;
}
th {
  font-weight: 500;
  color: #8a94a4;
  background: #fafbfc;
  white-space: nowrap;
}
td,
th {
  padding: 14px 18px;
  border-bottom: 1px solid #edf0f4;
  vertical-align: middle;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #fcfcfe;
}
.shop-table {
  min-width: 680px;
}
.shop-table td:first-child {
  width: 34%;
  font-weight: 550;
}
.cell-note {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.6;
  font-weight: 400;
}
.section-heading h2 > span,
.section-count {
  font-size: 12px;
  font-weight: 400;
  color: #919aa7;
  margin-left: 8px;
}
.filter-row {
  margin-bottom: 14px;
}
.filter-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 38px;
  padding: 0 11px;
  color: #97a0ad;
  min-width: 200px;
  flex: 1;
  max-width: 340px;
}
.search input {
  height: 100%;
  width: 100%;
  border: 0;
  padding: 0;
  background: none;
  font-size: 12px;
  min-width: 0;
}
input::placeholder,
textarea::placeholder {
  color: #a4abb6;
}
.filter-controls select {
  height: 38px;
  padding: 0 28px 0 11px;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: #647085;
  min-width: 0;
}
.material-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.creative-card {
  display: flex;
  flex-direction: column;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
}
.card-art {
  position: relative;
  border-bottom: 1px solid var(--line);
}
.card-image-button .creative-art.actual {
  aspect-ratio: 5 / 4;
}
.card-image-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: white;
}
.creative-art.actual {
  aspect-ratio: 1;
  background: #fafbfc;
  overflow: hidden;
}
.creative-art.actual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.no-image {
  height: 100%;
  display: grid;
  place-items: center;
  color: #a0a8b3;
  font-size: 12px;
}
.compare-check {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: #fffffff2;
  border: 1px solid #e4e8ee;
  padding: 4px 7px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  box-shadow: 0 1px 4px #24334d0a;
}
input[type="checkbox"] {
  accent-color: var(--red);
  width: 14px;
  height: 14px;
  margin: 0;
  flex: 0 0 auto;
}
.card-content {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}
.card-top .shop-tag {
  font-size: 10px;
}
.card-top .badge {
  font-size: 10px;
  padding: 2px 5px;
}
.card-title {
  font-size: 13px;
  line-height: 1.6;
  font-weight: 600;
  height: 42px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  color: #99a1ad;
  font-size: 11px;
}
.card-metrics {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.7fr;
  gap: 8px;
  font-variant-numeric: tabular-nums;
  padding: 10px 0;
  border-top: 1px solid #f0f2f5;
}
.card-metrics > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.card-metrics span {
  color: #99a1ad;
  font-size: 10px;
}
.card-metrics b {
  font-size: 17px;
  font-weight: 650;
  white-space: nowrap;
  line-height: 1.3;
}
.card-metrics > div:first-child b {
  color: var(--blue);
}
.card-bottom {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}
.material-table {
  min-width: 950px;
}
.material-table td,
.material-table th {
  padding: 12px 14px;
}
.material-table td:first-child {
  width: 46px;
}
.table-art {
  width: 64px;
  height: 64px;
  padding: 0;
  border: 1px solid #edf0f4;
  border-radius: 6px;
  overflow: hidden;
  background: #fafbfc;
}
.table-art .creative-art {
  width: 100%;
  height: 100%;
}
.product-cell {
  width: 32%;
  min-width: 220px;
}
.product-cell > strong {
  font-size: 12px;
  font-weight: 550;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.product-cell .cell-note {
  max-width: 360px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.numeric {
  white-space: nowrap;
}
.table-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  white-space: nowrap;
}
.table-metric b {
  font-size: 14px;
  font-weight: 650;
}
.action-row,
.form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.compare-bar {
  position: fixed;
  bottom: 24px;
  left: calc(50% + var(--sidebar) / 2);
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 8px 40px #27334924;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  white-space: nowrap;
}
.empty-state {
  text-align: center;
  padding: 42px 20px;
  color: #969fac;
  font-size: 13px;
}
.empty-state strong {
  display: block;
  color: #596477;
  font-size: 16px;
  margin-bottom: 8px;
}
.generation-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 20px;
}
.reference-panel,
.prompt-panel {
  padding: 24px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.reference-panel h3,
.prompt-panel h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.step-number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
}
.reference-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.upload-hint {
  margin: 9px 0 14px;
  color: #9ba3af;
  font-size: 11px;
}
#recent-reference {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  font-size: 12px;
}
.reference-preview {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  margin-top: 16px;
  min-height: 294px;
}
.reference-preview .empty-state {
  background: #fafbfc;
  border: 1px dashed #e1e6ee;
  border-radius: 10px;
  min-height: 294px;
  display: grid;
  place-items: center;
}
.reference-preview img {
  width: 100%;
  height: 294px;
  object-fit: contain;
  background: #fafbfc;
  border: 1px solid #edf0f4;
  border-radius: 10px;
}
.reference-preview p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 10px;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}
.prompt-panel .form-field {
  flex: 1;
  display: flex;
  min-height: 280px;
  margin: 0;
}
.prompt-panel textarea {
  flex: 1;
  width: 100%;
  min-height: 280px;
  resize: vertical;
  line-height: 1.8;
}
.generation-note {
  font-size: 12px;
  color: #8d97a6;
  margin: 14px 0;
  line-height: 1.7;
}
#generate-submit {
  align-self: stretch;
  min-height: 42px;
}
.generation-results {
  margin-top: 28px;
}
.generation-results > h2 {
  margin-bottom: 16px;
}
#generation-history > .empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 26px;
}
.generation-job {
  padding: 20px;
  margin-bottom: 16px;
}
.generation-job > div:first-child {
  display: flex;
  align-items: center;
  gap: 12px;
}
.generation-job small {
  color: #8a95a5;
  font-size: 11px;
}
.generation-job > p {
  margin-top: 14px;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.generation-error {
  color: var(--red);
  font-size: 12px;
}
.generated-output img {
  width: 360px;
  max-width: 100%;
  margin: 18px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  width: 640px;
  max-width: calc(100vw - 40px);
  max-height: calc(100dvh - 56px);
  background: white;
  color: var(--ink);
  box-shadow: 0 24px 80px #15213933;
}
dialog[data-kind="detail"] {
  width: 920px;
}
dialog[data-kind="compare"] {
  width: 940px;
}
dialog::backdrop {
  background: #1e293b70;
  backdrop-filter: blur(2px);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.modal-head h2 {
  font-size: 20px;
}
.detail-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
}
.detail-art {
  min-width: 0;
}
.detail-art > .creative-art {
  width: 100%;
  height: 280px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.detail-art p {
  font-size: 11px;
  margin-top: 10px;
  overflow-wrap: anywhere;
}
.detail-art .btn {
  margin-top: 16px;
}
.detail-layout h3 {
  font-size: 15px;
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}
.detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  background: #f8f9fb;
  border-radius: 8px;
  padding: 13px;
}
.detail-metrics > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
.detail-metrics small {
  font-size: 10px;
  color: #949dac;
}
.detail-metrics b {
  font-size: 16px;
  font-weight: 650;
  white-space: nowrap;
}
.rule-note {
  font-size: 11px;
  color: #8a94a4;
  margin: 12px 0 18px;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: #647085;
  margin-bottom: 16px;
}
.form-field input,
.form-field select,
.form-field textarea {
  padding: 10px 12px;
  border: 1px solid #dce1e9;
  background: white;
  border-radius: 8px;
  width: 100%;
  font-size: 13px;
  color: var(--ink);
}
.form-field textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.7;
}
.form-actions {
  padding-top: 4px;
}
.compare-grid {
  display: grid;
  grid-template-columns: repeat(var(--compare-columns, 3), minmax(0, 1fr));
  gap: 20px;
}
.compare-grid > div {
  min-width: 0;
}
.compare-grid .creative-art {
  border: 1px solid var(--line);
  border-radius: 10px;
}
.compare-grid h3 {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.6;
  min-height: 42px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.compare-grid p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
}
.compare-meta {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.compare-grid .badge {
  margin: 12px 0;
}
.compare-grid .btn {
  display: flex;
}
.help-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.help-content h3 {
  font-size: 14px;
  margin-bottom: 8px;
}
.help-content p {
  color: #7d8797;
  font-size: 13px;
  line-height: 1.8;
}
#toast {
  position: fixed;
  bottom: 28px;
  left: calc(50% + var(--sidebar) / 2);
  transform: translate(-50%, 12px);
  padding: 11px 18px;
  border-radius: 10px;
  background: #243047;
  color: white;
  font-size: 13px;
  box-shadow: 0 6px 22px #27334924;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
  z-index: 100;
  max-width: calc(100vw - 40px);
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.login-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
}
.login-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 38px;
  max-width: 420px;
  width: calc(100% - 32px);
  text-align: center;
  margin: 20px auto;
}
.login-card > img {
  width: 190px;
  margin: 0 auto 28px;
}
.login-card h1 {
  font-size: 28px;
  line-height: 1.4;
}
.login-card > p {
  font-size: 12px;
  color: #929aa7;
  margin-top: 10px;
}
.login-card .btn {
  width: 100%;
  margin-top: 24px;
  min-height: 42px;
}
#login-error {
  margin-top: 16px;
  font-size: 12px;
  line-height: 1.7;
  color: #8b95a5;
  overflow-wrap: anywhere;
}

@media (min-width: 1550px) {
  .material-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
@media (max-width: 1250px) {
  .kpi {
    padding: 16px;
  }
  .kpi-value {
    font-size: 24px;
  }
  .rank-card {
    grid-template-columns: 105px minmax(0, 1fr);
    padding: 14px;
    gap: 12px;
  }
  .rank-art {
    width: 105px;
    height: 105px;
  }
  .rank-data strong {
    font-size: 22px;
  }
  .scope-left {
    flex-wrap: wrap;
  }
  .date-label {
    flex-basis: 100%;
  }
}
@media (max-width: 1100px) {
  .material-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .rank-footer {
    flex-wrap: wrap;
    gap: 7px;
  }
  .rank-data {
    flex: 1 1 100%;
  }
}
@media (max-width: 960px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpi-foot {
    min-height: 0;
  }
  .ranking-grid {
    grid-template-columns: 1fr;
  }
  .rank-card {
    grid-template-columns: 124px minmax(0, 1fr);
    padding: 16px;
  }
  .rank-art {
    width: 124px;
    height: 124px;
  }
  .material-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .generation-layout {
    grid-template-columns: 1fr;
  }
  .detail-layout {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 20px;
  }
  .detail-art > .creative-art {
    height: 220px;
  }
}
@media (max-width: 700px) {
  .data-banner {
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
  }
  .data-banner > div {
    gap: 10px;
    flex-wrap: wrap;
  }
  .data-banner strong,
  #sync-summary {
    font-size: 11px;
  }
  .scope-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 20px;
  }
  .scope-left {
    display: contents;
  }
  .select-shell {
    width: auto;
    padding: 0 8px;
    gap: 6px;
  }
  .select-shell select {
    width: 100%;
    min-width: 0;
    padding-right: 5px;
  }
  .select-shell svg {
    width: 15px;
    height: 15px;
  }
  .date-label {
    grid-column: 1;
    font-size: 11px;
  }
  .kpi-grid {
    gap: 10px;
    margin-bottom: 24px;
  }
  .kpi {
    padding: 14px 12px;
    gap: 7px;
  }
  .kpi-value {
    font-size: clamp(20px, 6vw, 25px);
    letter-spacing: -0.8px;
  }
  .kpi-label,
  .kpi-foot {
    font-size: 11px;
  }
  .kpi-foot {
    min-height: 18px;
  }
  h2 {
    font-size: 17px;
  }
  .ranking-head,
  .section-heading {
    gap: 10px;
  }
  .ranking-head .btn {
    padding: 7px 10px;
    font-size: 11px;
  }
  .ranking-head p {
    max-width: 230px;
    font-size: 11px;
  }
  .ranking-grid {
    gap: 14px;
  }
  .ranking-title {
    padding: 12px 14px;
  }
  .rank-card {
    grid-template-columns: 94px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }
  .rank-art {
    width: 94px;
    height: 94px;
  }
  .rank-body {
    gap: 7px;
  }
  .rank-name {
    font-size: 12px;
    min-height: 38px;
  }
  .rank-top .shop-tag {
    font-size: 11px;
  }
  .rank-top {
    gap: 5px;
  }
  .badge {
    font-size: 11px;
  }
  .rank-data strong {
    font-size: 23px;
  }
  .rank-data b {
    font-size: 11px;
  }
  .rank-data span {
    font-size: 11px;
  }
  .coverage-panel .panel-heading {
    padding: 15px;
  }
  .filter-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .search {
    grid-column: 1/-1;
    width: 100%;
    max-width: none;
    min-width: 0;
  }
  .filter-controls select {
    width: 100%;
    height: 36px;
    padding-left: 8px;
    font-size: 11px;
  }
  .material-grid {
    gap: 10px;
  }
  .card-content {
    padding: 10px;
    gap: 7px;
  }
  .card-top {
    grid-template-columns: 1fr;
    gap: 4px;
    min-height: 38px;
  }
  .card-top .badge {
    justify-self: start;
  }
  .card-title {
    font-size: 12px;
    height: 42px;
  }
  .card-meta {
    font-size: 11px;
  }
  .card-metrics {
    gap: 5px;
    padding: 9px 0 5px;
    grid-template-columns: 1fr 1fr;
  }
  .card-metrics > div:first-child {
    grid-column: 1/-1;
  }
  .card-metrics > div:first-child b {
    font-size: 19px;
  }
  .card-metrics b {
    font-size: 13px;
  }
  .card-metrics span {
    font-size: 11px;
  }
  .card-bottom {
    gap: 6px;
    display: grid;
    grid-template-columns: 1fr;
  }
  .card-bottom .btn {
    width: 100%;
    min-height: 30px;
    padding: 5px 4px;
    font-size: 11px;
  }
  .compare-check {
    top: 7px;
    right: 7px;
    font-size: 11px;
    padding: 3px 5px;
  }
  .reference-panel,
  .prompt-panel {
    padding: 18px;
  }
  .reference-preview,
  .reference-preview .empty-state {
    min-height: 240px;
  }
  .reference-preview img {
    height: 240px;
  }
  .prompt-panel .form-field,
  .prompt-panel textarea {
    min-height: 240px;
  }
  .compare-bar {
    bottom: 80px;
    width: calc(100vw - 24px);
    padding: 9px 10px;
    gap: 8px;
    justify-content: space-between;
    font-size: 11px;
  }
  .compare-bar .btn {
    font-size: 11px;
    padding: 7px 10px;
    min-height: 32px;
  }
  dialog,
  dialog[data-kind] {
    width: calc(100vw - 24px);
    max-width: none;
    max-height: calc(100dvh - 30px);
    padding: 20px;
    border-radius: 13px;
  }
  .modal-head h2 {
    font-size: 18px;
  }
  .detail-layout {
    grid-template-columns: 1fr;
  }
  .detail-art > .creative-art {
    max-width: 280px;
    width: 100%;
    height: 280px;
    margin: auto;
  }
  .detail-metrics {
    padding: 12px 10px;
  }
  .detail-metrics b {
    font-size: 14px;
  }
  .form-field input,
  .form-field select,
  .form-field textarea {
    font-size: 16px;
  }
  .compare-grid {
    grid-template-columns: 1fr;
  }
  .compare-grid .creative-art {
    max-width: 230px;
    margin: auto;
  }
  .compare-grid h3 {
    min-height: 0;
  }
  .help-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  #toast {
    bottom: 82px;
    font-size: 12px;
  }
  .login-card {
    padding: 32px 26px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.connection-error {
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid #f3d0ca;
  border-radius: 8px;
  background: var(--red-soft);
  color: #a72b20;
  font-size: 13px;
}
.card-top .badge:only-child {
  justify-self: start;
}
.generation-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.generation-retry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  margin-bottom: 12px;
  font-size: 13px;
}
