/* 饭耳需求墙。颜色、间距、圆角照抄官网 sites/fanear/src/styles/tokens.css 和 base.css，组件里不写色值。 */
:root {
	--c-paper: #ffffff; /* 纸白：底色 */
	--c-ink: #121826; /* 深墨：正文 */
	--c-ink-2: #424959; /* 次要正文 */
	--c-ink-3: #5e6676; /* 注释、时间 */
	--c-line: #e1e4ea; /* 分隔线、边框 */
	--c-wash: #f3f4f6; /* 浅底 */
	--c-press: #2e3546; /* 深色按钮按下 */
	--c-me: #2152c9; /* 我蓝：主按钮、链接、已投 */
	--c-me-press: #1a42a6; /* 我蓝按下 */
	--c-scrim: rgba(18, 24, 38, 0.06); /* 悬停薄底 */
	--c-backdrop: rgba(18, 24, 38, 0.48); /* 弹层后面的遮罩，深墨 48% */
	--c-error: #b3261e; /* 出错的字；白底对比度 6.5 */

	--font: -apple-system, 'SF Pro Text', 'PingFang SC', 'Hiragino Sans GB', sans-serif;

	--s-1: 4px;
	--s-2: 8px;
	--s-3: 12px;
	--s-4: 16px;
	--s-5: 24px;
	--s-6: 32px;
	--s-7: 48px;
	--s-8: 64px;

	--r-tag: 4px;
	--r-btn: 12px;
	--r-card: 16px;

	--wall-max: 760px;
	--gutter: 20px;
}

@media (min-width: 768px) {
	:root {
		--gutter: 32px;
	}
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--c-paper);
	color: var(--c-ink);
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	overflow-wrap: anywhere;
}

h1,
h2,
h3 {
	margin: 0;
	color: var(--c-ink);
	font-weight: 700;
	line-height: 1.3;
}

p {
	margin: 0;
}

ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

a {
	color: var(--c-me);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.22em;
}

a:hover {
	color: var(--c-me-press);
	text-decoration-thickness: 2px;
}

:focus-visible {
	outline: 2px solid var(--c-me);
	outline-offset: 3px;
	border-radius: 2px;
}

::selection {
	background: var(--c-me);
	color: var(--c-paper);
}

[hidden] {
	display: none !important;
}

.skip-link {
	position: absolute;
	top: -100px;
	left: var(--gutter);
	z-index: 10;
	padding: var(--s-2) var(--s-3);
	background: var(--c-ink);
	color: var(--c-paper);
	border-radius: var(--r-btn);
}

.skip-link:focus {
	top: var(--s-2);
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.wrap {
	width: 100%;
	max-width: calc(var(--wall-max) + var(--gutter) * 2);
	margin: 0 auto;
	padding: 0 var(--gutter);
}

/* 按钮：深墨实心、我蓝实心（提需求、登录这类主动作）、描边三种。圆角 12，不做胶囊。 */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--s-2);
	min-height: 48px;
	padding: 0 var(--s-5);
	border: 2px solid var(--c-ink);
	border-radius: var(--r-btn);
	background: var(--c-ink);
	color: var(--c-paper);
	font: inherit;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	touch-action: manipulation;
	transition:
		background-color 150ms ease,
		border-color 150ms ease,
		color 150ms ease;
}

.btn:hover {
	background: var(--c-press);
	border-color: var(--c-press);
	color: var(--c-paper);
	text-decoration: none;
}

.btn:active {
	background: var(--c-me-press);
	border-color: var(--c-me-press);
}

.btn-me {
	background: var(--c-me);
	border-color: var(--c-me);
}

.btn-me:hover {
	background: var(--c-me-press);
	border-color: var(--c-me-press);
}

.btn-me:active {
	background: var(--c-ink);
	border-color: var(--c-ink);
}

.btn-line {
	background: var(--c-paper);
	color: var(--c-ink);
}

.btn-line:hover {
	background: var(--c-wash);
	border-color: var(--c-ink);
	color: var(--c-ink);
}

.btn-line:active {
	background: var(--c-line);
	border-color: var(--c-ink);
}

.btn-small {
	min-height: 44px;
	padding: 0 var(--s-4);
	font-size: 15px;
}

