/**
 * 社团图书馆 - 前台样式
 */

.cl-library {
	--cl-primary: #166534;
	--cl-primary-dark: #14532d;
	--cl-primary-soft: #dcfce7;
	--cl-accent: #b45309;
	--cl-text: #1e293b;
	--cl-muted: #64748b;
	--cl-border: #e2e8f0;
	--cl-bg: #f8fafc;
	--cl-white: #ffffff;
	--cl-danger: #b91c1c;
	--cl-danger-soft: #fee2e2;
	--cl-warning: #92400e;
	--cl-warning-soft: #fef3c7;
	--cl-radius: 14px;
	--cl-radius-sm: 9px;
	--cl-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 10px 28px -18px rgba(15, 23, 42, 0.28);
	--cl-shadow-hover: 0 4px 8px rgba(15, 23, 42, 0.06), 0 18px 38px -20px rgba(15, 23, 42, 0.34);
	color: var(--cl-text);
	font-size: 15px;
	line-height: 1.65;
	box-sizing: border-box;
}

.cl-library *,
.cl-library *::before,
.cl-library *::after {
	box-sizing: border-box;
}

.cl-library a {
	color: var(--cl-primary);
	text-decoration: none;
}

.cl-library a:hover,
.cl-library a:focus {
	color: var(--cl-primary-dark);
	text-decoration: underline;
}

.cl-library h2,
.cl-library h3 {
	color: var(--cl-text);
	line-height: 1.35;
}

.cl-library .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* 按钮 */
.cl-library .cl-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 40px;
	padding: 9px 18px;
	border: 1px solid transparent;
	border-radius: 999px;
	font: inherit;
	font-size: 0.92rem;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.cl-library .cl-btn:hover,
.cl-library .cl-btn:focus {
	text-decoration: none;
	transform: translateY(-1px);
}

.cl-library .cl-btn-primary {
	background: var(--cl-primary);
	border-color: var(--cl-primary);
	color: #fff;
	-webkit-text-fill-color: #fff;
}

.cl-library .cl-btn-primary:hover,
.cl-library .cl-btn-primary:focus {
	background: var(--cl-primary-dark);
	border-color: var(--cl-primary-dark);
	color: #fff;
	-webkit-text-fill-color: #fff;
}

/* 经费申请表单：防止主题的按钮/文字填充样式把按钮文字隐藏。 */
.cl-library .cl-finance-form-card .cl-btn-primary {
	background-color: #166534 !important;
	background-image: none !important;
	border-color: #166534 !important;
	color: #fff !important;
	-webkit-text-fill-color: #fff !important;
	opacity: 1 !important;
	visibility: visible !important;
	font-size: 0.92rem !important;
	line-height: 1.2 !important;
	text-indent: 0 !important;
	text-shadow: none !important;
}

.cl-library .cl-finance-form-card .cl-btn-primary:hover,
.cl-library .cl-finance-form-card .cl-btn-primary:focus {
	background-color: #14532d !important;
	border-color: #14532d !important;
	color: #fff !important;
	-webkit-text-fill-color: #fff !important;
}

.cl-library .cl-btn-secondary {
	background: var(--cl-primary-soft);
	border-color: #bbf7d0;
	color: var(--cl-primary-dark);
}

.cl-library .cl-btn-secondary:hover,
.cl-library .cl-btn-secondary:focus {
	background: #bbf7d0;
	border-color: #86efac;
	color: var(--cl-primary-dark);
}

.cl-library .cl-btn-disabled {
	background: #f1f5f9;
	border-color: #e2e8f0;
	color: #94a3b8;
	cursor: not-allowed;
	transform: none;
}

.cl-library .cl-btn-disabled:hover {
	transform: none;
}

/* 未通过社员审核 */
.cl-library .cl-member-pending {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0 0 16px;
	padding: 12px 14px;
	border: 1px solid #fde68a;
	border-left: 4px solid var(--cl-accent);
	border-radius: 10px;
	background: #fffbeb;
	color: var(--cl-warning);
	font-size: 0.88rem;
	line-height: 1.6;
}

.cl-library .cl-member-pending__icon {
	flex: 0 0 auto;
	font-size: 1rem;
	line-height: 1.4;
}

