:root { color-scheme: light; --ink: #202124; --muted: #85868a; --line: #e7e8ea; --red: #df5143; --blue: #2862c7; --green: #276e50; }
* { box-sizing: border-box; }
body { margin: 0; background: #fafafa; color: var(--ink); font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif; font-size: 14px; letter-spacing: 0; }
button, input, select { font: inherit; }
button, a, select, input[type=color] { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .5; }
button, input, select { border-radius: 5px; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid #2862c7; outline-offset: 3px; }
button { letter-spacing: 0; }
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; stroke-width: 1.7; flex-shrink: 0; }
.site-header { height: 82px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 4.5%; background: white; }
.brand, .header-right { display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 34px; height: 34px; background: var(--red); color: white; font-size: 28px; font-weight: 800; font-family: Georgia, serif; line-height: 28px; text-align: center; border-radius: 6px; }
.brand-name { font-size: 23px; font-weight: 750; }
.brand-divider { height: 20px; width: 1px; background: var(--line); margin: 0 2px; }
.brand-caption { font-size: 14px; color: #6a6b70; }
.domain-label { font-family: Consolas, monospace; color: var(--muted); font-size: 12px; margin-right: 10px; }
.button { height: 38px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; border: 1px solid transparent; padding: 0 14px; font-size: 12px; white-space: nowrap; font-weight: 600; }
.primary { background: var(--ink); color: white; }
.primary:hover { background: #414347; }
.secondary { background: white; border-color: #dcdde0; }
.secondary:hover { background: #f3f4f5; }
.danger { color: white; background: #be3932; }
.icon-button { width: 34px; height: 34px; display: inline-flex; justify-content: center; align-items: center; padding: 0; border: 1px solid transparent; background: transparent; color: #6a6c72; flex-shrink: 0; }
.icon-button:hover { background: #eeeff1; color: var(--ink); }
.icon-button[aria-pressed=true] { color: var(--blue); background: #eaf0fc; }
.text-button { border: 0; display: inline-flex; align-items: center; gap: 7px; background: transparent; padding: 4px; font-size: 12px; color: #65676e; }
.text-button:hover { color: var(--blue); }
main { max-width: 1440px; margin: 0 auto; padding: 36px 4.5% 0; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 30px; }
.eyebrow { font-family: Consolas, monospace; font-size: 10px; color: #98999f; margin-bottom: 9px; }
h1 { font-size: 29px; line-height: 1.4; margin: 0; font-weight: 700; display: flex; align-items: baseline; gap: 8px; }
.heading-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.tabs { display: flex; gap: 5px; padding: 4px; background: #f0f1f2; border-radius: 6px; }
.tab { min-height: 38px; padding: 0 15px; border: 0; display: flex; align-items: center; gap: 8px; background: transparent; color: #707179; font-size: 12px; font-weight: 600; }
.tab.active { background: white; color: var(--ink); box-shadow: 0 1px 3px #2021240d; }
.count { font-size: 10px; min-width: 16px; text-align: center; color: #8a8b90; }
.workspace-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 0 15px; border-bottom: 1px solid var(--line); }
h2 { margin: 0; font-size: 14px; font-weight: 600; }
.palette-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.palette-title h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 230px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #47a077; flex-shrink: 0; }
.muted { color: var(--muted); font-size: 11px; font-family: Consolas, "Microsoft YaHei", monospace; }
#image-size { margin-left: 6px; }
.toolbar-actions { display: flex; align-items: center; gap: 10px; }
.count-select { display: flex; align-items: center; gap: 10px; padding-right: 9px; border-right: 1px solid var(--line); color: #76787e; font-size: 12px; }
select { border: 0; background: transparent; padding: 4px; color: var(--ink); }
.workbench { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); gap: 36px; padding-top: 24px; }
.image-stage { position: relative; background: #eeefef; aspect-ratio: 1.78; overflow: hidden; border-radius: 5px; display: flex; align-items: center; justify-content: center; }
.image-stage img { width: 100%; height: 100%; display: block; object-fit: contain; }
.image-stage.dragging { outline: 3px solid var(--blue); outline-offset: 4px; }
.image-stage.picking { cursor: crosshair; }
.image-tools { position: absolute; top: 13px; right: 13px; }
.image-tools .icon-button { background: #fffffff2; box-shadow: 0 2px 8px #00000012; color: var(--ink); }
.image-tools .icon-button[aria-pressed=true] { background: var(--blue); color: white; }
.image-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; background: #ffffffd9; font-size: 12px; }
.spinner { width: 16px; height: 16px; border: 2px solid #d5d6d9; border-top-color: var(--red); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.photo-caption { display: flex; justify-content: space-between; align-items: center; margin: 10px 0 17px; font-size: 10px; color: #8d8e93; }
.photo-caption a { display: inline-flex; align-items: center; gap: 3px; }
.photo-caption svg { width: 12px; height: 12px; }
.palette-strip { display: flex; height: 64px; border-radius: 4px; overflow: hidden; }
.strip-color { flex: 1; min-width: 0; border: 0; border-radius: 0; padding: 8px 2px; display: flex; justify-content: center; align-items: flex-end; font-family: Consolas, monospace; font-size: 9px; transition: flex .18s ease; }
.strip-color:hover { flex: 1.25; }
.palette-column { min-width: 0; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 24px; margin-bottom: 16px; }
.palette-column .section-heading { margin-bottom: 9px; min-height: 34px; }
.swatch-list { border-top: 1px solid var(--line); }
.swatch-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 34px 34px; align-items: center; gap: 12px; min-height: 62px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.swatch-row.selected .hex-input { color: var(--blue); }
.swatch-input { width: 44px; height: 44px; padding: 0; border: 1px solid #0000000d; background: none; border-radius: 5px; overflow: hidden; cursor: pointer; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch { border: 0; border-radius: 3px; }
input[type=color]::-moz-color-swatch { border: 0; border-radius: 3px; }
.swatch-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.hex-input { font-family: Consolas, monospace; font-size: 14px; font-weight: 600; background: transparent; border: 0; padding: 0; width: 94px; color: var(--ink); }
.hex-input:focus { background: #f1f3f7; }
.rgb-label { font-family: Consolas, monospace; color: #8c8e94; font-size: 9px; white-space: nowrap; }
.swatch-row .icon-button svg { width: 15px; height: 15px; }
.palette-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; }
#selected-label { font-family: Consolas, monospace; font-size: 10px; color: #9b9ca2; }
.secondary-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); gap: 36px; margin-top: 34px; padding-top: 23px; border-top: 1px solid var(--line); }
.sample-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.sample { padding: 0; background: transparent; border: 0; text-align: left; position: relative; border-radius: 5px; min-width: 0; color: #73757d; }
.sample img { width: 100%; aspect-ratio: 1.4; object-fit: cover; border-radius: 4px; display: block; }
.sample span { display: block; padding-top: 9px; font-size: 11px; white-space: nowrap; }
.sample svg { display: none; position: absolute; top: 6px; right: 6px; width: 19px; height: 19px; padding: 3px; background: white; border-radius: 50%; color: var(--ink); }
.sample.active { color: var(--ink); }
.sample.active img { outline: 2px solid var(--red); outline-offset: 3px; }
.sample.active svg { display: block; }
.standard-label { font-family: Consolas, monospace; font-size: 9px; color: #96989d; }
.contrast-inputs { display: flex; align-items: center; gap: 12px; }
.contrast-inputs label { display: flex; align-items: center; gap: 9px; font-size: 11px; color: #7b7d84; }
.contrast-inputs input { width: 24px; height: 24px; padding: 0; border: 1px solid #dcdde0; background: transparent; }
.contrast-inputs .icon-button { width: 26px; height: 26px; }
.contrast-inputs svg { width: 14px; height: 14px; }
.contrast-number { margin-left: auto; display: flex; align-items: baseline; gap: 4px; }
.contrast-number strong { font-size: 23px; font-weight: 600; font-family: Consolas, monospace; }
.contrast-number span { color: #8d8f95; font-size: 11px; }
.contrast-preview { margin-top: 13px; display: flex; align-items: center; gap: 15px; padding: 17px 18px; min-height: 79px; border-radius: 5px; background: #f6f3ee; color: #202124; }
.preview-type { font-size: 30px; font-weight: 600; line-height: 1; }
.contrast-preview div { display: flex; flex-direction: column; gap: 7px; }
.contrast-preview strong { font-size: 12px; font-weight: 500; }
.contrast-preview div span { font-size: 10px; }
.contrast-results { display: flex; gap: 22px; margin-top: 12px; font-size: 10px; color: #878991; }
.contrast-results b { font-weight: 500; background: #e6f2eb; color: var(--green); font-size: 9px; padding: 3px 5px; border-radius: 3px; margin-left: 5px; }
.contrast-results b.fail { background: #fbe9e7; color: #be3932; }
footer { max-width: 1440px; margin: 36px auto 0; padding: 20px 4.5% 25px; display: flex; justify-content: space-between; color: #afb0b5; font-family: Consolas, monospace; font-size: 9px; border-top: 1px solid var(--line); }
.footer-slash { padding: 0 9px; color: #d0d1d5; }
.library-heading { display: flex; align-items: center; gap: 12px; padding: 16px 0 22px; border-top: 1px solid var(--line); }
.empty-state { min-height: 420px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 16px; color: #9a9ca2; }
.empty-state > svg { width: 30px; height: 30px; }
.empty-state h3 { font-weight: 400; font-size: 14px; margin: 0 0 5px; }
.library-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.saved-card { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: white; }
.saved-colors { display: flex; height: 135px; width: 100%; border: 0; border-radius: 0; padding: 0; }
.saved-colors span { flex: 1; }
.saved-card-meta { padding: 15px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.saved-card-meta h3 { margin: 0 0 6px; font-size: 13px; font-weight: 500; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-card-meta p { margin: 0; font-size: 10px; color: #9a9ca2; }
.saved-actions { display: flex; }
dialog { border: 1px solid var(--line); padding: 25px; border-radius: 8px; width: 430px; max-width: calc(100vw - 32px); color: var(--ink); box-shadow: 0 16px 70px #00000026; }
dialog::backdrop { background: #20212466; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.dialog-heading h2 { font-size: 18px; }
.field-label { display: block; font-size: 12px; color: #76787f; margin-bottom: 8px; }
.name-input { width: 100%; border: 1px solid #dcdde0; padding: 11px 12px; background: #fafafa; }
.export-preview { display: flex; margin: 20px 0; height: 70px; border-radius: 5px; overflow: hidden; }
.export-preview span { flex: 1; }
.export-options { display: grid; gap: 8px; }
.export-options button { border: 1px solid var(--line); background: white; display: grid; grid-template-columns: 22px 47px 1fr 18px; align-items: center; gap: 12px; padding: 13px; text-align: left; }
.export-options button:hover { border-color: var(--blue); background: #f8faff; }
.export-options strong { font-family: Consolas, monospace; font-size: 13px; }
.export-options span { color: #888a91; font-size: 11px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 28px; }
#delete-name { overflow-wrap: anywhere; color: #777a81; }
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: #202124; color: white; border-radius: 5px; padding: 12px 20px; box-shadow: 0 4px 20px #00000015; font-size: 12px; z-index: 20; max-width: calc(100vw - 32px); text-align: center; }
@media (min-width: 1440px) { .site-header { padding: 0 max(4.5%, calc((100vw - 1310px) / 2)); } }
@media (max-width: 1000px) {
  .workbench, .secondary-grid { grid-template-columns: minmax(0, 1.4fr) minmax(270px, 1fr); gap: 24px; }
  .swatch-row { gap: 8px; }
  .sample-grid { gap: 10px; }
  .contrast-inputs { gap: 8px; }
  .contrast-inputs label { gap: 5px; }
  .contrast-number strong { font-size: 20px; }
}
@media (max-width: 760px) {
  .site-header { height: 66px; padding: 0 20px; }
  .brand-caption, .brand-divider, .domain-label { display: none; }
  .brand { gap: 9px; }
  .brand-name { font-size: 22px; }
  .brand-mark { width: 30px; height: 30px; line-height: 26px; font-size: 26px; }
  main { padding: 25px 20px 0; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 19px; margin-bottom: 22px; }
  h1 { font-size: 26px; }
  .tabs { width: 100%; }
  .tab { flex: 1; justify-content: center; }
  .workbench, .secondary-grid { grid-template-columns: 1fr; gap: 25px; }
  .workbench { padding-top: 20px; }
  .workspace-toolbar { align-items: flex-start; flex-direction: column; gap: 14px; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions > .button { margin-left: auto; }
  .palette-title h2 { max-width: 195px; }
  .image-stage { aspect-ratio: 1.48; }
  .palette-strip { height: 57px; }
  .swatch-row { grid-template-columns: 42px minmax(0, 1fr) 34px 34px; min-height: 61px; gap: 13px; }
  .swatch-input { width: 42px; height: 42px; }
  .secondary-grid { margin-top: 20px; }
  .sample-grid { gap: 10px; }
  .sample span { font-size: 10px; }
  .sample img { aspect-ratio: 1; }
  .contrast-section { padding-top: 23px; border-top: 1px solid var(--line); }
  .contrast-preview { padding: 20px; }
  .library-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .saved-card-meta { padding: 10px; flex-wrap: wrap; gap: 5px; }
  .saved-colors { height: 110px; }
  .saved-card-meta h3 { max-width: 140px; }
  footer { padding: 18px 20px 25px; }
}
@media (max-width: 360px) {
  main { padding-left: 16px; padding-right: 16px; }
  .site-header { padding: 0 16px; }
  .strip-color { font-size: 8px; }
  .count-select { gap: 4px; }
  .toolbar-actions { gap: 6px; }
  .sample-grid { gap: 8px; }
  .contrast-inputs { gap: 7px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