.btn[disabled],
.btn[aria-disabled='true'] {
	border-color: var(--c-line);
	background: var(--c-wash);
	color: var(--c-ink-3);
	cursor: not-allowed;
}

.link-btn {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--c-me);
	font: inherit;
	font-size: 15px;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.22em;
	cursor: pointer;
	touch-action: manipulation;
}

.link-btn:hover {
	color: var(--c-me-press);
	text-decoration-thickness: 2px;
}

/* 顶栏 */
.top {
	border-bottom: 1px solid var(--c-line);
}

.top .wrap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--s-3);
	min-height: 60px;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: var(--s-2);
	min-height: 44px;
	color: var(--c-ink);
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}

.brand:hover {
	color: var(--c-ink);
	text-decoration: none;
}

.brand-mark {
	width: 12px;
	height: 12px;
	border-radius: 2px;
	background: var(--c-me);
}

.nav {
	display: flex;
	gap: var(--s-1);
}

.nav a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 var(--s-3);
	border-radius: var(--r-btn);
	color: var(--c-ink-2);
	font-size: 16px;
	text-decoration: none;
	white-space: nowrap;
}

.nav a:hover {
	background: var(--c-wash);
	color: var(--c-ink);
}

.nav a[aria-current='page'] {
	color: var(--c-ink);
	font-weight: 600;
	box-shadow: inset 0 -2px 0 var(--c-ink);
	border-radius: 0;
}

main {
	display: block;
	min-height: 60vh;
	padding: var(--s-6) 0 var(--s-8);
}

main:focus {
	outline: none;
}

.page-title {
	font-size: 28px;
}

.page-title:focus {
	outline: none;
}

.lede {
	margin-top: var(--s-3);
	color: var(--c-ink-2);
}

.intro {
	display: grid;
	gap: var(--s-4);
}

.intro .btn {
	justify-self: start;
}

/* 筛选和排序 */
.filters {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--s-3);
	margin-top: var(--s-6);
}

.field-label {
	display: block;
	margin-bottom: var(--s-1);
	color: var(--c-ink-3);
	font-size: 14px;
}

.select,
.input,
.textarea {
	display: block;
	width: 100%;
	min-height: 48px;
	padding: var(--s-2) var(--s-3);
	border: 1px solid var(--c-ink-3);
	border-radius: var(--r-btn);
	background: var(--c-paper);
	color: var(--c-ink);
	font: inherit;
	font-size: 17px;
}

.select {
	appearance: none;
	padding-right: 36px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23121826' stroke-width='2'/%3E%3C/svg%3E");
	background-position: calc(100% - 14px) 50%;
	background-size: 12px 8px;
	background-repeat: no-repeat;
	cursor: pointer;
}

.textarea {
	min-height: 140px;
	resize: vertical;
	line-height: 1.6;
}

.input:focus,
.select:focus,
.textarea:focus {
	border-color: var(--c-me);
}

.input[aria-invalid='true'],
.textarea[aria-invalid='true'] {
	border-color: var(--c-error);
}

.sort {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	gap: var(--s-2);
}

.sort-label {
	color: var(--c-ink-3);
	font-size: 14px;
}

.seg {
	display: inline-flex;
	padding: 2px;
	border: 1px solid var(--c-line);
	border-radius: var(--r-btn);
	background: var(--c-wash);
}

.seg button {
	min-height: 44px;
	padding: 0 var(--s-4);
	border: 0;
	border-radius: 10px;
	background: none;
	color: var(--c-ink-2);
	font: inherit;
	font-size: 15px;
	cursor: pointer;
	touch-action: manipulation;
}

.seg button[aria-pressed='true'] {
	background: var(--c-paper);
	color: var(--c-ink);
	font-weight: 600;
	box-shadow: 0 0 0 1px var(--c-line);
}

.seg button:active {
	background: var(--c-line);
}

/* 需求列表 */
.posts {
	margin-top: var(--s-5);
	border-top: 1px solid var(--c-line);
}

.post {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: var(--s-4);
	padding: var(--s-4) 0;
	border-bottom: 1px solid var(--c-line);
}

.post-main {
	flex: 1;
	min-width: 0;
}