.cl-library .cl-member-pending p {
	margin: 0;
}

/* 活动详情与报名 */
.cl-event-details {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 12px;
	margin: 24px 0;
	padding: 18px;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	background: #fff;
}

.cl-event-details > div {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.cl-event-details span {
	color: var(--cl-muted);
	font-size: 0.76rem;
}

.cl-event-details strong {
	color: var(--cl-text);
	font-size: 0.92rem;
}

.cl-event-edit-action {
	margin-top: 14px;
}

.cl-event-edit-action .cl-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 40px;
	padding: 9px 18px;
	border: 1px solid #bbf7d0;
	border-radius: 10px;
	background: #dcfce7;
	color: #166534;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
}

.cl-event-edit-action .cl-btn:hover,
.cl-event-edit-action .cl-btn:focus {
	background: #bbf7d0;
	border-color: #86efac;
	color: #14532d;
	text-decoration: none;
}

.cl-event-registration {
	margin: 28px 0;
	padding: 22px;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	background: #fff;
}

.cl-event-registration h2 {
	margin: 0 0 14px;
	font-size: 1.15rem;
}

.cl-event-registration__notice {
	padding: 12px 14px;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	background: #f8fafc;
	color: var(--cl-text);
}

.cl-event-registration__notice.is-warning {
	border-color: #fde68a;
	background: #fffbeb;
	color: #92400e;
}

.cl-event-registration__notice.is-success {
	border-color: #bbf7d0;
	background: var(--cl-primary-soft);
	color: var(--cl-primary-dark);
}

.cl-event-registration__notice p {
	margin: 0 0 8px;
}

.cl-event-registration__notice p:last-child {
	margin-bottom: 0;
}

.cl-event-form {
	margin: 0;
}

.cl-event-form textarea {
	width: 100%;
	max-width: 680px;
}

.cl-inline-form {
	display: inline;
	margin: 0;
}

/* 调查问卷 */
.cl-survey {
	margin: 28px 0;
	padding: 22px;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	background: #fff;
}

.cl-survey__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	margin-bottom: 14px;
	color: var(--cl-muted);
	font-size: 0.78rem;
}

.cl-survey__notice {
	margin-bottom: 14px;
	padding: 12px 14px;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	background: #f8fafc;
}

.cl-survey__notice.is-warning {
	border-color: #fde68a;
	background: #fffbeb;
	color: #92400e;
}

.cl-survey__notice.is-success {
	border-color: #bbf7d0;
	background: var(--cl-primary-soft);
	color: var(--cl-primary-dark);
}

.cl-survey__notice p {
	margin: 0;
}

.cl-survey__question {
	margin: 0 0 16px;
	padding: 14px 16px;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
}

.cl-survey__question legend {
	padding: 0 4px;
	color: var(--cl-text);
	font-weight: 700;
}

.cl-survey__anonymous {
	padding: 1px 7px;
	border-radius: 999px;
	background: #ecfdf5;
	color: #047857;
	font-weight: 700;
}

.cl-survey__anonymous-note {
	margin: 0 0 16px;
	padding: 11px 13px;
	border: 1px solid #bbf7d0;
	border-radius: 10px;
	background: #f0fdf4;
	color: #14532d;
}

.cl-survey__anonymous-note p {
	margin: 2px 0 0;
	font-size: 0.82rem;
}

.cl-survey__required,
.cl-survey__optional {
	margin-left: 4px;
	padding: 1px 6px;
	border-radius: 999px;
	font-size: 0.64rem;
	font-weight: 700;
	vertical-align: middle;
}

.cl-survey__required {
	background: #fef2f2;
	color: #b91c1c;
}

.cl-survey__optional {
	background: #f1f5f9;
	color: #64748b;
}

/* 举手报告 */
.cl-report-header {
	margin: 0 0 16px;
}

.cl-report-eyebrow {
	display: block;
	color: var(--cl-primary);
	font-size: 0.66rem;
	font-weight: 700;
	letter-spacing: 0.16em;
}

.cl-report-header h2 {
	margin: 2px 0 4px;
	font-family: Georgia, "Noto Serif SC", "Songti SC", SimSun, serif;
	font-size: 1.5rem;
}

.cl-report-header p {
	margin: 0;
	color: var(--cl-muted);
	font-size: 0.84rem;
}

