/*
Theme Name: Carry Research · 科研手记
Description: 为计算机图形学写作者设计的研究笔记主题，含交互式三叶结、置顶阅读、分类索引和长文目录。
Author: CarryNotKarry
Version: 1.1.0
Requires at least: 5.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: carry-research
*/

:root {
	--paper: #faf9f5;
	--ink: #192e2e;
	--muted: #536561;
	--teal: #19564f;
	--line: #d8dcd3;
	--accent: #aa502e;
	--serif: Baskerville, "Iowan Old Style", "Palatino Linotype", Georgia, "Songti SC", "Noto Serif CJK SC", SimSun, serif;
	--sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
	--mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.65 var(--sans); }
a { color: var(--teal); text-underline-offset: .19em; }
button, input, textarea, select { font: inherit; }
button, summary { cursor: pointer; }
img { max-width: 100%; height: auto; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.screen-reader-text { border: 0; clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; white-space: nowrap; }
.skip-link:focus { clip-path: none; height: auto; width: auto; top: 8px; left: 8px; padding: 8px 14px; background: white; color: var(--ink); z-index: 1000; }
.cr-shell { width: min(1220px, calc(100% - clamp(48px, 10vw, 160px))); margin-inline: auto; }
.site-head { border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.mast { min-height: 78px; display: flex; align-items: center; gap: 34px; }
.brand { display: flex; gap: 11px; align-items: center; margin-right: auto; min-width: 0; }
.brand-name, .foot-sign > a { color: var(--ink); font: 700 27px/1 var(--serif); letter-spacing: -.045em; text-decoration: none; overflow-wrap: anywhere; }
.brand .custom-logo-link { display: flex; flex: none; }
.brand .custom-logo { width: auto; max-width: 68px; height: 36px; object-fit: contain; }
.brand-mark { display: grid; flex: 0 0 auto; grid-template-columns: repeat(3, 4px); grid-template-rows: repeat(3, 4px); gap: 2px; padding: 8px; border-radius: 8px; background: var(--teal); transform: rotate(-3deg); }
.brand-mark i { border-radius: 50%; background: #f7f7e8; }
.brand-mark i:first-child, .brand-mark i:last-child { opacity: .2; }
.brand-mark i:nth-child(3), .brand-mark i:nth-child(7) { opacity: .55; }
.site-menu, .site-menu ul { margin: 0; padding: 0; list-style: none; }
.site-menu { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 25px; }
.site-menu li { position: relative; }
.site-menu a, .mast-tools summary, .menu-trigger { font-size: 14px; font-weight: 550; color: var(--ink); text-decoration: none; }
.site-menu a { display: block; padding: 8px 0; }
.site-menu a:hover, .site-menu .current-menu-item > a { color: var(--teal); text-decoration: underline; }
.site-menu .menu-item-has-children > a::after { content: '⌄'; margin-left: .35em; }
.site-menu .sub-menu { position: absolute; right: 0; min-width: 145px; width: max-content; max-width: 250px; padding: 8px 16px; background: var(--paper); border: 1px solid var(--line); display: none; }
.site-menu .sub-menu .sub-menu { right: 100%; top: 0; }
.site-menu li:hover > .sub-menu, .site-menu li:focus-within > .sub-menu { display: block; }
.mast-tools { display: flex; align-items: center; gap: 14px; }
.nav-search { position: relative; }
.nav-search > summary { display: flex; gap: 10px; align-items: center; min-height: 36px; padding: 4px 13px; border: 1px solid #cbd3c9; border-radius: 5px; list-style: none; }
.nav-search > summary:hover { background: #f0f2e9; }
summary::-webkit-details-marker { display: none; }
.search-glass { width: 13px; height: 13px; border: 1.6px solid currentColor; border-radius: 50%; position: relative; transform: translateY(-1px); }
.search-glass::after { content: ''; width: 6px; height: 1.6px; background: currentColor; position: absolute; bottom: -2px; right: -4px; transform: rotate(47deg); }
.search-pop, .foot-links details ul { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 8px 24px #122a2410; position: absolute; right: 0; z-index: 10; }
.search-pop { width: min(360px, 84vw); padding: 18px; top: calc(100% + 9px); }
.menu-trigger { border: 0; background: transparent; min-height: 40px; }

.research-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.13fr); align-items: center; gap: clamp(30px, 6vw, 88px); padding: clamp(40px, 4.2vw, 68px) 0; }
.hero-kicker { display: flex; align-items: center; gap: 11px; font-size: 13px; font-weight: 650; letter-spacing: .11em; color: var(--teal); margin: 0 0 19px; }
.hero-kicker > span { width: 24px; height: 2px; background: var(--accent); }
.hero-copy h1 { margin: 0; color: var(--ink); font: 500 clamp(62px, 6.9vw, 102px)/.94 var(--serif); letter-spacing: -.061em; overflow-wrap: anywhere; }
.hero-copy h1 em { display: block; color: var(--teal); font-weight: 400; }
.hero-summary { text-wrap: pretty; margin: 22px 0; max-width: 33em; font-size: 15px; line-height: 1.95; color: #4c5c57; }
.ink-button { display: inline-flex; align-items: center; gap: 21px; border-radius: 4px; padding: 9px 16px; color: #fff; background: #1b4943; font-size: 14px; font-weight: 600; text-decoration: none; }
.ink-button:hover { background: #103a32; }
.ink-button span { font: 18px/1 var(--sans); }
.specimen { margin: 0; border: 1px solid #c9d3c5; border-radius: 5px; overflow: hidden; background: #f2f4ec; }
.specimen-field { position: relative; aspect-ratio: 16/9; isolation: isolate; background-color: #edf1e7; background-image: linear-gradient(#687c6520 1px,transparent 1px), linear-gradient(90deg,#687c6520 1px,transparent 1px), linear-gradient(#8093770c 1px,transparent 1px), linear-gradient(90deg,#8093770c 1px,transparent 1px); background-size: 72px 72px, 72px 72px, 18px 18px, 18px 18px; background-position: center; }
.specimen-still, .specimen-canvas { display: block; width: 100%; height: 100%; position: absolute; inset: 0; }
.figure-number, .specimen-coordinates, .registration { position: absolute; z-index: 1; color: #4b6056; font: 10px/1 var(--mono); }
.figure-number { top: 17px; left: 19px; letter-spacing: .13em; }
.registration { font-size: 17px; font-weight: 300; color: #829280; }
.reg-t { top: 10px; right: 15px; }
.reg-b { bottom: 12px; left: 15px; }
.specimen-coordinates { right: 17px; bottom: 15px; font: italic 17px/1 var(--serif); }
.specimen figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid #c9d3c5; padding: 9px 14px; }
.specimen-name { display: flex; gap: 7px; align-items: center; font-size: 12px; font-weight: 600; color: #344b42; }
.specimen-name span { font: italic 14px var(--serif); color: #556357; }
.specimen-name i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.specimen-controls { display: flex; gap: 1px; padding: 2px; border: 1px solid #c4cebd; border-radius: 4px; }
.specimen-controls button { padding: 2px 9px; background: transparent; color: #42574e; border: none; border-radius: 2px; font: 550 11px/1.6 var(--sans); }
.specimen-controls [aria-pressed=true] { background: #2e534a; color: white; }

.notebook-layout { border-top: 1px solid #87978b; display: grid; grid-template-columns: minmax(0, 2.5fr) minmax(235px, 1fr); gap: clamp(32px, 4.6vw, 72px); padding: 36px 0 66px; scroll-margin-top: 14px; }
.shelf-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 0 16px; }
.shelf-heading h2, .library-rail h2 { margin: 0; color: var(--ink); font: 700 32px/1.4 var(--serif); letter-spacing: -.035em; }
.index-stat { font: 12px var(--mono); color: var(--muted); }
.pinned-note { position: relative; background: #e9eee3; border: 1px solid #ccd6c5; border-radius: 4px; padding: 20px 23px 18px; }
.pin-label { margin: 0 0 11px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: #865130; font-weight: 650; letter-spacing: .07em; }
.bookmark { width: 9px; height: 13px; background-color: #a55937; clip-path: polygon(0 0,100% 0,100% 100%,50% 73%,0 100%); }
.pinned-note h2 { font-size: 23px; line-height: 1.48; text-wrap: balance; }
.pinned-note h2 a { color: inherit; text-decoration: none; }
.pinned-note h2 a:hover, .pin-link:hover { text-decoration: underline; }
.pin-link { display: inline-flex; align-items: baseline; gap: 9px; margin-top: 18px; font-size: 13px; font-weight: 650; text-decoration: none; }
.pin-excerpt { font-size: 13px; color: var(--muted); line-height: 1.7; margin-bottom: 0; }
.topic-list { margin-top: 25px; }
.topic-list:first-child { margin-top: 0; }
.topic-list h2 { font-size: 21px; }
.topic-list ul, .foot-links ul { list-style: none; padding: 0; margin: 10px 0 0; }
.topic-list li { border-top: 1px solid var(--line); }
.topic-list li a { display: flex; justify-content: space-between; gap: 15px; padding: 7px 1px; color: var(--ink); text-decoration: none; font-size: 14px; }
.topic-list li a:hover { color: var(--teal); text-decoration: underline; }
.topic-count { color: var(--muted); font: 12px/2 var(--mono); }
.all-topics { color: var(--teal); margin-top: 8px; font-size: 13px; }
.site-foot { border-top: 1px solid var(--line); }
.foot-row, .foot-sign, .foot-links { display: flex; align-items: baseline; flex-wrap: wrap; gap: 16px; }
.foot-row { justify-content: space-between; padding: 30px 0 40px; }
.foot-sign > a { font-size: 21px; }
.foot-sign span, .foot-links { font-size: 13px; color: var(--muted); }
.foot-links a { color: inherit; text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }
.foot-links details { position: relative; }
.foot-links details ul { margin: 0; padding: 12px 18px; bottom: calc(100% + 6px); max-height: 260px; overflow: auto; min-width: 145px; }
.foot-links details li { padding: 3px 0; }
@media (max-width: 850px) {
	.mast { gap: 20px; min-height: 68px; }
	.site-menu { gap: 8px 14px; }
	.research-hero { gap: 26px; }
	.hero-copy h1 { font-size: clamp(57px, 7.6vw, 70px); }
	.specimen-name span { display: none; }
	.notebook-layout { grid-template-columns: minmax(0, 2fr) minmax(200px, 1fr); gap: 25px; }
}
@media (max-width: 680px) {
	.cr-shell { width: calc(100% - 36px); }
	.mast { flex-wrap: wrap; min-height: 62px; gap: 0 12px; padding-block: 10px; }
	.brand-name { font-size: 24px; }
	.mast-nav { order: 3; width: 100%; }
	.mast.nav-ready .mast-nav:not(.is-open) { display: none; }
	.mast.nav-ready .menu-trigger { display: inline-block; }
	.site-menu { padding-top: 5px; }
	.site-menu .sub-menu { display: block; position: static; padding: 0 0 0 10px; border: none; min-width: 0; }
	.site-menu .menu-item-has-children > a::after { content: none; }
	.mast-tools { gap: 6px; }
	.search-label { display: none; }
	.nav-search > summary { width: 38px; justify-content: center; padding: 4px; }
	.research-hero { grid-template-columns: 1fr; padding: 30px 0 26px; gap: 24px; }
	.hero-kicker { font-size: 12px; margin-bottom: 15px; }
	.hero-copy h1 { font-size: clamp(60px, 13vw, 80px); }
	.hero-summary { margin: 15px 0 17px; font-size: 14px; }
	.specimen-name span { display: inline; }
	.notebook-layout { display: flex; flex-direction: column; gap: 28px; padding: 25px 0 40px; }
	.recent-notes { order: 1; }
	.library-rail { display: contents; }
	.pinned-note { order: 0; }
	.topic-list { order: 2; margin-top: 0; }
	.shelf-heading h2 { font-size: 28px; }
	.pinned-note { padding: 14px 17px; }
	.pinned-note h2 { font-size: 20px; }
	.pin-label { margin-bottom: 6px; }
	.pin-link { margin-top: 8px; }
	.foot-row { gap: 18px; }
	.foot-links details ul { left: 0; right: auto; }
}
@media (min-width: 681px) {
	.menu-trigger { display: none; }
}
