:root {
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  font-synthesis: none;
  --ink: #17181a;
  --text: #676b72;
  --soft: #9a9ea5;
  --line: #e4e7eb;
  --wash: #f4f6f8;
  --control: #f7f8fa;
  --paper: #ffffff;
  --canvas: #f7f8fa;
  --focus: #6577d8;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 9px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--ink); background: var(--canvas); }
button, input, select { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
.icon { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.page { min-height: 100vh; padding: clamp(92px, 17vh, 170px) 24px 64px; }
.page.has-result { padding-top: 76px; }
.tool { width: min(640px, 100%); margin: 0 auto; }

.brand-icon-slot {
  width: 54px;
  height: 54px;
  margin-bottom: 27px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(18, 20, 24, .09);
}
.brand-icon-slot img { width: 100%; height: 100%; display: block; object-fit: cover; }

h1 { margin: 0; font-size: clamp(34px, 4.4vw, 42px); font-weight: 600; line-height: 1.18; letter-spacing: -.055em; }
.intro { margin: 11px 0 42px; color: var(--text); font-size: 15px; line-height: 1.7; }

form { width: 100%; }
.url-label { display: block; margin-bottom: 10px; font-size: 14px; font-weight: 600; }
.capture-row { display: grid; grid-template-columns: minmax(0, 1fr) 132px; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); box-shadow: 0 8px 26px rgba(27, 31, 38, .055); transition: border-color .18s, box-shadow .18s; }
.capture-row:focus-within { border-color: #c7cbd2; box-shadow: 0 8px 26px rgba(27, 31, 38, .07), 0 0 0 4px rgba(101, 119, 216, .08); }
.url-input { min-width: 0; height: 50px; display: flex; align-items: center; gap: 11px; padding: 0 13px; border: 0; border-radius: var(--radius-md); background: var(--paper); }
.url-input .icon { width: 17px; color: #9a9a9a; }
.url-input input { min-width: 0; width: 100%; height: 100%; padding: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 15px; }
.url-input input::placeholder { color: #b7b7b7; }
.capture-button { height: 50px; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 0 18px; border: 0; border-radius: var(--radius-md); color: white; background: var(--ink); font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background .16s, transform .16s, box-shadow .16s; }
.capture-button:hover:not(:disabled) { background: #2b2d31; transform: translateY(-1px); box-shadow: 0 7px 16px rgba(23, 24, 26, .16); }
.capture-button:disabled { opacity: .72; cursor: wait; }

.form-options { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 7px 2px 9px; border-bottom: 1px solid var(--line); }
.advanced-button { display: flex; align-items: center; gap: 8px; margin-left: -10px; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); color: var(--text); background: none; font-size: 13px; cursor: pointer; transition: color .16s, background .16s; }
.advanced-button:hover { color: var(--ink); background: rgba(255, 255, 255, .78); }
.advanced-button .icon { width: 14px; }
.advanced-button > span { margin-left: 2px; font-size: 14px; font-weight: 300; }
.full-page-toggle { position: relative; display: flex; align-items: center; gap: 7px; margin-right: -8px; padding: 7px 8px; border-radius: var(--radius-sm); color: var(--text); font-size: 13px; cursor: pointer; transition: color .16s, background .16s; }
.full-page-toggle:hover { color: var(--ink); background: rgba(255, 255, 255, .78); }
.full-page-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.full-page-toggle i { width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid #c7cbd1; border-radius: 6px; color: transparent; background: white; font-style: normal; transition: border-color .16s, background .16s; }
.full-page-toggle i .icon { width: 11px; }
.full-page-toggle input:checked + i { border-color: var(--ink); color: white; background: var(--ink); }

.advanced-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 14px; padding: 22px 0 7px; }
.advanced-fields label > span { display: block; margin-bottom: 8px; color: var(--text); font-size: 12px; font-weight: 500; }
.advanced-fields input, .advanced-fields select { width: 100%; height: 46px; padding: 0 13px; border: 1px solid var(--line); outline: none; color: var(--ink); background-color: var(--control); border-radius: var(--radius-md); font-size: 14px; transition: border-color .16s, background-color .16s, box-shadow .16s; }
.advanced-fields select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%23787d85' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; background-size: 14px; cursor: pointer; }
.advanced-fields input:hover, .advanced-fields select:hover, .unit-input:hover { border-color: #cdd1d7; background-color: #fbfbfc; }
.advanced-fields input:focus, .advanced-fields select:focus { border-color: #b8bfda; background-color: white; box-shadow: 0 0 0 4px rgba(101, 119, 216, .08); }
.unit-input { height: 46px; display: flex; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--control); transition: border-color .16s, background-color .16s, box-shadow .16s; }
.unit-input:focus-within { border-color: #b8bfda; background: white; box-shadow: 0 0 0 4px rgba(101, 119, 216, .08); }
.unit-input input { height: 100%; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.unit-input em { padding-right: 11px; color: var(--soft); font-size: 11px; font-style: normal; }

.message { margin-top: 16px; font-size: 13px; }
.loading-message { display: flex; align-items: center; gap: 9px; color: var(--text); }
.spinner { width: 14px; height: 14px; display: block; flex: 0 0 auto; border: 1.5px solid #d0d0d0; border-top-color: currentColor; border-radius: 50%; animation: spin .8s linear infinite; }
.capture-button .spinner { border-color: #5c5c5c; border-top-color: white; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-message { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid #f0d6d2; border-radius: var(--radius-md); color: #70413c; background: #fff6f5; }
.error-message strong { color: #9f3027; font-size: 13px; }
.privacy-note { margin: 15px 0 0; color: #92969d; font-size: 11px; }

.result { width: min(940px, calc(100vw - 40px)); margin-top: 58px; }
.result header { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 4px; }
.result header > div { min-width: 0; display: grid; grid-template-columns: 8px auto; align-items: center; column-gap: 8px; }
.result header > div i { width: 6px; height: 6px; border-radius: 50%; background: #62a85a; }
.result header span { font-size: 13px; font-weight: 600; }
.result header small { grid-column: 2; max-width: 400px; overflow: hidden; color: var(--soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.result header a { display: flex; align-items: center; gap: 7px; padding: 9px 12px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .72); font-size: 13px; font-weight: 600; transition: background .16s, transform .16s; }
.result header a:hover { background: white; transform: translateY(-1px); }
.result header a .icon { width: 15px; }
.result-image { max-height: 720px; overflow: auto; border: 1px solid var(--line); border-radius: 20px; background: var(--wash); box-shadow: 0 18px 48px rgba(27, 31, 38, .09); }
.result-image img { display: block; width: 100%; height: auto; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, .full-page-toggle:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }

@media (max-width: 600px) {
  .page, .page.has-result { padding: 66px 20px 44px; }
  .brand-icon-slot { margin-bottom: 23px; }
  .intro { margin-bottom: 34px; }
  .capture-row { grid-template-columns: 1fr; gap: 4px; }
  .capture-button { width: 100%; }
  .advanced-fields { grid-template-columns: 1fr; }
  .result { width: 100%; margin-top: 46px; }
  .result header small { max-width: 180px; }
  .result-image { max-height: 600px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