.cl-report-layout {
	display: grid;
	grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
	gap: 18px;
	align-items: start;
}

.cl-report-form,
.cl-report-list {
	padding: 18px;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	background: #fff;
}

.cl-report-form__head h3,
.cl-report-list > h3 {
	margin: 0 0 4px;
	font-size: 1.02rem;
}

.cl-report-form__head p {
	margin: 0 0 14px;
	color: var(--cl-muted);
	font-size: 0.78rem;
}

.cl-report-form textarea,
.cl-report-form input[type="text"] {
	width: 100%;
}

.cl-report-list > h3 {
	margin-bottom: 12px;
}

.cl-report-item {
	margin: 0 0 10px;
	padding: 12px 14px;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	background: #fbfdff;
}

.cl-report-item:last-child {
	margin-bottom: 0;
}

.cl-report-item.is-closed {
	border-color: #bbf7d0;
	background: #f7fef9;
}

.cl-report-item__top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
}

.cl-report-item__top h4 {
	margin: 0;
	font-size: 0.94rem;
}

.cl-report-item > p {
	margin: 8px 0;
	font-size: 0.82rem;
	line-height: 1.65;
}

.cl-report-reply {
	margin-top: 8px;
	padding: 10px 12px;
	border-left: 3px solid var(--cl-primary);
	background: var(--cl-primary-soft);
}

/* 活动摊位申请 */
.cl-booth {
	max-width: 820px;
	margin: 0 auto;
}

.cl-booth__header {
	margin-bottom: 18px;
}

.cl-booth__eyebrow {
	display: block;
	color: var(--cl-primary);
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.08em;
}

.cl-booth__header h2 {
	margin: 3px 0 5px;
	font-family: Georgia, "Noto Serif SC", "Songti SC", SimSun, serif;
	font-size: 1.5rem;
}

.cl-booth__header p {
	margin: 0;
	color: var(--cl-muted);
	font-size: 0.84rem;
}

.cl-booth__form,
.cl-booth__mine {
	padding: 18px;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	background: #fff;
}

.cl-booth__field,
.cl-booth__question {
	display: block;
	margin: 0 0 16px;
}

.cl-booth__field > span,
.cl-booth__question legend {
	display: block;
	margin-bottom: 6px;
	font-weight: 700;
	font-size: 0.84rem;
}

.cl-booth__field select {
	width: 100%;
}

.cl-booth__question {
	padding: 0;
	border: 0;
}

.cl-booth__question em,
.cl-booth__field em {
	color: var(--cl-primary);
	font-style: normal;
}

.cl-booth__option {
	display: flex;
	align-items: center;
	gap: 7px;
	margin: 5px 0;
	font-size: 0.84rem;
}

.cl-booth__mine {
	margin-top: 18px;
}

.cl-booth__mine h3 {
	margin-top: 0;
}

.cl-booth__mine-item {
	padding: 10px 0;
	border-bottom: 1px solid #f1f5f9;
	font-size: 0.82rem;
}

.cl-booth__mine-item:last-child {
	border-bottom: 0;
}

.cl-booth__mine-item strong {
	margin-right: 8px;
}

.cl-booth__mine-item time {
	color: var(--cl-muted);
	font-size: 0.72rem;
}

.cl-booth__mine-item p {
	margin: 5px 0 0;
	color: #475569;
}

.cl-report-reply p {
	margin: 4px 0 0;
	font-size: 0.82rem;
	line-height: 1.65;
}

.cl-report-thread {
	display: flex;
	flex-direction: column;
	gap: 7px;
	margin: 10px 0;
}

.cl-report-message {
	padding: 8px 10px;
	border-radius: 8px;
	background: #f8fafc;
	font-size: 0.8rem;
}

.cl-report-message.is-admin {
	border-left: 3px solid var(--cl-primary);
	background: var(--cl-primary-soft);
}

.cl-report-message p {
	margin: 3px 0;
	line-height: 1.6;
}

.cl-report-message time {
	color: var(--cl-muted);
	font-size: 0.68rem;
}

.cl-report-followup-form {
	margin-top: 10px;
}

.cl-report-followup-form label {
	display: block;
	margin-bottom: 4px;
	font-weight: 700;
	font-size: 0.78rem;
}

