:root {
  --ink: #102131;
  --muted: #627080;
  --line: #dce2e7;
  --paper: #f3f5f6;
  --white: #ffffff;
  --navy: #071b2c;
  --navy-2: #0d2d45;
  --cyan: #17c3b2;
  --cyan-dark: #009d90;
  --gold: #d4a94f;
  --shadow: 0 24px 70px rgba(7, 27, 44, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(23, 195, 178, 0.045), transparent 34%),
    var(--paper);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(23, 195, 178, 0.35);
  outline-offset: 3px;
}
.page-shell { min-height: 100vh; overflow: hidden; }
.topbar {
  width: min(1180px, calc(100% - 40px));
  height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; border: 1px solid #c7d0d7; display: grid; place-items: center; background: #fff; }
.brand-mark svg { width: 26px; fill: none; stroke: var(--navy); stroke-width: 1.7; }
.brand strong { display: block; font-size: 16px; letter-spacing: .08em; }
.brand small { display: block; margin-top: 3px; color: #8a949d; font: 9px/1.2 ui-monospace, monospace; letter-spacing: .16em; }
.privacy-pill { border: 1px solid #d8dfe4; background: rgba(255,255,255,.72); padding: 8px 13px; font-size: 12px; color: #52616e; display: flex; align-items: center; gap: 8px; }
.privacy-pill span { width: 7px; height: 7px; background: var(--cyan); border-radius: 50%; box-shadow: 0 0 0 4px rgba(23,195,178,.12); }

.hero {
  position: relative;
  min-height: 610px;
  padding: 84px max(28px, calc((100vw - 1180px) / 2)) 95px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px) 0 0 / 52px 52px,
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px) 0 0 / 52px 52px,
    radial-gradient(circle at 72% 32%, rgba(23,195,178,.13), transparent 28%),
    var(--navy);
  color: #fff;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: 90px;
}
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, var(--cyan) 0 22%, var(--gold) 22% 30%, transparent 30%); }
.hero-copy { max-width: 650px; }
.eyebrow { margin: 0 0 15px; color: var(--cyan); font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
h1 { margin: 0; font: 600 clamp(38px, 4.1vw, 62px)/1.22 "STSong", "Songti SC", serif; letter-spacing: -.02em; }
h1 em { font-style: normal; color: #8de0d6; }
.hero-lead { max-width: 615px; margin: 26px 0 0; color: #b9c5cf; font-size: 16px; line-height: 1.9; }
.hero-lead b { color: #fff; font-family: ui-monospace, monospace; }
.hero-actions { display: flex; gap: 12px; margin-top: 34px; }
.button { border: 0; min-height: 46px; padding: 0 19px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-size: 14px; font-weight: 650; transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.button:hover { transform: translateY(-1px); }
.button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.button-primary { color: var(--navy); background: var(--cyan); box-shadow: 0 12px 30px rgba(23,195,178,.18); }
.button-primary:hover { background: #43d4c7; }
.button-quiet { color: #d8e0e6; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.18); }
.button-dark { color: white; background: var(--navy); }
.button-outline { min-height: 40px; border: 1px solid #ccd5dc; background: white; color: var(--ink); }
.button.compact { min-height: 40px; }
.support-note { color: #7f909e; font-size: 12px; margin: 14px 0 0; }

.structure-card { border: 1px solid rgba(255,255,255,.14); background: rgba(5,20,32,.82); box-shadow: 0 30px 90px rgba(0,0,0,.3); backdrop-filter: blur(9px); }
.structure-topline { min-height: 52px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.1); color: #b6c1cb; font: 11px/1 ui-monospace, monospace; letter-spacing: .12em; }
.status-dot { color: var(--cyan); }
.folder-tree { padding: 25px 25px 20px; }
.tree-row { display: flex; align-items: center; gap: 13px; }
.tree-row b { display: block; font-size: 14px; letter-spacing: .02em; }
.tree-row small { display: block; color: #718494; font-size: 10px; margin-top: 5px; }
.folder-icon { position: relative; display: block; width: 33px; height: 23px; border: 1.5px solid var(--cyan); }
.folder-icon::before { content: ""; position: absolute; left: -1.5px; top: -7px; width: 14px; height: 6px; border: 1.5px solid var(--cyan); border-bottom: 0; }
.folder-icon.small { width: 24px; height: 17px; border-color: #78909f; }
.folder-icon.small::before { top: -5px; width: 10px; height: 4px; border-color: #78909f; }
.branch { margin: 25px 0 0 16px; padding-left: 26px; border-left: 1px solid rgba(255,255,255,.15); }
.branch > .tree-row { position: relative; }
.branch > .tree-row::before, .file-row::before { content: ""; position: absolute; left: -27px; width: 18px; border-top: 1px solid rgba(255,255,255,.15); }
.second-folder { margin-top: 20px; }
.file-row { position: relative; margin: 16px 0 0 37px; color: #9cabb7; font: 11px/1.2 ui-monospace, monospace; display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 8px; }
.file-row::before { left: -64px; width: 55px; }
.file-row i { color: #526778; font-style: normal; font-size: 9px; }
.image-icon { width: 13px; height: 13px; border: 1px solid #62798a; position: relative; }
.image-icon::after { content: ""; position: absolute; left: 2px; right: 2px; bottom: 2px; height: 4px; background: #62798a; clip-path: polygon(0 100%, 35% 20%, 56% 65%, 75% 35%, 100% 100%); }
.structure-result { border-top: 1px solid rgba(255,255,255,.1); padding: 17px 20px; display: flex; align-items: center; gap: 13px; background: rgba(23,195,178,.055); }
.structure-result span { padding: 4px 7px; background: rgba(23,195,178,.14); color: var(--cyan); font-size: 9px; }
.structure-result strong { color: #c2ccd4; font-size: 11px; font-weight: 500; }

.workflow { width: min(1060px, calc(100% - 40px)); margin: -40px auto 0; position: relative; z-index: 3; display: grid; grid-template-columns: repeat(3, 1fr); background: white; box-shadow: var(--shadow); }
.workflow article { min-height: 110px; padding: 25px 30px; display: flex; align-items: center; gap: 18px; border-right: 1px solid #e5eaee; }
.workflow article:last-child { border-right: 0; }
.workflow article > span { color: #c6d0d7; font: 500 25px/1 ui-monospace, monospace; }
.workflow b, .workflow small { display: block; }
.workflow b { font-size: 14px; }
.workflow small { margin-top: 7px; color: #84909a; font-size: 11px; }

.drop-section { width: min(1060px, calc(100% - 40px)); margin: 80px auto 92px; }
.drop-zone { min-height: 190px; padding: 28px 38px; border: 1px dashed #afbbc4; background: rgba(255,255,255,.7); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 28px; transition: background .2s, border-color .2s, transform .2s; }
.drop-zone.is-dragging { border-color: var(--cyan-dark); background: rgba(23,195,178,.08); transform: translateY(-2px); }
.drop-zone h2 { margin: 0 0 8px; font: 600 26px/1.2 "STSong", "Songti SC", serif; }
.drop-zone p:not(.eyebrow) { margin: 0; color: #7a8792; font-size: 13px; }
.drop-visual { width: 78px; height: 78px; background: var(--navy); display: grid; place-items: center; }
.drop-visual span { width: 32px; height: 23px; border: 2px solid var(--cyan); position: relative; }
.drop-visual span::before { content: ""; position: absolute; left: -2px; top: -8px; width: 14px; height: 6px; border: 2px solid var(--cyan); border-bottom: 0; }
.privacy-detail { margin: 15px 0 0; color: #82909b; font-size: 11px; display: flex; justify-content: center; align-items: center; gap: 7px; }
.privacy-detail svg { width: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.report-section { width: min(1180px, calc(100% - 40px)); margin: 92px auto; }
.report-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 30px; }
.report-heading h2 { margin: 0; color: var(--navy); font: 600 clamp(28px, 3vw, 40px)/1.2 "STSong", "Songti SC", serif; }
.report-heading > div > p:last-child { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.report-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.metric { background: white; border-top: 3px solid var(--navy); padding: 21px 22px; min-height: 105px; }
.metric:nth-child(2) { border-top-color: var(--cyan-dark); }
.metric:nth-child(3) { border-top-color: var(--gold); }
.metric:nth-child(4) { border-top-color: #7691a4; }
.metric small { color: #7d8a95; font-size: 11px; }
.metric strong { display: block; margin-top: 9px; color: var(--navy); font: 600 26px/1 ui-monospace, monospace; }
.metric strong span { margin-left: 3px; font: 11px/1 system-ui, sans-serif; color: #7d8a95; }
.report-panel { background: white; box-shadow: 0 18px 55px rgba(7,27,44,.08); }
.report-toolbar { min-height: 78px; padding: 15px 20px; display: grid; grid-template-columns: minmax(230px, 1fr) auto auto auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.search-field { height: 44px; padding: 0 13px; border: 1px solid var(--line); display: flex; align-items: center; gap: 9px; }
.search-field svg { width: 18px; fill: none; stroke: #7e8a94; stroke-width: 1.8; }
.search-field input { border: 0; outline: 0; width: 100%; color: var(--ink); }
.select-field { height: 44px; padding: 0 10px 0 12px; border: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.select-field span { color: #8b969e; font-size: 10px; }
.select-field select { max-width: 180px; border: 0; outline: 0; color: var(--ink); background: white; font-size: 12px; }
.text-button { border: 0; background: transparent; color: #87939d; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.template-panel { padding: 28px; border-bottom: 1px solid var(--line); background: #fbfcfc; }
.template-title-row { align-items: flex-start; margin-bottom: 20px; }
.template-title-row > div span, .template-title-row > div small { display: block; }
.template-title-row > div small { margin-top: 6px; }
.save-target { max-width: 330px; padding: 7px 10px; color: #116c64; background: #e8f7f4; font-size: 10px; font-weight: 600; text-align: right; }
.template-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 16px; }
.template-form label { display: grid; grid-template-columns: 108px 1fr; align-items: center; min-height: 43px; border: 1px solid var(--line); background: white; }
.template-form label > span { padding: 0 13px; color: #596774; font-size: 11px; font-weight: 650; }
.template-form input, .template-form textarea { width: 100%; min-width: 0; border: 0; border-left: 1px solid var(--line); padding: 10px 12px; color: var(--ink); background: white; outline: 0; font-size: 12px; }
.template-form input { height: 41px; }
.template-form textarea { resize: vertical; line-height: 1.7; }
.template-form .full-field { grid-column: 1 / -1; align-items: stretch; }
.template-form .full-field > span { align-self: center; }
.naming-contract { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.naming-contract > div { padding: 14px; border-left: 3px solid var(--cyan-dark); background: #f1f5f6; }
.naming-contract b, .naming-contract code, .naming-contract small { display: block; }
.naming-contract b { font-size: 10px; }
.naming-contract code { margin-top: 7px; color: var(--navy); font-size: 11px; font-weight: 650; white-space: normal; overflow-wrap: anywhere; }
.naming-contract small { margin-top: 6px; color: #7b8892; font-size: 9px; line-height: 1.5; }
.folder-overview { padding: 26px 28px 8px; }
.section-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.section-label span { font-size: 13px; font-weight: 700; }
.section-label small { color: #8b969f; font-size: 10px; }
.folder-table-wrap { border: 1px solid var(--line); overflow-x: auto; }
.folder-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.folder-table th { padding: 11px 14px; background: #f5f7f8; color: #78858f; text-align: left; font-size: 10px; font-weight: 600; }
.folder-table td { padding: 13px 14px; border-top: 1px solid #edf0f2; }
.folder-name-cell { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.folder-mini { width: 17px; height: 12px; border: 1.5px solid var(--cyan-dark); display: inline-block; position: relative; }
.folder-mini::before { content: ""; position: absolute; left: -1.5px; top: -5px; width: 7px; height: 4px; border: 1.5px solid var(--cyan-dark); border-bottom: 0; }
.gallery-label { padding: 26px 28px 0; }
.gallery { padding: 0 28px 36px; }
.gallery-group { margin-top: 27px; }
.group-title { margin: 0 0 14px; display: flex; align-items: center; gap: 11px; }
.group-title h3 { margin: 0; font-size: 14px; }
.group-title span { color: #8b969f; font-size: 10px; }
.photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.category-empty { grid-column: 1 / -1; min-height: 54px; padding: 15px 4px; color: #384754; font: 600 16px/1.4 "STSong", "Songti SC", serif; border-top: 1px solid #eef1f3; }
.photo-card { min-width: 0; border: 1px solid #e1e6ea; background: #fff; transition: transform .18s, box-shadow .18s, border-color .18s; }
.photo-card:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(7,27,44,.1); border-color: #c2cdd5; }
.photo-button { border: 0; width: 100%; padding: 0; display: block; background: #e9edef; position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.photo-button img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.photo-card:hover img { transform: scale(1.025); }
.photo-index { position: absolute; left: 8px; top: 8px; padding: 3px 6px; color: white; background: rgba(7,27,44,.76); font: 9px/1.2 ui-monospace, monospace; }
.photo-unavailable { height: 100%; display: grid; place-items: center; color: #7b8893; font-size: 11px; background: repeating-linear-gradient(135deg, #eef1f3, #eef1f3 10px, #e8ecef 10px, #e8ecef 20px); }
.photo-meta { padding: 12px 13px 13px; }
.photo-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; font-weight: 650; }
.photo-original { margin-top: 5px; color: #8a959e; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-sub { margin-top: 7px; display: flex; justify-content: space-between; gap: 8px; color: #8a959e; font-size: 9px; }
.content-tag { color: #187a72; background: #e6f7f4; padding: 2px 5px; white-space: nowrap; }
.empty-state { padding: 70px 20px; text-align: center; color: #7d8993; }

footer { min-height: 90px; padding: 0 max(20px, calc((100vw - 1180px) / 2)); display: flex; justify-content: space-between; align-items: center; gap: 20px; background: var(--navy); color: #758795; font-size: 10px; letter-spacing: .06em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.toast { position: fixed; left: 50%; bottom: 30px; z-index: 20; transform: translate(-50%, 20px); background: var(--navy); color: white; padding: 11px 17px; box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transition: .22s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
dialog { width: min(1050px, calc(100% - 28px)); border: 0; padding: 0; background: #081724; color: white; box-shadow: 0 30px 100px rgba(0,0,0,.5); }
dialog::backdrop { background: rgba(3,12,19,.82); backdrop-filter: blur(4px); }
dialog img { width: 100%; max-height: 76vh; object-fit: contain; display: block; background: #030a0f; }
.dialog-close { position: absolute; top: 10px; right: 12px; z-index: 2; border: 0; width: 36px; height: 36px; background: rgba(0,0,0,.58); color: white; font-size: 24px; }
.dialog-caption { min-height: 65px; padding: 13px 18px; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.dialog-caption b { font-size: 13px; }
.dialog-caption span { color: #8294a2; font-size: 10px; word-break: break-all; text-align: right; }

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; gap: 55px; padding-top: 70px; }
  .hero-copy { max-width: 760px; }
  .structure-card { width: min(650px, 100%); }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
  .report-toolbar { grid-template-columns: 1fr 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .naming-contract { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar { width: min(100% - 28px, 1180px); height: 76px; }
  .privacy-pill { display: none; }
  .hero { padding: 58px 20px 78px; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .structure-card { display: none; }
  .workflow { grid-template-columns: 1fr; margin-top: -24px; }
  .workflow article { min-height: 84px; border-right: 0; border-bottom: 1px solid #e5eaee; }
  .drop-section { margin-top: 55px; }
  .drop-zone { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: 35px 24px; }
  .report-heading { align-items: start; flex-direction: column; }
  .report-actions { justify-content: flex-start; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .template-form { grid-template-columns: 1fr; }
  .template-form .full-field { grid-column: auto; }
  .template-title-row { gap: 12px; flex-direction: column; }
  .save-target { text-align: left; }
  .report-toolbar { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .select-field { justify-content: space-between; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .folder-overview, .gallery, .gallery-label { padding-left: 18px; padding-right: 18px; }
  footer { flex-direction: column; justify-content: center; align-items: flex-start; }
  .dialog-caption { align-items: flex-start; flex-direction: column; }
  .dialog-caption span { text-align: left; }
}
@media (max-width: 460px) {
  .hero { min-height: auto; }
  .workflow, .drop-section, .report-section { width: calc(100% - 24px); }
  .metrics { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: 1fr; }
  .report-actions .button { width: 100%; }
}

@media print {
  body { background: white; }
  .topbar, .hero, .workflow, .drop-section, .report-actions, .report-toolbar, .template-panel, footer, .toast { display: none !important; }
  .report-section { width: 100%; margin: 0; }
  .report-panel { box-shadow: none; }
  .metrics { grid-template-columns: repeat(4, 1fr); }
  .metric { border: 1px solid #bbb; border-top-width: 3px; }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
  .photo-card { break-inside: avoid; }
  .gallery-group { break-inside: auto; }
  .photo-button { aspect-ratio: 4/3; }
  @page { size: A4; margin: 13mm; }
}
