/*
* Work Directory (static design)
* 仅作用于 body.wd-page 与 .wd 根类
*/

/* 主题变量
  –––––––––––––––––––––––––––––––––––––––––––––––––– */
.wd {
	--wd-text: #1a1a1a;
	--wd-muted: #5c5f66;
	--wd-accent: #2457F5;
	--wd-accent-hover: #083BDA;
	--wd-accent-text: #ffffff;
	--wd-card: #f3f6fb;
	--wd-panel: #fbfcff;
	--wd-border: #e3e5ea;
	--wd-media-bg: #e8edf6;
	--wd-tag-bg: #eaf0fa;

	color: var(--wd-text);
	font-family: "Open Sans", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Hiragino Kaku Gothic ProN", "Microsoft YaHei", "Yu Gothic", "Meiryo", "Noto Sans CJK SC", "Noto Sans CJK JP", sans-serif;
	font-size: 1rem;
	line-height: 1.6;
}

body.wd-page {
	min-height: 100vh;
	background-color: #f3f6fb;
	background-image: radial-gradient(ellipse at 50% 0, #e6edfa 0, transparent 55%);
	color: #1a1a1a;
}

.wd-container {
	min-height: 100dvh;
	background: var(--wd-panel);
	border-radius: 24px;
	box-shadow: inset 0 0 0 1px var(--wd-border), 0 12px 40px rgba(25, 42, 81, .08);
}

.wd [data-directory-ui="contents"],
.wd [data-directory-ui="view"] {
	display: none;
}

:root.theme-dark body.wd-page {
	background-color: #111821;
	background-image: radial-gradient(ellipse at 50% 0, #1b2839 0, transparent 55%);
	color: #f2f2f2;
}

:root.theme-dark .wd {
	--wd-text: #f2f2f2;
	--wd-muted: #a6a9b0;
	--wd-accent: #4899F7;
	--wd-accent-hover: #7AB8FF;
	--wd-accent-text: #0b1220;
	--wd-card: #111821;
	--wd-panel: #1b222c;
	--wd-border: #2e3036;
	--wd-media-bg: #18212d;
	--wd-tag-bg: #1b2635;
}

@media (prefers-color-scheme: dark) {
	:root.theme-auto body.wd-page {
		background-color: #111821;
		background-image: radial-gradient(ellipse at 50% 0, #1b2839 0, transparent 55%);
		color: #f2f2f2;
	}
	:root.theme-auto .wd {
		--wd-text: #f2f2f2;
		--wd-muted: #a6a9b0;
		--wd-accent: #4899F7;
		--wd-accent-hover: #7AB8FF;
		--wd-accent-text: #0b1220;
		--wd-card: #111821;
		--wd-panel: #1e1f23;
		--wd-border: #2e3036;
		--wd-media-bg: #18212d;
		--wd-tag-bg: #1b2635;
	}
}

/* 覆盖全局元素规则
  –––––––––––––––––––––––––––––––––––––––––––––––––– */
.wd h1,
.wd h2,
.wd p,
.wd figure {
	margin: 0;
}

.wd section {
	margin: 0;
	text-align: left;
}

.wd ul,
.wd ol {
	list-style: none;
	margin: 0;
	padding: 0;
}

.wd li {
	margin: 0;
}

.wd a,
.wd a:hover {
	color: var(--wd-accent);
}

.wd :focus-visible,
.wd a:focus-visible {
	outline: 2px solid var(--wd-accent);
	outline-offset: 3px;
}

/* 容器
  –––––––––––––––––––––––––––––––––––————————————— */
.wd-container {
	width: 100%;
	max-width: 60rem;                     /* 960px，比作品页 720px 略宽 */
	margin: 0 auto;
	padding: 1.5rem var(--spacing-m) 3rem;
	box-sizing: border-box;
	min-width: 0;
}

/* 面包屑
  –––––––––––––––––––––––––––––––––––––––––––––––––– */
.wd-breadcrumb {
	margin: 0 0 .75rem;
	font-size: .875rem;
	line-height: 1.6;
	color: var(--wd-muted);
}

.wd .wd-breadcrumb ol {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.25rem 0;
}

.wd .wd-breadcrumb li {
	min-width: 0;
	overflow-wrap: anywhere;
}

.wd .wd-breadcrumb li + li::before {
	content: "/";
	margin: 0 0.5rem;
	color: var(--wd-border);
}

.wd .wd-breadcrumb a {
	color: var(--wd-muted);
	text-decoration: underline;
	text-underline-offset: 0.2em;
	text-decoration-color: var(--wd-border);
}

.wd .wd-breadcrumb a:hover {
	color: var(--wd-accent);
}

.wd-breadcrumb [aria-current="page"] {
	color: var(--wd-text);
	font-weight: 600;
}

/* 封面（目录头部与卡片共用：3:4，居中裁切）
  –––––––––––––––––––––––––––––––––––––––––––––––––– */
.wd-cover {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	aspect-ratio: 3 / 4;
	object-fit: cover;
	object-position: center;
	background: var(--wd-media-bg);
	border-radius: 0.75rem;
}

.wd-cover--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--spacing-s);
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	color: var(--wd-muted);
	text-align: center;
	background:
		linear-gradient(135deg, transparent 0 48%, var(--wd-border) 48% 52%, transparent 52% 100%),
		var(--wd-media-bg);
	border: 1px dashed var(--wd-border);
	box-sizing: border-box;
}

/* 目录头部
  –––––––––––––––––––––––––––––––––––––––––––––––––– */
.wd-header {
	display: grid;
	grid-template-columns: 8rem minmax(0, 1fr);
	align-items: center;
	gap: 1.25rem;
	margin: 0 0 1.25rem;
	padding: 1rem;
	background: var(--wd-card);
	border: 1px solid var(--wd-border);
	border-radius: 1rem;
}

.wd-header-cover .wd-cover {
	border: 1px solid var(--wd-border);
}

.wd-header-text {
	min-width: 0;
}

.wd-kicker {
	margin: 0 0 var(--spacing-xs);
}

.wd h1.wd-title {
	margin: 0 0 .375rem;
	max-width: 24em;
	font-size: 1.75rem;
	font-weight: 800;
	line-height: 1.25;
	letter-spacing: -0.01em;
	color: var(--wd-text);
	hyphens: manual;
	overflow-wrap: anywhere;
}

.wd-intro {
	max-width: 32em;
	font-size: .9375rem;
	line-height: 1.6;
	color: var(--wd-muted);
	overflow-wrap: anywhere;
}

/* 条目区
  –––––––––––––––––––––––––––––––––––––––––––––––––– */
.wd h2.wd-section-title {
	margin: 0 0 .875rem;
	font-size: var(--scale-1);
	font-weight: 700;
	line-height: 1.3;
	color: var(--wd-text);
}

.wd ul.wd-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(0, min(100%, 13rem)));
	justify-content: start;
	gap: 1rem;
}