.cl-report-followup-form textarea {
	width: 100%;
	margin-bottom: 6px;
}

.cl-report-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	align-items: center;
	margin-top: 8px;
}

.cl-report-actions form,
.cl-report-action-form,
.cl-report-delete-form {
	margin: 0;
}

.cl-report-delete-form {
	margin-top: 8px;
}

.cl-report-item.is-withdrawn,
.cl-report-item.is-closed,
.cl-report-item.is-temporarily_closed {
	background: #f8fafc;
}

@media (max-width: 782px) {
	.cl-report-layout {
		grid-template-columns: 1fr;
	}
}

.cl-survey__question textarea {
	width: 100%;
	max-width: 720px;
}

.cl-survey__option {
	display: block;
	margin: 5px 0;
	color: var(--cl-text);
}

.cl-survey__form .cl-btn {
	margin-top: 4px;
}	

.cl-library .cl-btn-block {
	width: 100%;
}

.cl-library .cl-btn-small {
	min-height: 30px;
	padding: 5px 12px;
	font-size: 0.8rem;
}

.cl-library .cl-btn:disabled,
.cl-library .cl-btn.is-busy {
	opacity: 0.6;
	cursor: wait;
	transform: none;
}

/* 提示条 */
.cl-library .cl-notice {
	margin: 0 0 18px;
	padding: 12px 16px;
	border: 1px solid transparent;
	border-radius: var(--cl-radius-sm);
	font-size: 0.94rem;
}

.cl-library .cl-notice--success {
	background: var(--cl-primary-soft);
	border-color: #bbf7d0;
	color: var(--cl-primary-dark);
}

.cl-library .cl-notice--error {
	background: var(--cl-danger-soft);
	border-color: #fecaca;
	color: var(--cl-danger);
}

/* 筛选工具栏 */
.cl-library .cl-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 0 0 16px;
	padding: 14px;
	background: var(--cl-white);
	border: 1px solid var(--cl-border);
	border-radius: var(--cl-radius);
	box-shadow: var(--cl-shadow);
}

.cl-library .cl-field {
	flex: 0 1 auto;
}

.cl-library .cl-field--search {
	flex: 1 1 260px;
}

.cl-library .cl-field input[type="search"],
.cl-library .cl-field input[type="text"],
.cl-library .cl-field select {
	width: 100%;
	min-height: 40px;
	padding: 8px 13px;
	border: 1px solid #cbd5e1;
	border-radius: var(--cl-radius-sm);
	background: #fff;
	color: var(--cl-text);
	font: inherit;
	font-size: 0.92rem;
	line-height: 1.4;
}

.cl-library .cl-field select {
	min-width: 150px;
	cursor: pointer;
}

.cl-library .cl-field input:focus,
.cl-library .cl-field select:focus {
	outline: 2px solid rgba(22, 101, 52, 0.35);
	outline-offset: 1px;
	border-color: var(--cl-primary);
}

.cl-library .cl-toolbar .cl-btn {
	flex: 0 0 auto;
}

.cl-library .cl-reset {
	font-size: 0.86rem;
	color: var(--cl-muted);
}

.cl-library .cl-catalog-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin: 0 0 12px;
	color: var(--cl-muted);
	font-size: 0.86rem;
}

.cl-library .cl-catalog-meta p {
	margin: 0;
}

/* 图书网格 */
.cl-library .cl-book-grid {
	display: grid;
	grid-template-columns: repeat(var(--cl-columns, 3), minmax(0, 1fr));
	gap: 20px;
	margin-bottom: 26px;
}

.cl-library .cl-book-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
	background: var(--cl-white);
	border: 1px solid var(--cl-border);
	border-radius: var(--cl-radius);
	box-shadow: var(--cl-shadow);
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.cl-library .cl-book-card:hover {
	transform: translateY(-3px);
	border-color: #cbd5e1;
	box-shadow: var(--cl-shadow-hover);
}

.cl-library .cl-book-cover {
	position: relative;
	display: block;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	background: var(--cl-bg);
}

.cl-library .cl-book-cover::after {
	content: "";
	position: absolute;
	inset: 0;
	box-shadow: inset 0 -26px 32px -30px rgba(15, 23, 42, 0.55);
	pointer-events: none;
}

