:root {
  font:
    14px/1.5 "Segoe UI",
    "Microsoft YaHei",
    system-ui,
    sans-serif;
  color: #242424;
  background: #f8f8f8;
  color-scheme: light dark;
  --surface: #fff;
  --border: #e7e7e7;
  --muted: #686868;
  --selected: #efefef;
  --accent: #2563eb;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
select {
  touch-action: manipulation;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.6;
}
a {
  color: inherit;
  text-underline-offset: 3px;
}
::selection {
  background: #bfdbfe;
  color: #17305e;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  text-decoration: none;
}
/* Same brand assets as the extension (public/logos). */
.brand .app-logo {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 5px;
}
.brand .brand-wordmark {
  display: block;
  width: 96px;
  height: auto;
}
.top-actions,
.share-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.top-actions a {
  font-size: 13px;
}
.top-actions select {
  border: 1px solid var(--border);
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--surface);
}
main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px;
}
h1 {
  font-size: 22px;
  line-height: 1.3;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
  font-weight: 600;
}
.muted {
  color: var(--muted);
  margin: 0;
  font-size: 13px;
}
.share-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
}
.share-heading > div:first-child {
  min-width: 0;
}
.share-actions {
  flex-shrink: 0;
}
.primary,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 8px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid var(--border);
}
.primary {
  background: #30343b;
  color: #fff;
  border-color: #30343b;
}
.primary:hover {
  background: #454b55;
}
.secondary {
  background: var(--surface);
  color: inherit;
}
.toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  font-size: 13px;
}
.toggle input {
  accent-color: var(--accent);
}
#status:empty {
  display: none;
}
#status {
  margin: 12px 0 20px;
  color: var(--muted);
}
#notice {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 18px;
  margin: 0 0 24px;
  max-width: 680px;
}
#notice p {
  margin: 0 0 14px;
}
#notice .secondary {
  margin-left: 8px;
}
#image-scroll {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
#canvas {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  isolation: isolate;
  z-index: 0;
}
#image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
}
#hotspots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#hotspots a {
  position: absolute;
  display: block;
  --hotspot-edge: #3b82f600;
  border: 0;
  border-radius: 6px;
  pointer-events: auto;
  background: transparent;
}
#hotspots.visible a {
  --hotspot-edge: rgba(59, 130, 246, 0.2);
}
#hotspots a:hover,
#hotspots a:focus-visible {
  --hotspot-edge: rgba(59, 130, 246, 0.5);
  outline: none;
}
.link-preview {
  position: fixed;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: min(360px, calc(100vw - 16px));
  max-height: calc(100vh - 16px);
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid #d3d3d3;
  border-radius: 10px;
  background: #fff;
  color: #242424;
  box-shadow: 0 10px 32px #0000001a;
  font-family: Inter, "Microsoft YaHei", system-ui, sans-serif;
  line-height: normal;
}
.link-preview strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-preview span {
  margin-top: 3px;
  color: #1d4ed8;
  font-size: 12px;
}
.link-preview small {
  color: #686868;
  font-size: 11px;
}
.link-preview-url {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  min-width: 0;
}
.link-preview-url small {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-preview-url button {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid #d3d3d3;
  border-radius: 6px;
  background: #efefef;
  color: #242424;
  font-size: 11px;
  cursor: pointer;
}
.link-preview-url button:hover {
  background: #e7e7e7;
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}
.link-preview em {
  margin-top: 5px;
  color: #686868;
  font-size: 11px;
  font-style: normal;
}
#caption {
  margin-top: 16px;
  max-width: 80ch;
}
#home,
#error,
#install {
  max-width: 700px;
  padding: 56px 0;
}
#home h1,
#install h1 {
  font-size: 32px;
}
#home p,
#install p,
#error p {
  font-size: 15px;
  max-width: 65ch;
  line-height: 1.7;
  margin: 12px 0 24px;
}
#install ol {
  padding-left: 24px;
  margin: 30px 0;
}
#install li {
  margin: 12px 0;
  line-height: 1.7;
}
footer {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px 28px;
  font-size: 12px;
  color: var(--muted);
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
@media (prefers-color-scheme: dark) {
  /* The wordmark file is black; the extension inverts it on dark backgrounds too. */
  .brand .brand-wordmark {
    filter: invert(1);
  }
  :root {
    color: #f0f0f1;
    background: #17191d;
    --surface: #202226;
    --border: #36383e;
    --muted: #b2b4bc;
    --selected: #32353c;
    --accent: #82b3ff;
  }
  .primary {
    background: #e4e6eb;
    color: #202226;
    border-color: #e4e6eb;
  }
  .primary:hover {
    background: #fff;
  }
  .link-preview {
    background: #202226;
    color: #f0f0f1;
    border-color: #53565f;
    box-shadow: 0 10px 32px #00000066;
  }
  .link-preview span {
    color: #93c5fd;
  }
  .link-preview small,
  .link-preview em {
    color: #b2b4bc;
  }
  .link-preview-url button {
    background: #32353c;
    color: #f0f0f1;
    border-color: #53565f;
  }
  .link-preview-url button:hover {
    background: #3f424a;
    outline-color: #82b3ff;
  }
}
@media (max-width: 650px) {
  .topbar {
    height: 60px;
    padding: 0 16px;
    gap: 12px;
  }
  .top-actions {
    gap: 12px;
  }
  .top-actions a {
    display: none;
  }
  main {
    padding: 24px 16px;
  }
  .share-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }
  .share-actions {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }
  h1 {
    font-size: 20px;
  }
  #home h1,
  #install h1 {
    font-size: 28px;
  }
  #home,
  #error,
  #install {
    padding: 28px 0;
  }
  .primary,
  .secondary {
    font-size: 13px;
  }
  #notice .secondary {
    margin: 10px 0 0;
  }
  footer {
    padding: 0 16px 24px;
  }
}
