@charset "UTF-8";

:root {
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --faint: #86868b;
  --line: #d2d2d7;
  --canvas: #f5f5f7;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --radius: 28px;
  --font: "SF Pro SC", "SF Pro Text", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-family: var(--font);
  color: var(--ink);
  background: #fff;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; font-size: 14px; line-height: 1.5; }
body.modal-open { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button, input, textarea, select { outline: none; }
button { border: 0; background: none; }
button:disabled { opacity: .42; cursor: not-allowed; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #2997ff;
  outline-offset: 4px;
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px #0071e321;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { display: block; width: 20px; height: 20px; flex: 0 0 auto; }
h1, h2, h3, p { margin: 0; }
button, a, .script-card { touch-action: manipulation; }
.hidden, [hidden] { display: none !important; }
.visually-hidden, .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

html { scroll-padding-top: 84px; }
.global-nav { position: sticky; top: 0; z-index: 50; height: 64px; background: #ffffffeb; border-bottom: 1px solid #e8e8ed; backdrop-filter: blur(20px); }
.nav-inner { width: min(1360px, 92%); height: 100%; margin: 0 auto; display: flex; align-items: center; gap: 30px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-size: 17px; font-weight: 650; letter-spacing: -.5px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand svg { width: 24px; height: 24px; }
.brand small { margin-left: 4px; color: #77777d; font-size: 9px; font-weight: 500; letter-spacing: 1.6px; }
.nav-links { display: flex; align-items: center; gap: 28px; margin-left: 16px; }
.nav-links a, .nav-links button { color: #5b5b60; font-size: 13px; padding: 8px 0; }
.nav-links a:hover, .nav-links button:hover, .nav-links .active { color: var(--ink); text-decoration: none; }
.account-button { display: flex; gap: 7px; align-items: center; color: #5b5b60; font-size: 12px; white-space: nowrap; padding: 6px 0 6px 8px; }
.account-button svg { width: 16px; height: 16px; }
.account-button .role-label { background: #e8e8ed; border-radius: 5px; padding: 1px 5px; color: #6e6e73; font-size: 9px; }
.nav-tools { display: flex; align-items: center; gap: 18px; margin-left: auto; min-width: 0; }
.nav-tools .save-status { color: var(--muted); font-size: 11px; white-space: nowrap; }
.nav-root-add.btn { min-height: 34px; padding: 7px 15px; font-size: 12px; }

main { width: min(1360px, 92%); margin: 0 auto; }
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; padding: 18px 0 12px; }
.hero-title .eyebrow, .eyebrow { display: block; margin-bottom: 13px; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: 2.1px; text-transform: uppercase; }
.hero h1 { font-size: clamp(42px, 4.1vw, 52px); line-height: 1.08; letter-spacing: -2.5px; font-weight: 650; }
.hero-title .eyebrow { margin-bottom: 7px; font-size: 9px; }
.hero-aside { max-width: 300px; padding-bottom: 3px; }
.hero-aside p { display: block; font-size: 18px; line-height: 1.35; font-weight: 600; letter-spacing: -.5px; }
.hero-aside > span { display: block; margin-top: 12px; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.6; letter-spacing: 0; }
.hero-aside small { display: block; margin-top: 13px; color: var(--muted); font-size: 12px; font-weight: 400; letter-spacing: 0; }
.hero-aside .text-link { margin-top: 15px; }
.private-access { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 32px 64px; min-height: calc(100dvh - 190px); padding: 64px 6% 40px; }
.private-access-copy .eyebrow { margin-bottom: 22px; font-size: 9px; letter-spacing: 1.8px; }
.private-access-badge { display: inline-flex; align-items: center; gap: 7px; color: #59616c; font-size: 12px; }
.private-access-badge svg { width: 17px; height: 17px; }
.private-access h1 { margin-top: 18px; font-size: clamp(46px, 5.2vw, 76px); line-height: 1.12; letter-spacing: -3px; font-weight: 650; }
.private-access-description { margin-top: 26px; color: var(--muted); line-height: 1.9; font-size: 14px; }
.private-access-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.private-access-actions .btn { min-height: 44px; padding: 12px 22px; font-size: 13px; }
.private-access-note { margin-top: 19px; color: var(--faint); font-size: 11px; line-height: 1.8; }
.private-access-art { display: grid; justify-items: center; padding: 42px 20px 28px; border-radius: 36px; background: linear-gradient(145deg,#f3f5f8,#e9eef5); }
.private-book { display: flex; flex-direction: column; align-items: flex-start; width: 202px; height: 280px; padding: 30px 26px; color: #eaf2ff; background: linear-gradient(125deg,#37648a,#244969); border-radius: 2px 9px 9px 2px; border-right: 6px solid #f0eee7; box-shadow: -5px 0 #1f3f5c,11px 19px 26px #17324921; transform: perspective(850px) rotateY(-14deg) rotateZ(-5deg); }
.private-book > span { font-size: 7px; letter-spacing: 2px; opacity: .65; }
.private-book > svg { width: 51px; height: 51px; margin-top: 34px; opacity: .8; }
.private-book > strong { margin-top: 17px; font-size: 30px; font-weight: 450; letter-spacing: 6px; }
.private-book > small { margin-top: auto; font-size: 7px; letter-spacing: .4px; opacity: .7; }
.private-art-caption { display: flex; gap: 16px; margin-top: 37px; color: #737f8c; font-size: 11px; }
.private-access-roles { grid-column: 1 / -1; display: flex; gap: 44px; margin-top: 8px; padding-top: 24px; border-top: 1px solid #e8e8ed; }
.private-access-roles > div { display: flex; gap: 12px; align-items: center; font-size: 11px; }
.private-access-roles strong { font-weight: 550; }
.private-access-roles span { color: var(--muted); }
@media (max-width: 760px) {
  .private-access { grid-template-columns: 1fr; padding: 40px 0 26px; min-height: auto; gap: 32px; }
  .private-access h1 { font-size: 52px; letter-spacing: -2px; }
  .private-access-description { margin-top: 20px; font-size: 13px; }
  .private-access-art { padding: 32px 20px 25px; border-radius: 28px; }
  .private-book { width: 150px; height: 204px; padding: 22px 19px; }
  .private-book > svg { width: 39px; height: 39px; margin-top: 18px; }
  .private-book > strong { font-size: 24px; margin-top: 11px; }
  .private-book > small { font-size: 5px; }
  .private-art-caption { margin-top: 26px; }
  .private-access-roles { gap: 20px; margin-top: 0; flex-direction: column; padding-top: 22px; }
  .private-access-roles > div { justify-content: space-between; }
}
@media (max-width: 360px) { .private-access h1 { font-size: 45px; } .private-desktop-break { display: none; } }
.text-link { display: inline-flex; align-items: center; gap: 3px; padding: 0; font-size: 13px; color: var(--blue); }
.text-link svg { width: 15px; height: 15px; }
.collection-nav { display: flex; gap: 10px; padding: 0 0 18px; overflow-x: auto; scrollbar-width: none; }
.collection-nav::-webkit-scrollbar { display: none; }
.collection-tab { position: relative; display: flex; align-items: center; flex: 0 0 auto; min-height: 44px; gap: 8px; padding: 7px 14px 7px 10px; border: 1px solid #e8e8ed; border-radius: 14px; background: #fff; transition: border-color .2s, background .2s, box-shadow .2s; }
.collection-tab:hover { border-color: #c7c7cd; background: #fafafa; }
.collection-tab.active { border-color: #1d1d1f; box-shadow: 0 0 0 .5px #1d1d1f; }
.collection-tab .category-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--canvas); color: #616167; }
.collection-tab .category-icon svg { width: 20px; height: 20px; }
.collection-tab.active .category-icon { color: #1d1d1f; background: #eaeaec; }
.collection-tab .label { font-size: 12px; font-weight: 600; white-space: nowrap; }
.collection-tab small { color: var(--muted); font-size: 10px; margin-left: 2px; }

.library-section { border-radius: 28px; padding: 22px; background: var(--canvas); }
.section-top { display: flex; align-items: center; gap: 11px; margin: 0 0 16px; }
.section-top h2 { font-size: 24px; line-height: 1.2; letter-spacing: -.8px; font-weight: 650; }
.section-top .eyebrow { margin-bottom: 10px; font-size: 8px; letter-spacing: 1.5px; }
.library-count { align-self: center; margin-top: 3px; color: var(--muted); font-size: 12px; }
.section-top > .library-count { margin-left: auto; align-self: flex-end; padding-bottom: 1px; }
.section-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.section-actions button { display: inline-flex; align-items: center; gap: 5px; color: var(--blue); font-size: 12px; }
.section-actions svg { width: 16px; height: 16px; }
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.filters { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.filter-chip { border: 1px solid #dedee3; border-radius: 20px; padding: 8px 12px; color: #636369; background: #fff; font-size: 11px; white-space: nowrap; transition: background .2s, box-shadow .2s; }
.toolbar-note { color: #929298; font-size: 12px; font-weight: 400; white-space: nowrap; }
.filter-chip.active { color: var(--ink); background: white; box-shadow: 0 1px 4px #0000000c; }
.search-field { position: relative; display: flex; align-items: center; flex: 1; max-width: 268px; margin-left: auto; }
.search-field svg { position: absolute; left: 12px; width: 15px; height: 15px; color: #86868b; pointer-events: none; }
.search-field input { width: 100%; min-width: 0; height: 36px; border: 1px solid #dedee3; border-radius: 11px; padding: 8px 13px 8px 34px; background: #fff9; color: var(--ink); font-size: 11px; transition: border .2s, box-shadow .2s; }
.search-field input::placeholder { color: #98989c; }
.library-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.script-card { --cover: #42474e; --cover-dark: #22272d; --cover-light: #e5e6e8; position: relative; min-width: 0; overflow: hidden; border: 1px solid transparent; border-radius: 23px; background: #fff; cursor: pointer; transition: transform .28s cubic-bezier(.2,.65,.3,1), box-shadow .28s, border-color .2s; }
.script-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px #00000009; }
.script-card:focus-visible { outline-offset: -3px; }
[data-tone="original"] { --cover: #355e85; --cover-dark: #23415f; --cover-light: #f1f7fd; --cover-accent: #a8c9e7; --scene: #c5ddf8; --type-color: #2c6cad; }
[data-tone="violence"] { --cover: #9c4f49; --cover-dark: #73362f; --cover-light: #fff3ef; --cover-accent: #e7aaa0; --scene: #f3b9b3; --type-color: #b83f37; }
[data-tone="suggestive"] { --cover: #765570; --cover-dark: #53394e; --cover-light: #fcf1fb; --cover-accent: #d5afda; --scene: #dcbef0; --type-color: #87469e; }
[data-tone="normal"] { --cover: #49665a; --cover-dark: #30493e; --cover-light: #f0f7ee; --cover-accent: #b3cfb8; --scene: #bcdcc8; --type-color: #327a51; }
[data-tone="mixed"] { --cover: #8a5a32; --cover-dark: #633f21; --cover-light: #fff4e4; --cover-accent: #e3bc83; --scene: #f2cf9b; --type-color: #a76b20; }
[data-tone="unclassified"] { --cover: #626870; --cover-dark: #42484f; --cover-light: #f3f5f7; --cover-accent: #bbc1c9; --scene: #e7e9ec; --type-color: #8c929a; }
.card-visual { position: relative; height: 224px; display: grid; place-items: center; isolation: isolate; overflow: hidden; background: linear-gradient(140deg, color-mix(in srgb, var(--scene, #eceef0) 80%, #fff), var(--scene, #eceef0)); }
.card-visual::before { content: ""; position: absolute; width: 175px; height: 38px; left: calc(50% - 75px); top: 181px; border-radius: 50%; background: #1d273727; filter: blur(15px); transform: rotate(-9deg); z-index: -1; }
.card-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(150deg, transparent 45%, #ffffff55 100%); pointer-events: none; }
.book-object { position: relative; width: 128px; height: 174px; margin: 4px 0 0; transform-style: preserve-3d; transform: perspective(800px) rotateY(-17deg) rotateX(5deg) rotateZ(-6deg); transition: transform .5s cubic-bezier(.2,.7,.25,1); }
.script-card:hover .book-object { transform: perspective(800px) rotateY(-8deg) rotateX(3deg) rotateZ(-3deg) translateY(-3px); }
.book-object::before { content: ""; position: absolute; inset: 4px -6px 1px 7px; border-radius: 1px 4px 4px 1px; background: repeating-linear-gradient(0deg, #d1cfc8 0px, #f3f1ea .8px, #f3f1ea 2px); box-shadow: 4px 5px 7px #15202d18; transform: translateZ(-7px); }
.book-object::after { content: ""; position: absolute; inset: 3px -9px 0 7px; background: var(--cover-dark); border-radius: 2px 4px 4px 2px; transform: translateZ(-11px); z-index: -2; }
.book-spine { position: absolute; inset: 0 auto 0 -8px; width: 11px; background: linear-gradient(90deg, var(--cover-dark), var(--cover) 65%, var(--cover-dark)); transform-origin: right; transform: rotateY(-55deg); border-radius: 3px 0 0 3px; }
.book-front { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 17px 14px 13px 16px; overflow: hidden; border-radius: 2px 4px 4px 2px; color: var(--cover-light); background: linear-gradient(108deg, #ffffff15, transparent 18%, #0000000d 75%, #ffffff15), var(--cover); box-shadow: inset 4px 0 3px #ffffff13, inset 6px 0 2px #00000015, 1px 1px 2px #00000030; }
.book-front::before { content: ""; position: absolute; inset: 0; opacity: .16; background: repeating-linear-gradient(90deg, transparent, transparent 2px, #ffffff17 2px, #ffffff17 3px), repeating-linear-gradient(0deg, transparent, transparent 3px, #0000001f 3px, #0000001f 4px); pointer-events: none; }
.book-front::after { content: ""; position: absolute; width: 130px; height: 130px; border: 1px solid var(--cover-accent); border-radius: 50%; opacity: .33; left: 34px; top: 69px; box-shadow: 0 0 0 12px #ffffff03, 0 0 0 13px #ffffff14, 0 0 0 28px #ffffff02, 0 0 0 29px #ffffff0c; }
[data-tone="original"] .book-front::after { border-radius: 50% 50% 0 0; left: 41px; top: 76px; width: 95px; height: 130px; }
[data-tone="violence"] .book-front::after { border-radius: 0; transform: rotate(28deg); left: 45px; top: 70px; }
[data-tone="suggestive"] .book-front::after { border-radius: 50% 50% 44% 44%; transform: rotate(16deg); width: 116px; height: 148px; left: 38px; top: 55px; }
[data-tone="normal"] .book-front::after { border-radius: 70% 20% 65% 20%; transform: rotate(-20deg); width: 100px; height: 145px; left: 44px; top: 37px; }
[data-tone="mixed"] .book-front::after { border-radius: 8px; transform: rotate(-24deg); width: 112px; height: 142px; left: 43px; top: 69px; }
[data-tone="unclassified"] .book-front::after { border-radius: 50%; left: 34px; top: 69px; }
.book-kicker { position: relative; z-index: 1; font-size: 5.5px; font-weight: 400; letter-spacing: 1.5px; opacity: .68; text-transform: uppercase; }
.book-title { position: relative; z-index: 1; width: 100%; margin-top: 17px; font-family: "Songti SC", "STSong", "SimSun", serif; font-size: 22px; font-weight: 500; line-height: 1.47; letter-spacing: 1px; overflow-wrap: anywhere; text-wrap: balance; }
.book-rule { position: relative; z-index: 1; display: block; width: 19px; height: 1px; margin-top: 13px; background: var(--cover-light); opacity: .5; }
.book-author { position: relative; z-index: 1; margin-top: auto; font-size: 5.5px; letter-spacing: 1.6px; opacity: .7; }
.book-author small { display: block; margin-top: 3px; font: inherit; font-size: 5px; opacity: .7; }
.card-visual > .sample-label { position: absolute; bottom: 13px; left: 15px; z-index: 2; color: #929297; font-size: 8px; font-weight: 400; letter-spacing: .5px; }
.type-badge { position: absolute; left: 15px; top: 14px; border-radius: 5px; padding: 3px 6px; color: #5b5c60; background: #ffffffb0; backdrop-filter: blur(8px); font-size: 9px; line-height: 1.4; z-index: 2; }
.type-badge.derived, .type-badge[data-type="derived"] { color: #64706c; }
.card-more { position: absolute; right: 11px; top: 10px; display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; color: #6c6c71; z-index: 3; opacity: 0; transition: background .2s, opacity .2s; }
.card-more:hover { background: #ffffffc9; }
.card-more svg { width: 17px; height: 17px; }
.script-card:hover .card-more, .script-card:focus-within .card-more { opacity: 1; }
.card-info { position: relative; min-height: 151px; padding: 18px 18px 15px; }
.card-meta { display: flex; align-items: center; gap: 5px; color: #9b784e; font-size: 9px; font-weight: 500; line-height: 1.3; }
.card-meta > span + span { margin-left: auto; color: #a0a0a6; font-size: 8px; font-weight: 400; }
.card-title { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; margin-top: 7px; font-size: 18px; line-height: 1.4; font-weight: 650; letter-spacing: -.6px; }
.card-description { margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #86868b; font-size: 10px; line-height: 1.5; }
.card-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; min-height: 19px; }
.branch-count { display: inline-flex; align-items: center; gap: 5px; color: #6e6e73; font-size: 9px; }
.branch-count svg { width: 12px; height: 12px; }
.card-arrow { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; color: #6e6e73; background: var(--canvas); transition: color .2s, background .2s; }
.card-arrow svg { width: 12px; height: 12px; }
.script-card:hover .card-arrow { color: #fff; background: var(--ink); }
.card-sort-tools { position: absolute; top: 46px; right: 13px; z-index: 4; display: flex; flex-direction: column; gap: 5px; opacity: 0; transition: opacity .2s; }
.card-sort-tools button { display: grid; place-items: center; width: 23px; height: 23px; border: 1px solid #e5e5e9; border-radius: 50%; background: #fff; color: #77777d; }
.card-sort-tools svg { width: 12px; height: 12px; }
.script-card:hover .card-sort-tools, .script-card:focus-within .card-sort-tools { opacity: 1; }
.script-card.dragging { opacity: .4; transform: scale(.97); }
.script-card.drag-over { border-color: var(--blue); box-shadow: 0 0 0 3px #0071e321; }
.library-grid.sorting .script-card { cursor: grab; }

.import-zone { display: flex; justify-content: center; align-items: center; gap: 17px; margin-top: 22px; padding: 22px; border: 1px dashed #cfcfd5; border-radius: 19px; color: var(--muted); text-align: left; transition: border-color .2s, background .2s; }
.import-zone > svg, .import-zone .import-icon { width: 31px; height: 31px; color: #96969c; }
.import-zone h3 { font-size: 13px; line-height: 1.6; font-weight: 500; color: #535358; }
.import-zone p { margin-top: 2px; color: #8d8d93; font-size: 10px; }
.import-zone > div > span { display: block; margin-top: 4px; color: #aaaab0; font-size: 9px; line-height: 1.6; }
.import-symbol { display: grid; place-items: center; flex: 0 0 auto; color: #909097; }
.import-symbol svg { width: 34px; height: 34px; }
.import-zone > .btn { margin-left: 15px; min-height: 34px; padding: 8px 15px; color: #67676d; background: #e8e8ed; font-size: 10px; }
.import-zone .text-link { margin-left: 9px; font-size: 12px; }
.import-zone.drag-over { border-color: var(--blue); background: #e9f3ff; }
.library-caption { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 20px 4px 26px; color: #96969d; font-size: 10px; line-height: 1.6; }
.library-caption > span:first-child { display: inline-flex; align-items: center; gap: 7px; }
.status-dot { display: inline-block; flex: 0 0 auto; width: 5px; height: 5px; border-radius: 50%; background: #6f967b; vertical-align: middle; }
.save-status .status-dot { margin-right: 4px; }
.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 24px; width: min(1360px, 92%); margin: 0 auto; padding: 23px 1px 29px; border-top: 1px solid #e9e9ed; color: #909095; font-size: 10px; line-height: 1.7; }
.site-footer span, .site-footer p { display: block; }
.site-footer .footer-links { display: flex; gap: 18px; }
.site-footer a, .site-footer button { padding: 0; color: #77777d; font-size: 10px; }
.site-footer .footer-brand { display: flex; align-items: baseline; gap: 9px; color: #6e6e73; font-size: 14px; font-weight: 600; }
.site-footer .footer-brand span { color: #a2a2a8; font-size: 8px; font-weight: 400; letter-spacing: 1.5px; }
.site-footer > button span { display: inline; margin-left: 4px; }
.empty-state { grid-column: 1 / -1; display: flex; min-height: 260px; align-items: center; justify-content: center; flex-direction: column; text-align: center; padding: 30px; }
.empty-state svg { width: 36px; height: 36px; margin-bottom: 17px; color: #a2a2a8; }
.empty-state h3 { font-size: 20px; letter-spacing: -.5px; }
.empty-state p { max-width: 340px; margin: 10px 0 18px; color: var(--muted); font-size: 12px; }
.drop-overlay { display: none; pointer-events: none; position: fixed; inset: 10px; z-index: 150; align-items: center; justify-content: center; flex-direction: column; gap: 13px; border: 2px dashed var(--blue); border-radius: 30px; background: #eef6ffed; backdrop-filter: blur(12px); color: var(--blue); }
.drop-overlay.active { display: flex; }
.drop-overlay svg { width: 52px; height: 52px; }
.drop-overlay h2 { font-size: 30px; letter-spacing: -.8px; }
.drop-overlay p { color: #597491; font-size: 14px; }
.drop-overlay > div { text-align: center; }
.drop-large-icon { display: block; margin-bottom: 9px; font-size: 76px; font-weight: 200; line-height: 1.1; }

.tree-book { flex: 0 0 auto; display: grid; place-items: center; width: 36px; height: 48px; border-radius: 2px 5px 5px 2px; background: linear-gradient(90deg, #0002 8%, transparent 12%), var(--cover, #50645e); color: var(--cover-light, #fff); box-shadow: 2px 2px 0 #ddd9; }
.tree-book svg { width: 18px; height: 18px; opacity: .7; }

.primary, .secondary, .btn, .danger { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; border-radius: 22px; padding: 9px 19px; font-size: 12px; font-weight: 400; line-height: 1.4; white-space: nowrap; transition: background .2s, box-shadow .2s, transform .2s; }
.primary, .btn.primary { background: var(--blue); color: #fff; }
.primary:hover, .btn.primary:hover { background: var(--blue-hover); }
.secondary, .btn.secondary { background: #f0f0f3; color: #424247; }
.secondary:hover, .btn.secondary:hover { background: #e7e7ec; }
.primary svg, .secondary svg, .btn svg, .danger svg { width: 16px; height: 16px; }
.danger, .btn.danger { background: #fff0ef; color: #c3332b; }
.danger:hover, .btn.danger:hover { background: #ffe3e1; }
.danger.primary { background: #d5352d; color: white; }
.danger-button { background: #d5352d; color: white; }
.danger-button:hover { background: #c82d26; }
.full { width: 100%; }
.icon-button, .close-button { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #f0f0f3; color: #727278; }
.icon-button:hover, .close-button:hover { background: #e5e5ea; color: var(--ink); }
.close-button svg { width: 16px; height: 16px; }

.modal-backdrop, .dialog-backdrop { position: fixed; inset: 0; z-index: 99; background: #15151c35; backdrop-filter: blur(7px); animation: fade-in .2s ease; }
.drawer { position: fixed; z-index: 100; top: 50%; left: 50%; right: auto; bottom: auto; width: min(900px, calc(100vw - 40px)); height: auto; max-height: min(860px, calc(100dvh - 40px)); display: flex; flex-direction: column; overflow: hidden; border-radius: 25px; background: #fff; box-shadow: 0 20px 80px #00000021; transform: translate(-50%, -50%); animation: fade-in .2s ease; }
.drawer-header { display: flex; justify-content: space-between; align-items: center; flex: 0 0 auto; gap: 20px; min-height: 66px; padding: 16px 28px 12px 32px; }
.drawer-header > span, .drawer-header > small, .drawer-header > label { color: #8a8a90; font-size: 10px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; }
.drawer-kicker { margin-left: 10px; color: #b1b1b7; font-size: 8px; letter-spacing: 1.3px; }
.drawer-scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 0; flex: 0 1 auto; padding: 5px 32px 30px; scrollbar-width: thin; scrollbar-color: #d5d5da transparent; }
.lineage { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 3px 0 27px; color: #b0b0b5; font-size: 10px; }
.lineage button { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0; color: #7e7e84; font-size: 10px; }
.lineage button:hover { color: var(--blue); }
.lineage svg { width: 10px; height: 10px; }
.detail-heading { position: relative; min-height: 94px; padding: 4px 0 0 87px; margin-bottom: 23px; }
.detail-book-mini { position: absolute; left: 2px; top: 0; display: grid; place-items: center; width: 62px; height: 84px; padding: 11px; border-radius: 2px 5px 5px 2px; color: var(--cover-light, #e5e6e8); background: linear-gradient(105deg, #00000024 4%, #ffffff18 6%, transparent 10%), var(--cover, #42474e); box-shadow: 3px 3px 0 #e2e0d9, 4px 6px 9px #0002; transform: rotate(-5deg); font-family: "Songti SC", SimSun, serif; font-size: 13px; line-height: 1.6; letter-spacing: 3px; }
.detail-book-mini svg { width: 25px; height: 25px; opacity: .6; }
.detail-heading h2 { font-size: 28px; line-height: 1.3; letter-spacing: -.9px; font-weight: 650; overflow-wrap: anywhere; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 6px 9px; color: #8d8d93; font-size: 10px; margin-top: 10px; }
.detail-meta .meta-badge { color: #7b6549; }
.detail-heading .eyebrow { margin: 0 0 5px; font-size: 8px; letter-spacing: 1.2px; }
.detail-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 0 0 30px; }
.detail-actions .primary, .detail-actions .secondary { min-height: 36px; padding: 8px 16px; font-size: 11px; }
.detail-actions .export-button { cursor: grab; }
.detail-tabs { display: flex; align-items: center; gap: 26px; max-width: 100%; overflow-x: auto; scrollbar-width: none; margin-bottom: 24px; border-bottom: 1px solid #e9e9ed; }
.detail-tabs::-webkit-scrollbar { display: none; }
.detail-tab { position: relative; flex: 0 0 auto; padding: 0 0 12px; color: #929298; font-size: 12px; white-space: nowrap; }
.detail-tab.active { color: var(--ink); font-weight: 500; }
.detail-tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--ink); }
.detail-section-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10px; font-weight: 500; margin: 25px 0 12px; letter-spacing: .3px; }
.detail-section-label:first-child { margin-top: 0; }
.detail-section-label button { padding: 0; color: var(--blue); font-size: 10px; }
.requirements-box { padding: 22px; border-radius: 17px; background: var(--canvas); color: #45454b; font-size: 13px; line-height: 1.95; white-space: pre-wrap; overflow-wrap: anywhere; }
.requirements-box p { white-space: pre-wrap; }
.content-text { padding: 21px 23px; border: 1px solid #e8e8ed; border-radius: 17px; font-family: var(--font); color: #45454b; font-size: 13px; line-height: 2.05; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 170px; }
.detail-source { display: flex; align-items: flex-start; gap: 9px; margin: 0 0 25px; padding: 15px 17px; border: 1px solid #e8e8ed; border-radius: 13px; color: #89898f; font-size: 10px; line-height: 1.9; }
.detail-source > svg { width: 15px; height: 15px; margin-top: 2px; color: #8d9d92; }
.detail-source strong { color: #65656b; font-weight: 500; }
.detail-source button { padding: 0; color: var(--blue); font-size: inherit; }
.detail-empty { display: flex; align-items: center; flex-direction: column; padding: 36px 24px; border-radius: 16px; background: var(--canvas); text-align: center; color: #86868b; font-size: 12px; line-height: 1.8; }
.detail-empty svg { color: #a5a5ac; width: 29px; height: 29px; margin-bottom: 12px; }
.detail-empty .primary, .detail-empty .secondary { margin-top: 15px; }
.detail-hint { margin-top: 15px; padding: 0 1px; color: #98989e; font-size: 10px; line-height: 1.9; }
.detail-empty .btn.text { padding: 6px 0; min-height: 0; margin-top: 12px; color: var(--blue); font-size: 11px; }
.detail-panel > .btn { margin-top: 17px; }
.attachment-list, .branch-list { display: flex; flex-direction: column; gap: 8px; }
.attachment-item, .branch-item, .version-item { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border: 1px solid #e8e8ed; border-radius: 13px; }
.attachment-item > svg, .branch-item > svg, .version-item > svg { width: 22px; height: 22px; color: #96969c; }
.attachment-item > div, .branch-item > div, .version-item > div { flex: 1; min-width: 0; }
.attachment-item, .branch-item { width: 100%; text-align: left; }
.attachment-item > span, .branch-item > span:not(.tree-book) { flex: 1; min-width: 0; }
.attachment-list { margin-top: 14px; }
.attachment-item:hover { background: #fafafa; }
.attachment-item > svg:last-child, .branch-item > svg:last-child { margin-left: auto; width: 16px; height: 16px; color: #a0a0a6; }
.attachment-item strong, .branch-item strong, .version-item strong { display: block; overflow-wrap: anywhere; font-size: 12px; font-weight: 500; color: #45454b; }
.attachment-item small, .branch-item small, .version-item small { display: block; margin-top: 3px; color: #99999f; font-size: 9px; }
.attachment-item a, .attachment-item button, .branch-item button { font-size: 11px; color: var(--blue); }
.attachment-item button svg, .attachment-item a svg, .branch-item button svg { width: 16px; height: 16px; }
.branch-item { cursor: pointer; transition: background .2s; }
.branch-item:hover { background: #fafafa; }
.version-item { display: block; margin-bottom: 8px; }
.version-item summary { display: flex; align-items: center; justify-content: space-between; gap: 13px; color: #515157; font-size: 12px; cursor: pointer; list-style: none; }
.version-item summary::-webkit-details-marker { display: none; }
.version-item summary::after { content: "+"; flex: 0 0 auto; color: #99999f; font-size: 17px; line-height: 1; }
.version-item[open] summary { margin-bottom: 16px; padding-bottom: 13px; border-bottom: 1px solid #eeeef1; }
.version-item[open] summary::after { content: "−"; }
.version-item summary small { margin: 0 0 0 auto; color: #99999f; font-size: 9px; }
.version-item pre { max-height: 280px; overflow-y: auto; padding: 13px; margin: 10px 0 0; border-radius: 9px; background: var(--canvas); color: #77777d; font-family: var(--font); font-size: 10px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.version-item .version-badge { display: grid; place-items: center; flex: 0 0 auto; min-width: 31px; height: 31px; border-radius: 8px; background: var(--canvas); color: #7d7d83; font-size: 10px; }
.version-item p { margin-top: 7px; color: #8a8a90; font-size: 10px; line-height: 1.7; white-space: pre-wrap; }
.drawer-bottom { display: flex; justify-content: space-between; align-items: center; flex: 0 0 auto; gap: 14px; min-height: 59px; padding: 14px 32px; border-top: 1px solid #eeeef1; background: #fff; color: #99999f; font-size: 9px; }
.drawer-bottom button { display: flex; align-items: center; gap: 5px; min-height: 0; padding: 3px 0; border-radius: 0; background: none; color: #b64640; font-size: 10px; }
.drawer-bottom button:hover { background: none; color: #da362b; }
.drawer-bottom button svg { width: 13px; height: 13px; }
.permission-note { display: inline-flex; align-items: center; gap: 4px; }
.permission-note svg { width: 12px; height: 12px; color: #7c9784; }
.danger-zone { margin-top: 24px; padding: 17px; background: #fff6f5; border: 1px solid #f4d9d6; border-radius: 14px; color: #a5524d; font-size: 11px; line-height: 1.8; }
.danger-zone p + p { margin-top: 7px; }

.dialog-backdrop { z-index: 120; display: flex; align-items: center; justify-content: center; padding: 28px; overflow-y: auto; overscroll-behavior: contain; }
.dialog { width: 440px; max-width: 100%; max-height: calc(100dvh - 56px); overflow-y: auto; padding: 29px 30px 26px; border-radius: 25px; background: #fff; box-shadow: 0 20px 80px #00000021; scrollbar-width: thin; animation: dialog-in .25s cubic-bezier(.2,.7,.25,1); }
.dialog.wide { width: 640px; }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 23px; }
.dialog-header h2 { font-size: 24px; line-height: 1.25; letter-spacing: -.8px; font-weight: 650; }
.dialog-description { margin: -9px 0 22px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.dialog-copy { margin: 0 0 22px; color: #7b7b81; font-size: 12px; line-height: 1.9; overflow-wrap: anywhere; }
.dialog-header .eyebrow { margin-bottom: 8px; font-size: 8px; letter-spacing: 1.4px; }
.form-stack { display: flex; flex-direction: column; gap: 17px; }
.form-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.form-stack > label.form-field, .form-row > label.form-field { color: #535358; font-size: 11px; font-weight: 500; }
.form-field label { color: #535358; font-size: 11px; font-weight: 500; }
.form-field label .optional { color: #99999f; font-weight: 400; }
.form-field input, .form-field textarea, .form-field select { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid #d9d9df; border-radius: 10px; background: #fff; color: var(--ink); font-size: 12px; line-height: 1.6; transition: border-color .2s, box-shadow .2s; }
.form-field input { min-height: 43px; }
.form-field textarea { min-height: 116px; resize: vertical; max-height: 420px; }
.form-field textarea.large { min-height: 170px; }
.form-field input::placeholder, .form-field textarea::placeholder { color: #a1a1a7; }
.form-field small { color: #96969c; font-size: 10px; line-height: 1.6; }
.form-source { display: flex; align-items: flex-start; gap: 8px; padding: 13px 14px; border-radius: 11px; background: #f1f5f9; color: #6d7e8b; font-size: 10px; line-height: 1.8; }
.form-source svg { width: 15px; height: 15px; margin-top: 2px; }
.inherit-option { display: flex; align-items: center; gap: 7px; margin-top: -7px; color: #86868c; font-size: 10px; line-height: 1.7; cursor: pointer; }
.inherit-option input { width: 13px; height: 13px; margin: 0; accent-color: var(--blue); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.file-drop { position: relative; display: flex; flex-direction: column; min-height: 93px; align-items: center; justify-content: center; gap: 7px; padding: 17px; border: 1px dashed #d2d2d7; border-radius: 13px; background: #fafafa; text-align: center; cursor: pointer; }
.file-drop:hover { background: #f3f6fa; border-color: #a2b7cd; }
.file-drop > input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-drop:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px #0071e321; }
.file-drop svg { width: 23px; height: 23px; color: #929299; }
.file-drop .file-label { display: flex; align-items: center; justify-content: center; gap: 8px; max-width: 100%; min-width: 0; }
.file-drop .file-label > span { min-width: 0; overflow-wrap: anywhere; }
.file-drop > small { color: #aaaab0; font-size: 9px; line-height: 1.7; pointer-events: none; }
.file-drop.drag-over { border-color: var(--blue); background: #edf5fe; }
.file-label { color: #727278; font-size: 11px; line-height: 1.8; pointer-events: none; }
.file-label small { display: block; font-size: 9px; color: #aaaab0; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 9px; margin-top: 8px; padding-top: 17px; border-top: 1px solid #eeeef1; }
.form-actions button { min-height: 37px; padding: 9px 20px; font-size: 12px; }
.form-error, .error-message { padding: 11px 13px; border-radius: 10px; background: #fff2f0; color: #b43b32; font-size: 11px; line-height: 1.7; }
.form-error:empty { display: none; }
.login-tabs { display: flex; padding: 4px; border-radius: 12px; background: var(--canvas); margin-bottom: 20px; }
.login-tabs button { flex: 1; padding: 8px; border-radius: 9px; color: #86868b; font-size: 12px; }
.login-tabs button.active { color: var(--ink); background: white; box-shadow: 0 2px 6px #00000008; }
.login-hint { padding: 14px 16px; border-radius: 13px; background: var(--canvas); color: #85858b; font-size: 10px; line-height: 1.9; overflow-wrap: anywhere; }
.login-hint strong { color: #606066; font-weight: 500; }
.login-hint code { color: #535358; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.login-hint .text-link { margin-top: 7px; font-size: 10px; }
.account-summary { display: flex; flex-direction: column; align-items: center; padding: 14px 0 24px; text-align: center; }
.account-summary > svg { width: 36px; height: 36px; padding: 8px; box-sizing: content-box; border-radius: 50%; color: #7e8e9b; background: #f1f4f7; margin-bottom: 17px; }
.account-summary h3 { font-size: 22px; font-weight: 600; letter-spacing: -.5px; }
.account-summary p { max-width: 290px; margin-top: 9px; color: #86868b; font-size: 11px; line-height: 1.9; }
.account-button > small { padding: 1px 4px; color: #8e8e94; background: #eeeeF1; border-radius: 4px; font-size: 8px; }
.drop-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.option-card { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 9px; min-width: 0; min-height: 157px; padding: 21px 17px; border: 1px solid #e1e1e7; border-radius: 16px; text-align: left; transition: background .2s, border-color .2s; }
.option-card:hover { border-color: #9bc5f0; background: #f4f8fd; }
.option-card > svg { width: 26px; height: 26px; margin-bottom: 4px; color: #6e8dab; }
.option-card strong { color: #49494f; font-size: 13px; font-weight: 600; line-height: 1.5; }
.option-card > span { color: #929298; font-size: 10px; line-height: 1.8; overflow-wrap: anywhere; }
.action-menu { display: flex; flex-direction: column; gap: 7px; }
.action-menu > button { display: flex; align-items: center; justify-content: flex-start; gap: 12px; width: 100%; min-height: 49px; padding: 13px 15px; border: 1px solid #e9e9ee; border-radius: 12px; color: #636369; font-size: 12px; line-height: 1.6; text-align: left; }
.action-menu > button:hover { background: var(--canvas); border-color: #dedee5; }
.action-menu > button > svg { width: 18px; height: 18px; color: #8c8c93; }
.action-menu > button.danger { margin-top: 8px; border-color: #f0deda; background: #fff5f3; color: #b74a41; }
.action-menu > button.danger > svg { color: #c46e65; }
.guide-list { display: flex; flex-direction: column; gap: 22px; margin: 28px 0; }
.guide-step { display: flex; align-items: flex-start; gap: 18px; }
.guide-step > span { flex: 0 0 auto; width: 27px; padding-top: 2px; color: #adb9c6; font-size: 17px; font-weight: 400; letter-spacing: -1px; line-height: 1.3; }
.guide-step > div { min-width: 0; flex: 1; }
.guide-step h3 { font-size: 13px; font-weight: 600; color: #4c4c52; }
.guide-step p { margin-top: 6px; color: #8d8d93; font-size: 11px; line-height: 1.9; }
.dialog-choice-list { display: flex; flex-direction: column; gap: 10px; }
.dialog-choice { display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px solid #e3e3e8; border-radius: 14px; text-align: left; }
.dialog-choice:hover { background: var(--canvas); }
.dialog-choice > svg { color: var(--blue); width: 24px; height: 24px; }
.dialog-choice strong { display: block; font-size: 13px; font-weight: 500; }
.dialog-choice small { display: block; margin-top: 4px; color: #909096; font-size: 10px; line-height: 1.6; }
.trash-list { display: flex; flex-direction: column; gap: 9px; }
.trash-item { display: flex; align-items: center; gap: 15px; padding: 15px; border: 1px solid #e8e8ed; border-radius: 13px; }
.trash-item > div { min-width: 0; flex: 1; }
.trash-item strong { display: block; font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
.trash-item small { display: block; margin-top: 4px; color: #95959b; font-size: 10px; }
.trash-item button { color: var(--blue); font-size: 11px; }
.toast { position: fixed; left: 50%; bottom: 25px; z-index: 200; width: max-content; max-width: calc(100vw - 32px); transform: translate(-50%, 12px); padding: 12px 22px; border-radius: 18px; background: #242429ef; color: #fff; box-shadow: 0 5px 25px #0002; font-size: 12px; line-height: 1.6; text-align: center; backdrop-filter: blur(15px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes dialog-in { from { transform: translateY(12px) scale(.98); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }

/* Keep the catalogue broad and readable on desktop without changing the tree cards. */
@media (min-width: 1200px) {
  .nav-inner, main, .site-footer { width: min(1600px, 94%); }
  .hero { padding: 16px 0 12px; gap: 40px; }
  .hero-aside { max-width: 320px; padding-bottom: 3px; }
  .hero-aside p { font-size: 18px; line-height: 1.35; }
  .hero-aside > span { margin-top: 10px; }
  #library { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 620px); gap: 16px 20px; padding: 22px; }
  #library > .section-top { min-width: 0; margin: 0; align-items: flex-end; gap: 16px; }
  #library > .section-top > div { min-width: 0; }
  #library .section-top h2 { font-size: 24px; }
  #library .section-top .library-count { flex: 0 0 auto; margin-left: 0; padding-bottom: 2px; }
  #library > .toolbar { min-width: 0; margin: 0; flex-wrap: nowrap; align-self: end; gap: 14px; }
  #library > .toolbar > .filters { flex: 0 1 auto; max-width: 220px; flex-wrap: nowrap; }
  #library .toolbar-note { display: none; }
  #library .search-field { flex: 0 1 280px; width: 280px; max-width: 280px; margin-left: auto; }
  #library > #genre-filter, #library > #library-content, #library > #import-zone { grid-column: 1 / -1; min-width: 0; }
  #library > #genre-filter, #library > #import-zone { margin: 0; }
  #library .library-grid { gap: 16px; }
}
@media (max-width: 1100px) {
  .nav-inner, main { width: 92%; }
  .nav-tools .save-status { display: none; }
  .library-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav-links { gap: 24px; }
  .brand small { display: none; }
  .hero { padding-top: 18px; padding-bottom: 12px; }
  .hero-aside p { font-size: 18px; }
  .library-section { padding: 22px; }
  .toolbar { flex-wrap: wrap; }
  .search-field { max-width: 240px; }
}
@media (max-width: 800px) {
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
  .global-nav { height: 60px; }
  .nav-links { gap: 20px; }
  .nav-links a:nth-child(n+3), .nav-links button:nth-child(n+3) { display: none; }
  .hero { padding: 18px 0 12px; gap: 24px; }
  .hero-aside { max-width: 230px; }
  .hero-aside p { font-size: 18px; }
  .hero-aside > span { font-size: 11px; }
  .hero-aside small { font-size: 10px; }
  .collection-nav { gap: 10px; margin-right: 0; padding-right: 0; padding-bottom: 18px; }
  .library-section { padding: 20px; border-radius: 25px; }
  .section-top h2 { font-size: 24px; }
  .section-actions { gap: 11px; }
  .section-actions button { font-size: 11px; }
  .filters { flex: 1; justify-content: space-between; }
  .filter-chip { padding: 7px 12px; }
  .toolbar { column-gap: 10px; row-gap: 13px; }
  .search-field { order: 3; flex-basis: 100%; max-width: none; margin-left: 0; }
  .search-field input { background: #fff; height: 38px; }
  .card-visual { height: 235px; }
  .card-visual::before { top: 189px; }
  .book-object { width: 128px; height: 174px; }
  .book-title { font-size: 22px; }
  .card-more, .card-sort-tools { opacity: 1; }
  .card-sort-tools { right: 13px; }
  .card-sort-tools button { border-color: #eeeeF1; }
  .import-zone { flex-wrap: wrap; gap: 12px; padding: 20px 13px; }
  .site-footer { width: 90%; flex-wrap: wrap; justify-content: space-between; gap: 9px 20px; padding-top: 22px; }
}
@media (max-width: 700px) {
  .nav-inner { gap: 18px; }
  .nav-links { margin-left: 0; }
  .nav-tools { gap: 12px; }
  .account-button > span, .account-button > small { display: none; }
  .account-button[data-role="admin"] > small { display: inline; font-size: 9px; }
}

@media (max-width: 520px) {
  main { width: calc(100% - 32px); }
  .nav-inner { width: calc(100% - 32px); gap: 14px; }
  .brand { font-size: 16px; }
  .brand svg { width: 22px; height: 22px; }
  .nav-links { gap: 14px; margin-left: 0; }
  .nav-links a, .nav-links button { font-size: 12px; }
  .nav-links button { display: none; }
  .nav-tools { gap: 10px; }
  .nav-tools .save-status { display: none; }
  .nav-root-add.btn { min-height: 32px; padding: 6px 11px; font-size: 11px; }
  .account-button > span, .account-button > small { display: none; }
  .account-button[data-role="admin"] > small { display: inline; font-size: 9px; }
  .account-button { font-size: 10px; padding-left: 0; gap: 5px; }
  .account-button .role-label { display: none; }
  .hero { display: block; padding: 18px 2px 12px; }
  .hero-title .eyebrow { margin-bottom: 7px; font-size: 9px; letter-spacing: 1.8px; }
  .hero h1 { font-size: 42px; line-height: 1.1; letter-spacing: -2px; }
  .hero-aside { max-width: none; margin-top: 12px; }
  .hero-aside p { font-size: 18px; }
  .hero-aside > span { display: block; margin-top: 10px; font-size: 11px; }
  .hero-aside small { margin-top: 7px; font-size: 10px; }
  .collection-nav { margin-right: 0; padding-right: 0; gap: 9px; padding-bottom: 16px; }
  .collection-tab { gap: 8px; border-radius: 13px; padding: 7px 12px 7px 9px; }
  .collection-tab .category-icon { width: 27px; height: 28px; border-radius: 7px; }
  .collection-tab .category-icon svg { width: 18px; height: 18px; }
  .collection-tab .label { font-size: 11px; }
  .collection-tab small { font-size: 9px; }
  .library-section { margin: 0 -6px; padding: 18px 14px; border-radius: 24px; }
  .section-top { flex-wrap: wrap; column-gap: 8px; row-gap: 14px; margin-bottom: 19px; }
  .section-top h2 { font-size: 22px; }
  .library-count { font-size: 10px; }
  .section-actions button { font-size: 10px; gap: 3px; }
  .section-actions svg { width: 14px; height: 14px; }
  .toolbar { gap: 11px 8px; margin-bottom: 16px; }
  .filters { gap: 12px; padding: 0; justify-content: flex-start; min-width: 0; }
  .filter-chip { width: 103px; max-width: 103px; padding: 7px 8px; font-size: 10px; }
  .toolbar-note { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 9px; }
  .library-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .script-card { border-radius: 20px; }
  .card-visual { height: 244px; }
  .card-visual::before { top: 198px; }
  .book-object { width: 132px; height: 180px; }
  .book-front { padding: 18px 16px; }
  .book-title { font-size: 22px; }
  .book-kicker { font-size: 6px; }
  .book-author { font-size: 6px; }
  .type-badge { top: 15px; left: 16px; font-size: 10px; padding: 3px 7px; }
  .card-more { top: 12px; right: 12px; opacity: 1; }
  .card-info { min-height: 148px; padding: 18px 20px 16px; }
  .card-title { font-size: 20px; }
  .card-description { font-size: 11px; }
  .card-meta { font-size: 10px; }
  .branch-count { font-size: 10px; }
  .card-bottom { margin-top: 14px; }
  .card-arrow { width: 24px; height: 24px; }
  .card-sort-tools { right: 13px; bottom: auto; }
  .card-sort-tools button { width: 25px; height: 25px; }
  .import-zone { margin-top: 16px; padding: 22px 12px; text-align: center; flex-direction: column; gap: 9px; }
  .import-zone > svg, .import-zone .import-icon { width: 27px; height: 27px; }
  .import-zone h3 { font-size: 12px; }
  .import-zone p { font-size: 9px; max-width: 230px; }
  .import-zone .text-link { margin: 1px 0 0; font-size: 11px; }
  .import-zone > .btn { margin: 4px 0 0; }
  .import-zone > div > span { font-size: 8px; }
  .library-caption { flex-direction: column; align-items: flex-start; gap: 5px; padding: 17px 0 21px; font-size: 9px; }
  .site-footer { width: calc(100% - 36px); padding: 20px 0 25px; font-size: 9px; }
  .site-footer > span { display: none; }
  .site-footer .footer-links { gap: 15px; }
  .site-footer a, .site-footer button { font-size: 9px; }
  .tree-book { width: 29px; height: 40px; margin-right: 4px; }
  .tree-book svg { width: 15px; height: 15px; }
  .drawer { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); border-radius: 23px; }
  .drawer-header { min-height: 61px; padding: 15px 22px 10px; }
  .drawer-scroll { padding: 3px 22px 26px; }
  .lineage { margin-bottom: 24px; gap: 5px; }
  .lineage button { max-width: 105px; font-size: 9px; }
  .detail-heading { padding-left: 77px; min-height: 91px; margin-bottom: 19px; }
  .detail-heading h2 { font-size: 25px; }
  .detail-book-mini { width: 56px; height: 77px; font-size: 12px; }
  .detail-meta { font-size: 9px; line-height: 1.6; gap: 3px 8px; }
  .detail-actions { gap: 7px; margin-bottom: 25px; }
  .detail-actions .primary, .detail-actions .secondary { min-height: 35px; padding: 8px 12px; font-size: 10px; gap: 5px; }
  .detail-actions svg { width: 14px; height: 14px; }
  .detail-tabs { gap: 18px; margin-bottom: 20px; }
  .detail-tab { font-size: 11px; }
  .requirements-box { padding: 19px; font-size: 12px; }
  .content-text { padding: 18px; font-size: 12px; }
  .drawer-bottom { min-height: 59px; padding: 13px 22px calc(13px + env(safe-area-inset-bottom)); font-size: 8px; }
  .drawer-bottom button { font-size: 9px; }
  .dialog-backdrop { padding: 14px; }
  .dialog { max-height: calc(100dvh - 28px); padding: 24px 22px 22px; border-radius: 22px; }
  .dialog-header { margin-bottom: 20px; }
  .dialog-header h2 { font-size: 22px; }
  .form-row { grid-template-columns: minmax(0, 1fr); gap: 17px; }
  .form-field input, .form-field textarea, .form-field select { font-size: 16px; }
  .form-field input { padding: 9px 11px; }
  .form-field textarea { min-height: 115px; }
  .form-actions { padding-top: 15px; }
  .form-actions button { padding: 9px 17px; }
  .drop-options { gap: 10px; }
  .option-card { min-height: 155px; padding: 18px 13px; }
  .option-card strong { font-size: 12px; }
  .option-card > span { font-size: 9px; }
  .guide-step { gap: 13px; }
  .guide-step > span { width: 24px; font-size: 16px; }
  .version-item summary { flex-wrap: wrap; column-gap: 8px; row-gap: 5px; font-size: 11px; }
  .version-item summary small { font-size: 8px; }
  .drop-overlay { inset: 6px; border-radius: 23px; padding: 25px; text-align: center; }
  .drop-overlay h2 { font-size: 24px; }
  .drop-overlay p { font-size: 12px; }
  .toast { bottom: max(20px, env(safe-area-inset-bottom)); font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .script-card:hover { transform: none; }
  .script-card:hover .book-object { transform: perspective(800px) rotateY(-17deg) rotateX(5deg) rotateZ(-6deg); }
}