.cl-library .cl-cover-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.cl-library .cl-book-card:hover .cl-cover-img {
	transform: scale(1.035);
}

.cl-library .cl-cover-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background:
		radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.38), transparent 34%),
		linear-gradient(145deg, #166534 0%, #14532d 55%, #0f3d22 100%);
	color: #f0fdf4;
}

.cl-library .cl-cover-placeholder span {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	border: 1px solid rgba(255, 255, 255, 0.32);
	border-radius: 50%;
	font-size: 2rem;
	font-weight: 700;
	line-height: 1;
	background: rgba(255, 255, 255, 0.1);
}

.cl-library .cl-book-body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 7px;
	padding: 16px 16px 17px;
}

.cl-library .cl-book-category {
	display: inline-block;
	align-self: flex-start;
	max-width: 100%;
	padding: 2px 8px;
	overflow: hidden;
	border-radius: 999px;
	background: #f1f5f9;
	color: var(--cl-muted);
	font-size: 0.72rem;
	line-height: 1.5;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cl-library .cl-book-category:hover {
	background: #e2e8f0;
	color: var(--cl-text);
	text-decoration: none;
}

.cl-library .cl-book-title {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	font-size: 1.02rem;
	font-weight: 700;
	line-height: 1.42;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	word-break: break-word;
}

.cl-library .cl-book-title a {
	color: var(--cl-text);
}

.cl-library .cl-book-title a:hover {
	color: var(--cl-primary);
	text-decoration: none;
}

.cl-library .cl-book-author {
	margin: 0;
	color: var(--cl-muted);
	font-size: 0.83rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cl-library .cl-availability {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 2px 0 0;
	font-size: 0.82rem;
	font-weight: 600;
	line-height: 1.4;
}

.cl-library .cl-availability .cl-dot {
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
	box-shadow: 0 0 0 3px rgba(22, 101, 52, 0.1);
}

.cl-library .cl-availability.is-available {
	color: var(--cl-primary);
}

.cl-library .cl-availability.is-out {
	color: var(--cl-danger);
}

.cl-library .cl-availability.is-out .cl-dot {
	box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.1);
}

.cl-library .cl-book-location {
	margin: 0;
	color: var(--cl-muted);
	font-size: 0.78rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cl-library .cl-book-actions {
	margin-top: auto;
	padding-top: 8px;
}

.cl-library .cl-borrow-form {
	margin: 0;
}

/* 空状态 */
.cl-library .cl-empty {
	padding: 54px 24px;
	border: 1px dashed #cbd5e1;
	border-radius: var(--cl-radius);
	background: var(--cl-white);
	text-align: center;
}

.cl-library .cl-empty__icon {
	margin-bottom: 8px;
	font-size: 2.4rem;
	line-height: 1;
}

.cl-library .cl-empty h2 {
	margin: 0 0 6px;
	font-size: 1.25rem;
}

.cl-library .cl-empty p {
	margin: 0 0 18px;
	color: var(--cl-muted);
}

/* 分页 */
.cl-library .cl-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 22px 0 4px;
}

.cl-library .cl-page-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 12px;
	border: 1px solid var(--cl-border);
	border-radius: var(--cl-radius-sm);
	background: var(--cl-white);
	color: var(--cl-text);
	font-size: 0.86rem;
	font-weight: 600;
	text-decoration: none;
}

.cl-library .cl-page-link:hover {
	border-color: var(--cl-primary);
	color: var(--cl-primary);
	text-decoration: none;
}

.cl-library .cl-page-link.is-current {
	background: var(--cl-primary);
	border-color: var(--cl-primary);
	color: #fff;
}

.cl-library .cl-page-link.is-disabled {
	color: #cbd5e1;
	cursor: not-allowed;
}

.cl-library .cl-page-gap {
	padding: 0 2px;
	color: var(--cl-muted);
}

/* 我的借阅 */
.cl-library .cl-account-summary {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin-bottom: 18px;
}

.cl-library .cl-stat {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 16px 18px;
	background: var(--cl-white);
	border: 1px solid var(--cl-border);
	border-radius: var(--cl-radius);
	box-shadow: var(--cl-shadow);
}