.wd li.wd-item {
	display: flex;
	min-width: 0;
}

.wd a.wd-card {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	min-width: 0;
	padding: 0.75rem;
	color: var(--wd-text);
	text-decoration: none;
	background: var(--wd-card);
	border: 1px solid var(--wd-border);
	border-radius: 0.75rem;
	box-sizing: border-box;
}

.wd a.wd-card:hover {
	color: var(--wd-text);
	border-color: var(--wd-accent);
}

/* 目录卡片：叠放的两层边框，暗示可继续进入 */
.wd a.wd-card--dir {
	box-shadow:
		0 6px 0 -1px var(--wd-card),
		0 6px 0 0 var(--wd-border),
		0 12px 0 -2px var(--wd-card),
		0 12px 0 -1px var(--wd-border);
	margin-bottom: 12px;
}

.wd-card-cover {
	border-radius: 0.5rem;
}

.wd-card-body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.375rem;
	flex: 1 1 auto;
	min-width: 0;
	padding: 0.625rem 0.125rem 0.125rem;
}

.wd-card-title {
	display: block;
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1.35;
	color: var(--wd-text);
	overflow-wrap: anywhere;
	hyphens: manual;
}

.wd-card-text {
	display: block;
	font-size: 0.9375rem;
	line-height: 1.65;
	color: var(--wd-muted);
	overflow-wrap: anywhere;
}

.wd-card-more {
	margin-top: auto;
	padding-top: 0.25rem;
	font-size: 0.875rem;
	font-weight: 700;
	color: var(--wd-accent);
}

/* 类型标签
  –––––––––––––––––––––––––––––––––––––––––––––––––– */
.wd-tag {
	display: inline-block;
	padding: 0.125rem 0.625rem;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1.6;
	border-radius: 999px;
	white-space: normal;
	overflow-wrap: anywhere;
}

.wd-tag--dir {
	color: var(--wd-accent);
	background: var(--wd-tag-bg);
	border: 1px solid var(--wd-border);
}

.wd-tag--work {
	color: var(--wd-accent-text);
	background: var(--wd-accent);
	border: 1px solid var(--wd-accent);
}

/* 窄屏
  –––––––––––––––––––––––––––––––––––––––––––––––––– */
@media (max-width: 48rem) {
	.wd-header {
		grid-template-columns: 6rem minmax(0, 1fr);
		gap: .875rem;
	}
	.wd-header-cover {
		max-width: 6rem;
	}
}

@media (max-width: 34.375rem) {
	.wd-container {
		padding: 1rem var(--spacing-s) 2rem;
	}
	.wd-header {
		padding: 0.75rem;
		margin-bottom: 1rem;
		border-radius: 0.75rem;
	}
	.wd-header-text {
		padding: 0 0.25rem 0.25rem;
	}
	.wd h1.wd-title {
		font-size: 1.375rem;
	}
	.wd-intro {
		font-size: .875rem;
	}
	.wd ul.wd-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: .75rem;
	}
	.wd a.wd-card { padding: .5rem; }
	.wd-card-title { font-size: .9375rem; }
	.wd-card-text { font-size: .8125rem; }
}

.wd-cover-frame { aspect-ratio:3/4; overflow:hidden; border-radius:.75rem; background:var(--wd-media-bg); }
.wd-cover-frame .wd-cover { height:100%; aspect-ratio:auto; }
.wd p.wd-kicker { margin-bottom:var(--spacing-xs); }
.wd-empty { color:var(--wd-muted); }

/* 卡片与网格列同宽，间距统一由 grid 控制。 */
.wd-card > .wd-cover-frame { width: 100%; }

.wd-home-video { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: .75rem; }
