:root {
  --ink: #17201d;
  --muted: #64706b;
  --line: #dce3df;
  --surface: #ffffff;
  --soft: #f5f8f7;
  --green: #176b5b;
  --green-dark: #0f5245;
  --blue: #2457d6;
  --blue-dark: #1c46ad;
  --warning: #9a6700;
  --danger: #b42318;
  --radius: 8px;
  --shadow: 0 16px 40px rgba(21, 33, 29, .16);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--soft); }
body {
  min-width: 280px;
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
.page-width { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.app-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; color: white; background: var(--green); border-radius: 7px; font-size: 11px; font-weight: 700; }
.brand strong { display: block; font-size: 15px; line-height: 1.3; }
.brand small { display: flex; align-items: center; gap: 5px; margin-top: 2px; color: var(--muted); font-size: 12px; }
.brand small i { width: 6px; height: 6px; border-radius: 50%; background: #a2aca7; }
.brand small i.is-ready { background: #248861; }
.brand small i.is-error { background: var(--danger); }
.header-actions { display: flex; align-items: center; gap: 14px; }
.text-button { padding: 6px 0; border: 0; color: #3f4e48; background: transparent; text-decoration: none; font-size: 14px; white-space: nowrap; }
.text-button:hover, .text-button:focus-visible { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }

.main-area { padding: 52px 0 72px; }
.is-wps-embed .brand { display: none; }
.is-wps-embed .header-inner { width: calc(100% - 16px); min-height: 40px; justify-content: flex-end; }
.is-wps-embed .app-header { position: sticky; top: 0; z-index: 12; }
.is-wps-embed .main-area { padding: 10px 0 24px; }
.is-wps-embed .main-area > .page-width { width: calc(100% - 16px); }
.is-wps-embed .intro { display: none; }
.is-wps-embed .ip-profile-context { display: none; }
.is-wps-embed .search-box { margin-top: 0; }
.is-wps-embed .results-section { margin-top: 22px; }
.intro { max-width: 720px; }
.eyebrow { margin: 0 0 7px; color: var(--green); font-size: 12px; font-weight: 700; line-height: 1.3; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: 30px; font-weight: 680; line-height: 1.25; }
.intro > p:last-child { margin: 10px 0 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.ip-profile-context { display: flex; align-items: center; gap: 9px; width: fit-content; margin-top: 20px; color: var(--muted); font-size: 13px; }
.ip-profile-context select { min-height: 34px; padding: 5px 28px 5px 9px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: var(--surface); }
.search-box { display: flex; gap: 8px; margin-top: 28px; padding: 7px; border: 1px solid #aac7c0; border-radius: var(--radius); background: var(--surface); box-shadow: 0 0 0 3px rgba(23, 107, 91, .07); }
.search-box:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23, 107, 91, .14); }
.search-box input { min-width: 0; flex: 1; height: 40px; padding: 0 10px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 15px; }
.primary-button { min-height: 40px; padding: 8px 18px; border: 1px solid var(--blue); border-radius: 6px; color: white; background: var(--blue); font-weight: 650; }
.primary-button:hover, .primary-button:focus-visible { background: var(--blue-dark); border-color: var(--blue-dark); }
.primary-button:disabled { cursor: wait; opacity: .62; }
.quick-searches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.quick-searches button { min-height: 30px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 5px; color: #41514a; background: var(--surface); font-size: 12px; }
.quick-searches button:hover, .quick-searches button:focus-visible { border-color: #8bb5a9; color: var(--green); background: #f1f8f5; }

.results-section { margin-top: 52px; }
.result-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.result-toolbar h2 { margin: 0; font-size: 18px; font-weight: 680; line-height: 1.35; }
.type-filter { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.type-filter select { min-height: 34px; padding: 5px 28px 5px 9px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: var(--surface); }
.result-meta { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.recommendation-details { margin-top: 18px; border-top: 1px solid var(--line); }
.recommendation-details[hidden] { display: none; }
.recommendation-details > summary { width: fit-content; padding: 12px 0; color: var(--muted); cursor: pointer; font-size: 12px; }
.recommendation-details > summary:hover, .recommendation-details > summary:focus-visible { color: var(--green); }
.recommendation-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-bottom: 4px; }
.recommendation-card { padding: 13px; border: 1px solid var(--line); border-radius: var(--radius); background: #fbfdfc; }
.recommendation-card h3 { margin: 0; color: var(--green); font-size: 13px; font-weight: 700; }
.recommendation-card p { margin: 8px 0 11px; color: #405048; font-size: 13px; line-height: 1.65; white-space: pre-wrap; }
.feedback-actions { display: flex; gap: 7px; }
.feedback-actions button { min-height: 29px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 5px; color: #425049; background: var(--surface); font-size: 12px; }
.feedback-actions button:hover, .feedback-actions button:focus-visible { border-color: #9bbeb4; color: var(--green); background: #f1f8f5; }
.feedback-actions button:disabled { cursor: default; opacity: .62; }
.feedback-note { align-self: center; color: var(--muted); font-size: 12px; }
.result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.empty-results { grid-column: 1 / -1; padding: 28px 0; color: var(--muted); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 14px; }

.media-card { position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.media-card:hover { border-color: #9bbeb4; box-shadow: 0 8px 20px rgba(19, 46, 37, .09); transform: translateY(-1px); }
.media-card:focus-within { outline: 2px solid #75a99b; outline-offset: 2px; }
.card-open { display: block; width: 100%; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; }
.card-preview { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: #eef2f0; }
.card-preview img, .card-preview video { display: block; width: 100%; height: 100%; object-fit: cover; }
.media-fallback { color: #718079; font-size: 14px; font-weight: 650; }
.media-kind { position: absolute; top: 10px; left: 10px; padding: 4px 7px; border-radius: 4px; color: white; background: rgba(18, 35, 29, .76); font-size: 11px; font-weight: 700; }
.card-content { padding: 13px 13px 0; }
.card-kicker { margin: 0 0 6px; color: var(--green); font-size: 12px; font-weight: 700; line-height: 1.3; }
.card-title { display: -webkit-box; margin: 0; overflow: hidden; color: var(--ink); font-size: 15px; font-weight: 680; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.card-summary { display: -webkit-box; min-height: 39px; margin: 8px 0 10px; overflow: hidden; color: #53615b; font-size: 13px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; min-height: 24px; }
.tag { max-width: 100%; padding: 3px 6px; overflow: hidden; border-radius: 4px; color: #596861; background: #edf2ef; font-size: 11px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.card-actions { display: flex; align-items: center; gap: 7px; margin-top: 12px; padding: 10px 13px 12px; border-top: 1px solid #edf0ee; }
.card-actions button, .card-actions a, .detail-actions button, .detail-actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 31px; padding: 5px 8px; border: 1px solid transparent; border-radius: 5px; color: var(--blue); background: transparent; text-decoration: none; font-size: 12px; font-weight: 650; }
.card-actions button:hover, .card-actions a:hover, .detail-actions button:hover, .detail-actions a:hover, .card-actions button:focus-visible, .card-actions a:focus-visible, .detail-actions button:focus-visible, .detail-actions a:focus-visible { color: var(--blue-dark); background: #f0f4ff; }
.relevance { margin-left: auto; color: var(--green); font-size: 12px; font-weight: 700; white-space: nowrap; }

.notice { position: fixed; right: 18px; bottom: 18px; z-index: 20; display: flex; align-items: center; gap: 12px; max-width: min(420px, calc(100% - 36px)); padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: var(--radius); color: #34423c; background: white; box-shadow: var(--shadow); font-size: 13px; line-height: 1.5; }
.notice[hidden] { display: none; }
.notice.is-error { border-left-color: var(--danger); }
.notice.is-warning { border-left-color: var(--warning); }
.icon-button { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; padding: 0; border: 0; border-radius: 5px; color: #596660; background: transparent; font-size: 24px; line-height: 1; }
.icon-button:hover, .icon-button:focus-visible { color: var(--ink); background: #edf1ef; }

dialog { width: min(840px, calc(100% - 32px)); max-height: min(88dvh, 900px); padding: 0; border: 0; border-radius: var(--radius); color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(20, 31, 28, .45); }
.media-dialog { width: min(960px, calc(100% - 32px)); }
.upload-dialog { width: min(620px, calc(100% - 32px)); }
.improvement-dialog { width: min(520px, calc(100% - 32px)); }
.dialog-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 0; font-size: 18px; font-weight: 680; line-height: 1.35; }
.dialog-header .eyebrow { min-height: 16px; margin-bottom: 3px; }
.detail-body { max-height: calc(88dvh - 78px); padding: 20px; overflow-y: auto; }
.detail-preview { display: grid; place-items: center; width: 100%; min-height: 220px; max-height: 480px; overflow: hidden; background: #eef2f0; }
.detail-preview img, .detail-preview video, .detail-preview iframe { display: block; width: 100%; height: 100%; max-height: 480px; border: 0; object-fit: contain; }
.detail-preview iframe { min-height: 480px; background: white; }
.detail-summary { margin: 18px 0 0; color: #405048; font-size: 14px; line-height: 1.7; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.detail-meta span { padding: 4px 7px; border-radius: 4px; color: #53615b; background: #f0f4f2; font-size: 12px; }
.detail-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.detail-section h3 { margin: 0 0 8px; font-size: 14px; font-weight: 700; }
.transcript { max-height: 260px; margin: 0; overflow: auto; color: #425049; font-family: inherit; font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.detail-actions .primary-link { color: white; background: var(--blue); border-color: var(--blue); }
.detail-actions .primary-link:hover, .detail-actions .primary-link:focus-visible { color: white; background: var(--blue-dark); border-color: var(--blue-dark); }
.detail-unavailable { margin-top: 16px; color: var(--muted); font-size: 13px; }
.upload-form { display: grid; max-height: calc(88dvh - 78px); gap: 16px; padding: 20px; overflow-y: auto; }
.upload-form label, .improvement-form label { display: grid; gap: 7px; color: #425049; font-size: 13px; font-weight: 650; }
.upload-form input, .upload-form select, .upload-form textarea, .improvement-form input, .improvement-form textarea { width: 100%; padding: 9px; border: 1px solid #cbd6d1; border-radius: 5px; color: var(--ink); background: white; font-weight: 400; outline: none; }
.upload-form input:focus, .upload-form select:focus, .upload-form textarea:focus, .improvement-form input:focus, .improvement-form textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23, 107, 91, .1); }
.upload-device { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: #f7faf8; font-size: 12px; }
.upload-device strong { overflow: hidden; color: #35483f; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.upload-queue { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.upload-queue[hidden] { display: none; }
.upload-item { min-width: 0; padding: 11px; border: 1px solid var(--line); border-radius: 6px; background: #fbfdfc; }
.upload-item-heading, .upload-item-footer { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 12px; }
.upload-item-heading > div { min-width: 0; }
.upload-item-heading strong, .upload-item-heading small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item-heading strong { color: #2d3d36; font-size: 13px; font-weight: 650; }
.upload-item-heading small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.upload-item-state { flex: 0 0 auto; padding: 3px 6px; border-radius: 4px; color: #5c6963; background: #edf1ef; font-size: 10px; font-weight: 700; }
.upload-item-state.uploading, .upload-item-state.initializing, .upload-item-state.completing { color: #225c9a; background: #eaf3ff; }
.upload-item-state.pending { color: #247254; background: #e8f7ef; }
.upload-item-state.failed, .upload-item-state.rejected { color: #963d3d; background: #fff0f0; }
.upload-item-state.cancelled { color: #806325; background: #fff6e2; }
.upload-progress { height: 5px; margin-top: 10px; overflow: hidden; border-radius: 3px; background: #e6ebe8; }
.upload-progress span { display: block; height: 100%; border-radius: inherit; background: var(--blue); transition: width .15s ease; }
.upload-item-footer { align-items: center; margin-top: 8px; }
.upload-item-message { min-width: 0; color: var(--muted); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.upload-item-actions { display: inline-flex; flex: 0 0 auto; gap: 4px; }
.upload-item-actions button { min-height: 27px; padding: 3px 7px; border: 0; border-radius: 4px; color: var(--blue); background: #eef3ff; font-size: 11px; }
.upload-item-actions button:hover, .upload-item-actions button:focus-visible { color: var(--blue-dark); background: #e0e9ff; }
.upload-status { margin: 0; padding: 9px 10px; border: 1px solid #d5e1dc; border-radius: 5px; color: #3d5b4f; background: #f2f8f5; font-size: 12px; line-height: 1.5; }
.upload-status[hidden] { display: none; }
.upload-status.is-error { border-color: #eccccc; color: #963d3d; background: #fff6f6; }
.upload-status.is-success { border-color: #c8e2d5; color: #247254; background: #edf8f2; }
.improvement-form { display: grid; gap: 9px; padding: 20px; }
.improvement-form textarea { min-height: 140px; resize: vertical; }
.improvement-form .primary-button { margin-top: 4px; }
.screenshot-paste-zone { display: grid; min-height: 82px; place-content: center; gap: 5px; padding: 12px; border: 1px dashed #8eaaa0; border-radius: 5px; color: #365d50; background: #f4f9f7; text-align: center; cursor: text; outline: none; }
.screenshot-paste-zone strong { font-size: 14px; }
.screenshot-paste-zone span { color: var(--muted); font-size: 12px; font-weight: 400; }
.screenshot-paste-zone:hover, .screenshot-paste-zone:focus-visible { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23, 107, 91, .1); }
.screenshot-paste-zone.has-pasted { border-color: var(--green); background: #e9f7f1; }
.screenshot-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.screenshot-item { position: relative; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: #edf2ef; }
.screenshot-item img { display: block; width: 100%; height: 100%; object-fit: cover; }
.screenshot-remove { position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 25px; height: 25px; padding: 0; border: 0; border-radius: 4px; color: white; background: rgba(23, 32, 29, .78); font-size: 19px; line-height: 1; }
.screenshot-remove:hover, .screenshot-remove:focus-visible { background: var(--danger); }
.form-hint { margin: -6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }

@media (max-width: 900px) {
  .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .page-width { width: min(100% - 24px, 1180px); }
  .app-header { position: sticky; top: 0; z-index: 12; }
  .header-inner { min-height: 56px; gap: 10px; }
  .header-actions { gap: 11px; }
  .text-button { font-size: 13px; }
  .main-area { padding: 24px 0 max(40px, env(safe-area-inset-bottom)); }
  h1 { font-size: 22px; }
  .intro > p:last-child { margin-top: 7px; font-size: 13px; line-height: 1.55; }
  .search-box { margin-top: 18px; padding: 5px; }
  .search-box input { font-size: 14px; }
  .primary-button { padding-inline: 13px; }
  .quick-searches { flex-wrap: nowrap; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .quick-searches::-webkit-scrollbar { display: none; }
  .quick-searches button { flex: 0 0 auto; }
  .results-section { margin-top: 28px; }
  .result-toolbar { align-items: center; gap: 10px; padding-bottom: 10px; }
  .result-toolbar .eyebrow { display: none; }
  .result-toolbar h2 { font-size: 16px; }
  .type-filter { gap: 6px; }
  .type-filter span { font-size: 12px; }
  .type-filter select { width: 116px; min-height: 38px; padding-left: 8px; }
  .result-grid { grid-template-columns: 1fr; }
  .recommendation-panel { grid-template-columns: 1fr; }
  .card-content { padding: 11px 11px 0; }
  .card-actions { min-height: 48px; margin-top: 10px; padding: 8px 11px; }
  .card-actions button, .card-actions a { min-height: 38px; padding-inline: 9px; }
  .card-title { font-size: 14px; }
  .card-summary { margin-top: 6px; }
  .screenshot-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  dialog, .media-dialog, .upload-dialog, .improvement-dialog { width: 100%; max-width: none; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .dialog-header { min-height: 62px; padding-top: max(14px, env(safe-area-inset-top)); }
  .detail-body { max-height: calc(100dvh - 62px); padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .detail-preview { min-height: 180px; max-height: 52dvh; }
  .detail-preview iframe { min-height: 54dvh; }
  .detail-actions { position: sticky; bottom: 0; z-index: 2; margin-inline: -14px; padding: 10px 14px max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255, 255, 255, .96); }
  .detail-actions button, .detail-actions a { min-height: 42px; }
  .dialog-header, .detail-body, .upload-form, .improvement-form { padding-left: 14px; padding-right: 14px; }
  .upload-form { max-height: calc(100dvh - 62px); padding-bottom: max(18px, env(safe-area-inset-bottom)); }
  .upload-device, .upload-item-heading, .upload-item-footer { align-items: flex-start; }
  .notice { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); max-width: calc(100% - 24px); }
}
@media (max-width: 360px) {
  .page-width { width: calc(100% - 18px); }
  .brand-mark { width: 30px; height: 30px; flex-basis: 30px; }
  .brand strong { font-size: 14px; }
  .brand small { font-size: 11px; }
  .header-actions { gap: 8px; }
  .search-box input { padding-inline: 7px; }
  .primary-button { padding-inline: 11px; }
  .type-filter span { display: none; }
  .type-filter select { width: 108px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