.cl-library .cl-stat.is-danger {
	border-color: #fecaca;
	background: #fff7f7;
}

.cl-library .cl-stat__value {
	font-size: 1.7rem;
	font-weight: 700;
	line-height: 1.15;
	color: var(--cl-primary-dark);
}

.cl-library .cl-stat.is-danger .cl-stat__value {
	color: var(--cl-danger);
}

.cl-library .cl-stat__label {
	color: var(--cl-muted);
	font-size: 0.82rem;
}

.cl-library .cl-tabs {
	display: flex;
	gap: 4px;
	margin-bottom: 14px;
	border-bottom: 1px solid var(--cl-border);
}

.cl-library .cl-tab {
	padding: 9px 16px;
	border-bottom: 2px solid transparent;
	color: var(--cl-muted);
	font-size: 0.92rem;
	font-weight: 600;
	text-decoration: none;
}

.cl-library .cl-tab:hover {
	color: var(--cl-text);
	text-decoration: none;
}

.cl-library .cl-tab.is-active {
	border-bottom-color: var(--cl-primary);
	color: var(--cl-primary);
}

/* 表格 */
.cl-library .cl-table-wrap {
	overflow-x: auto;
	background: var(--cl-white);
	border: 1px solid var(--cl-border);
	border-radius: var(--cl-radius);
	box-shadow: var(--cl-shadow);
}

.cl-library .cl-table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
	font-size: 0.88rem;
}

.cl-library .cl-table th,
.cl-library .cl-table td {
	padding: 12px 14px;
	border-bottom: 1px solid #f1f5f9;
	text-align: left;
	vertical-align: middle;
}

.cl-library .cl-table thead th {
	background: #f8fafc;
	color: var(--cl-muted);
	font-size: 0.76rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	white-space: nowrap;
}

.cl-library .cl-table tbody tr:last-child td {
	border-bottom: 0;
}

.cl-library .cl-table tbody tr:hover {
	background: #fbfdfb;
}

.cl-library .cl-table-book {
	font-weight: 600;
	color: var(--cl-text);
}

.cl-library .cl-table-book:hover {
	color: var(--cl-primary);
}

.cl-library .cl-table-actions {
	white-space: nowrap;
}

.cl-library .cl-inline-form {
	display: inline-block;
	margin: 0 3px 4px 0;
	vertical-align: middle;
}

.cl-library .cl-muted {
	color: var(--cl-muted);
	font-size: 0.82rem;
}

/* 徽标 */
.cl-library .cl-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 700;
	line-height: 1.55;
	white-space: nowrap;
}

.cl-library .cl-badge.is-active,
.cl-library .cl-badge.is-available {
	background: var(--cl-primary-soft);
	color: var(--cl-primary-dark);
}

.cl-library .cl-badge.is-warning {
	background: var(--cl-warning-soft);
	color: var(--cl-warning);
}

.cl-library .cl-badge.is-danger {
	background: var(--cl-danger-soft);
	color: var(--cl-danger);
}

.cl-library .cl-badge.is-neutral {
	background: #f1f5f9;
	color: var(--cl-muted);
}

/* 单本详情 */
.cl-library .cl-book-info {
	margin: 0 0 26px;
	padding: 20px;
	background: var(--cl-white);
	border: 1px solid var(--cl-border);
	border-radius: var(--cl-radius);
	box-shadow: var(--cl-shadow);
}

.cl-library .cl-book-info__title {
	margin: 0 0 14px;
	font-size: 1.35rem;
}

.cl-library .cl-book-info__top {
	display: flex;
	gap: 22px;
	align-items: flex-start;
}

.cl-library .cl-book-info__cover {
	flex: 0 0 150px;
	max-width: 150px;
}

.cl-library .cl-book-info__cover .cl-cover-img {
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 4;
	border-radius: var(--cl-radius-sm);
}

.cl-library .cl-book-info__main {
	flex: 1 1 auto;
	min-width: 0;
}

.cl-library .cl-book-meta {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 7px 24px;
	margin: 14px 0 18px;
}

.cl-library .cl-book-meta__row {
	display: flex;
	gap: 10px;
	min-width: 0;
	font-size: 0.88rem;
}