.post-title {
	display: block;
	color: var(--c-ink);
	font-size: 18px;
	font-weight: 600;
	line-height: 1.45;
	text-decoration: none;
}

/* 整行都能点进详情：标题链接撑满整条，投票键和管理按钮浮在上面 */
.post-title::after {
	content: '';
	position: absolute;
	inset: 0;
}

.post:hover {
	background: var(--c-scrim);
}

.post .vote,
.post .queue-actions,
.post .error,
.post .ok {
	position: relative;
	z-index: 1;
}

.post-title:hover {
	color: var(--c-me);
	text-decoration: underline;
	text-decoration-thickness: 1px;
}

.post-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--s-1) var(--s-2);
	margin-top: var(--s-2);
	color: var(--c-ink-3);
	font-size: 14px;
	line-height: 1.5;
}

/* 投票键：票数 +「要」；已投用我蓝实心 */
.vote {
	display: inline-flex;
	flex: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 60px;
	min-height: 64px;
	padding: var(--s-1) 0;
	border: 2px solid var(--c-line);
	border-radius: var(--r-btn);
	background: var(--c-paper);
	color: var(--c-ink);
	font: inherit;
	line-height: 1.2;
	cursor: pointer;
	touch-action: manipulation;
	transition:
		background-color 150ms ease,
		border-color 150ms ease,
		color 150ms ease;
}

.vote:hover {
	border-color: var(--c-ink);
}

.vote:active {
	background: var(--c-wash);
}

.vote-n {
	font-size: 18px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.vote-w {
	font-size: 14px;
	color: var(--c-ink-2);
}

.vote[aria-pressed='true'] {
	border-color: var(--c-me);
	background: var(--c-me);
	color: var(--c-paper);
}

.vote[aria-pressed='true'] .vote-w {
	color: var(--c-paper);
}

.vote[aria-pressed='true']:hover {
	border-color: var(--c-me-press);
	background: var(--c-me-press);
}

.vote[aria-pressed='true']:active {
	background: var(--c-ink);
	border-color: var(--c-ink);
}

.vote[disabled] {
	border-style: dashed;
	background: var(--c-wash);
	color: var(--c-ink-3);
	cursor: not-allowed;
}

.vote[disabled] .vote-w {
	color: var(--c-ink-3);
}

.vote[aria-busy='true'] {
	opacity: 0.6;
}

.vote-lg {
	width: 72px;
	min-height: 76px;
}

.vote-lg .vote-n {
	font-size: 22px;
}

/* 小标签：状态、待审核 */
.tag {
	display: inline-flex;
	align-items: center;
	min-height: 22px;
	padding: 0 6px;
	border: 1px solid var(--c-line);
	border-radius: var(--r-tag);
	color: var(--c-ink-2);
	font-size: 14px;
	line-height: 1.4;
	white-space: nowrap;
}

.tag-planned,
.tag-in_progress {
	border-color: var(--c-ink-2);
	color: var(--c-ink);
}

.tag-done {
	border-color: var(--c-ink);
	background: var(--c-ink);
	color: var(--c-paper);
}

.tag-declined {
	background: var(--c-wash);
	color: var(--c-ink-3);
}

.tag-pending,
.tag-hidden {
	border-style: dashed;
	border-color: var(--c-ink-3);
	color: var(--c-ink);
}

.has-reply {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--c-ink-2);
}

.has-reply::before {
	content: '';
	width: 8px;
	height: 8px;
	border-radius: 2px;
	background: var(--c-me);
}

.more {
	display: flex;
	justify-content: center;
	margin-top: var(--s-5);
}

/* 加载、空状态、出错 */
.state {
	margin-top: var(--s-5);
	padding: var(--s-6) var(--s-4);
	border: 1px dashed var(--c-line);
	border-radius: var(--r-card);
	color: var(--c-ink-2);
	text-align: center;
}

.state p + * {
	margin-top: var(--s-4);
}

.state-title {
	color: var(--c-ink);
	font-weight: 600;
}

.loading {
	margin-top: var(--s-5);
	color: var(--c-ink-3);
	font-size: 15px;
}

.error {
	color: var(--c-error);
	font-size: 15px;
}

.ok {
	color: var(--c-ink);
	font-size: 15px;
}
