* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: system-ui, -apple-system, 'Segoe UI', 'Noto Serif SC', 'Georgia', 'Times New Roman', serif;
	background: #faf7f0;
	color: #2c2b28;
	line-height: 1.5;
	padding: 1rem;
}

/* 整体容器 - 自适应双栏/单栏 */
.app-container {
	max-width: 1600px;
	margin: 0 auto;
	background: #fffef7;
	border-radius: 2rem;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
	overflow: hidden;
}

/* 头部 */
.header {
	background: #2e5a4f;
	color: #fef7e0;
	padding: 1.5rem 2rem;
	border-bottom: 1px solid #d0cfc0;
}
.header h1 {
	font-size: 1.8rem;
	font-weight: 500;
	letter-spacing: 2px;
}
.header p {
	margin-top: 0.5rem;
	opacity: 0.85;
	font-size: 0.9rem;
}

/* 左右两栏 flex 布局，移动端自动堆叠 */
.two-columns {
	display: flex;
	flex-wrap: wrap;
}

/* 左侧：条文区 */
.tiaowen-section {
	flex: 2;
	min-width: 280px;
	background: #ffffff;
	border-right: 1px solid #e6e2d8;
	padding: 1.5rem 1rem;
}

/* 右侧：方剂速查 */
.formula-section {
	flex: 1;
	min-width: 260px;
	background: #fefaf2;
	padding: 1.5rem 1rem;
}

.section-title {
	font-size: 1.4rem;
	font-weight: 600;
	border-left: 5px solid #b87c4f;
	padding-left: 1rem;
	margin-bottom: 1.2rem;
	color: #3e2c1f;
}

/* 条文卡片 */
.tiaowen-card {
	background: #fffdf9;
	border: 1px solid #ede6db;
	border-radius: 1rem;
	padding: 1rem 1.2rem;
	margin-bottom: 1rem;
	transition: all 0.15s ease;
	box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.tiaowen-card:hover {
	border-color: #c2a575;
	background: #fffcf5;
}
.tiaowen-number {
	display: inline-block;
	font-weight: 700;
	font-size: 0.85rem;
	background: #e9e0d3;
	padding: 0.2rem 0.7rem;
	border-radius: 2rem;
	color: #5a3e2a;
	margin-bottom: 0.6rem;
	letter-spacing: 0.5px;
}
.tiaowen-content {
	font-size: 1rem;
	line-height: 1.6;
	color: #2e2c2a;
	margin-bottom: 0.6rem;
}
.formula-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.5rem;
}
.formula-link {
	background: none;
	border: 1px solid #cbbfaa;
	padding: 0.2rem 0.9rem;
	border-radius: 2rem;
	font-size: 0.8rem;
	font-weight: 500;
	color: #8b5a2b;
	cursor: pointer;
	transition: 0.1s;
	font-family: inherit;
}
.formula-link:hover {
	background: #ecd9bf;
	border-color: #b27d48;
	color: #3e2a1a;
}

/* 右侧方剂列表 */
.formula-grid {
	display: flex;
	flex-direction: column;
	gap: 0.7rem;
}
.formula-item {
	background: white;
	border-radius: 1rem;
	border: 1px solid #e7dfd3;
	transition: 0.1s;
}
.formula-name {
	width: 100%;
	text-align: left;
	background: #fef7ed;
	border: none;
	padding: 0.8rem 1rem;
	font-size: 1rem;
	font-weight: 600;
	color: #4c351c;
	cursor: pointer;
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-radius: 1rem;
	font-family: inherit;
}
.formula-name:hover {
	background: #f5e9da;
}
.arrow {
	font-size: 0.9rem;
	color: #b87c4f;
}

/* 模态框 */
.modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(3px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
	visibility: hidden;
	opacity: 0;
	transition: opacity 0.2s;
}
.modal-overlay.active {
	visibility: visible;
	opacity: 1;
}
.modal-content {
	background: #fffef7;
	max-width: 90vw;
	width: 550px;
	max-height: 80vh;
	border-radius: 1.8rem;
	box-shadow: 0 20px 35px rgba(0,0,0,0.2);
	overflow-y: auto;
	padding: 1.5rem;
	position: relative;
	margin: 1rem;
}
.modal-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	border-bottom: 2px solid #e3d9cd;
	padding-bottom: 0.7rem;
	margin-bottom: 1rem;
}
.modal-header h3 {
	font-size: 1.5rem;
	color: #2e5a4f;
}
.close-modal {
	background: none;
	border: none;
	font-size: 1.8rem;
	cursor: pointer;
	color: #8f7a62;
}
.modal-body {
	font-size: 0.98rem;
}
.formula-detail {
	background: #faf3e8;
	padding: 0.8rem;
	border-radius: 1rem;
	margin: 1rem 0;
}
.related-tiaowen-list {
	margin-top: 1rem;
}
.related-item {
	background: white;
	border-left: 4px solid #b87c4f;
	padding: 0.6rem 0.8rem;
	margin: 0.6rem 0;
	border-radius: 0.6rem;
	font-size: 0.9rem;
	cursor: pointer;
	transition: 0.05s linear;
}
.related-item:hover {
	background: #f4ede3;
}
.badge {
	background: #d9cdb6;
	padding: 0.1rem 0.5rem;
	border-radius: 2rem;
	font-size: 0.7rem;
	font-weight: bold;
	margin-right: 0.6rem;
}
hr {
	margin: 1rem 0;
	border-color: #ece3d7;
}
footer {
	text-align: center;
	padding: 1rem;
	font-size: 0.75rem;
	color: #7e6e58;
	border-top: 1px solid #ece3d7;
	background: #fffef7;
}
@media (max-width: 780px) {
	body {
		padding: 0.5rem;
	}
	.tiaowen-section, .formula-section {
		padding: 1rem;
	}
	.section-title {
		font-size: 1.2rem;
	}
	.modal-content {
		width: 95%;
		padding: 1rem;
	}
}
.search-box {
	margin-bottom: 1rem;
}
.search-input {
	width: 100%;
	padding: 0.6rem 1rem;
	border-radius: 2rem;
	border: 1px solid #ddd2c0;
	background: white;
	font-size: 0.9rem;
}
.no-result {
	text-align: center;
	color: #a78e6f;
	padding: 1rem;
}