.cl-library .cl-book-meta dt {
	flex: 0 0 64px;
	margin: 0;
	color: var(--cl-muted);
}

.cl-library .cl-book-meta dd {
	margin: 0;
	min-width: 0;
	color: var(--cl-text);
	word-break: break-word;
}

.cl-library .cl-book-info__action {
	max-width: 240px;
	margin-top: 4px;
}

/* Toast */
.cl-toast {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 999999;
	max-width: min(380px, calc(100vw - 40px));
	padding: 12px 16px;
	border-radius: 10px;
	background: #0f172a;
	color: #fff;
	box-shadow: 0 16px 40px -12px rgba(15, 23, 42, 0.55);
	font-size: 0.9rem;
	line-height: 1.5;
	opacity: 0;
	transform: translateY(10px);
	animation: cl-toast-in 0.22s ease forwards;
}

.cl-toast.is-success {
	background: #14532d;
}

.cl-toast.is-error {
	background: #7f1d1d;
}

.cl-toast.is-hidden {
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 0.22s ease, transform 0.22s ease;
}

@keyframes cl-toast-in {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* 响应式 */
@media (max-width: 900px) {
	.cl-library .cl-book-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 14px;
	}

	.cl-library .cl-book-info__top {
		flex-direction: column;
	}

	.cl-library .cl-book-info__cover {
		flex-basis: auto;
		max-width: 120px;
	}

	.cl-library .cl-book-meta {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 640px) {
	.cl-library .cl-book-grid {
		grid-template-columns: 1fr;
	}

	.cl-library .cl-toolbar {
		padding: 12px;
	}

	.cl-library .cl-field--search,
	.cl-library .cl-field--select,
	.cl-library .cl-toolbar .cl-btn {
		flex: 1 1 100%;
	}

	.cl-library .cl-account-summary {
		grid-template-columns: 1fr;
	}

	.cl-library .cl-table-wrap {
		overflow: visible;
		background: transparent;
		border: 0;
		box-shadow: none;
	}

	.cl-library .cl-table,
	.cl-library .cl-table tbody,
	.cl-library .cl-table tr,
	.cl-library .cl-table td {
		display: block;
		width: 100%;
	}

	.cl-library .cl-table thead {
		display: none;
	}

	.cl-library .cl-table tbody tr {
		margin-bottom: 12px;
		padding: 6px 0;
		background: var(--cl-white);
		border: 1px solid var(--cl-border);
		border-radius: var(--cl-radius);
		box-shadow: var(--cl-shadow);
	}

	.cl-library .cl-table tbody tr:hover {
		background: var(--cl-white);
	}

	.cl-library .cl-table td {
		display: flex;
		justify-content: space-between;
		gap: 14px;
		padding: 8px 14px;
		border-bottom: 1px solid #f1f5f9;
		text-align: right;
	}

	.cl-library .cl-table td:last-child {
		border-bottom: 0;
	}

	.cl-library .cl-table td::before {
		content: attr(data-label);
		flex: 0 0 auto;
		color: var(--cl-muted);
		font-size: 0.76rem;
		font-weight: 700;
		text-align: left;
	}

	.cl-library .cl-table-actions {
		display: block !important;
		text-align: left;
	}

	.cl-library .cl-table-actions::before {
		display: block;
		margin-bottom: 6px;
	}

	.cl-library .cl-pagination {
		gap: 4px;
	}

	.cl-library .cl-page-link {
		min-width: 34px;
		height: 34px;
		padding: 0 9px;
	}

	.cl-toast {
		right: 12px;
		left: 12px;
		bottom: 12px;
		max-width: none;
	}
}

/* 经费模块 */
.cl-library.cl-finance {
	--cl-finance-green: #15803d;
	--cl-finance-red: #b91c1c;
}

.cl-library .cl-finance-header {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 18px;
}

.cl-library .cl-finance-title {
	margin: 0 0 2px;
	font-size: 1.4rem;
}

.cl-library .cl-finance-header p {
	margin: 0;
}

.cl-library .cl-finance-summary {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin-bottom: 18px;
}

.cl-library .cl-finance-card {
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding: 16px 18px;
	background: var(--cl-white);
	border: 1px solid var(--cl-border);
	border-radius: var(--cl-radius);
	box-shadow: var(--cl-shadow);
}

.cl-library .cl-finance-card.is-positive {
	border-color: #bbf7d0;
	background: #f0fdf4;
}

.cl-library .cl-finance-card.is-negative {
	border-color: #fecaca;
	background: #fff7f7;
}

.cl-library .cl-finance-card__label {
	color: var(--cl-muted);
	font-size: 0.8rem;
}

.cl-library .cl-finance-card__value {
	color: var(--cl-primary-dark);
	font-size: 1.55rem;
	line-height: 1.2;
	word-break: break-all;
}

.cl-library .cl-finance-card.is-negative .cl-finance-card__value {
	color: var(--cl-danger);
}

.cl-library .cl-finance-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 10px;
}

.cl-library .cl-finance-type-tabs {
	margin-bottom: 0;
	border-bottom: 0;
}

.cl-library .cl-finance-search {
	display: flex;
	gap: 6px;
	align-items: center;
}

.cl-library .cl-finance-search input[type="search"] {
	min-height: 36px;
	padding: 6px 10px;
	border: 1px solid #cbd5e1;
	border-radius: var(--cl-radius-sm);
	font: inherit;
	font-size: 0.86rem;
}

.cl-library .cl-finance-amount.income {
	color: var(--cl-finance-green);
	font-weight: 700;
}

.cl-library .cl-finance-amount.expense {
	color: var(--cl-finance-red);
	font-weight: 700;
}

.cl-library .cl-badge.is-income {
	background: var(--cl-primary-soft);
	color: var(--cl-primary-dark);
}

.cl-library .cl-badge.is-expense {
	background: var(--cl-danger-soft);
	color: var(--cl-danger);
}

.cl-library .cl-finance-apply-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
	gap: 18px;
	align-items: start;
}

.cl-library .cl-finance-form-card,
.cl-library .cl-finance-own {
	padding: 18px;
	background: var(--cl-white);
	border: 1px solid var(--cl-border);
	border-radius: var(--cl-radius);
	box-shadow: var(--cl-shadow);
}

.cl-library .cl-finance-form-card h3,
.cl-library .cl-finance-own h3 {
	margin: 0 0 4px;
	font-size: 1.08rem;
}

.cl-library .cl-finance-form-card > p {
	margin: 0 0 14px;
}

.cl-library .cl-form-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.cl-library .cl-form-field {
	display: flex;
	flex-direction: column;
	gap: 5px;
	margin: 0 0 12px;
}

.cl-library .cl-form-field label {
	font-size: 0.84rem;
	font-weight: 700;
}

.cl-library .cl-form-field input,
.cl-library .cl-form-field textarea {
	width: 100%;
	min-height: 40px;
	padding: 8px 11px;
	border: 1px solid #cbd5e1;
	border-radius: var(--cl-radius-sm);
	background: #fff;
	color: var(--cl-text);
	font: inherit;
	font-size: 0.9rem;
}

.cl-library .cl-form-field textarea {
	resize: vertical;
}

.cl-library .cl-form-field input:focus,
.cl-library .cl-form-field textarea:focus {
	outline: 2px solid rgba(22, 101, 52, 0.35);
	outline-offset: 1px;
	border-color: var(--cl-primary);
}

.cl-library .cl-form-help {
	color: var(--cl-muted);
	font-size: 0.76rem;
}

.cl-library .cl-finance-own .cl-table-wrap {
	margin-top: 10px;
}

@media (max-width: 900px) {
	.cl-library .cl-finance-apply-layout {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 640px) {
	.cl-library .cl-finance-summary {
		grid-template-columns: 1fr;
	}

	.cl-library .cl-form-grid {
		grid-template-columns: 1fr;
	}

	.cl-library .cl-finance-toolbar,
	.cl-library .cl-finance-search {
		width: 100%;
	}

	.cl-library .cl-finance-search input[type="search"] {
		flex: 1 1 auto;
	}
}

.cl-library .cl-account-nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 14px;
	margin: 0 0 12px;
	font-size: 0.84rem;
	font-weight: 600;
}

.cl-library .cl-account-nav a {
	color: var(--cl-muted);
	text-decoration: none;
}

.cl-library .cl-account-nav a:hover {
	color: var(--cl-primary);
	text-decoration: none;
}
