/*
 * Bookmarks page targeted overrides.
 * Keep future page-specific CSS adjustments here instead of adding new inline styles to routes/bookmarks/page.php.
 */

.categories-sidebar {
	position: fixed;
	left: 20px;
	top: 50%;
	transform: translateY(-50%);
	width: 230px;
	background: rgb(0 0 0 / 30%);
	backdrop-filter: blur(10px);
	border-radius: 12px;
	padding: 15px;
	max-height: 70vh;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: rgba(186, 230, 253, 0.78) rgba(255, 255, 255, 0.1);
	z-index: 100;
	transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1), padding 0.3s cubic-bezier(0.22, 1, 0.36, 1), border-radius 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s cubic-bezier(0.22, 1, 0.36, 1), transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease;
}

.categories-sidebar .categories-sidebar-inner {
	transform-origin: left center;
	transition: opacity 0.2s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), filter 0.28s ease;
}

.categories-sidebar .category-sidebar-toolbar {
	position: sticky;
	top: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 10px;
}

.categories-sidebar .category-sidebar-toggle {
	position: relative;
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	margin: 0;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(186, 230, 253, 0.1));
	backdrop-filter: blur(14px);
	box-shadow: 0 10px 20px rgba(15, 23, 42, 0.16);
	color: rgba(240, 249, 255, 0.9);
	cursor: pointer;
	overflow: hidden;
	touch-action: manipulation;
	transition: background 0.22s ease, color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.categories-sidebar .category-sidebar-toggle::before {
	content: "";
	position: absolute;
	inset: 4px;
	border-radius: inherit;
	background: radial-gradient(circle at 35% 35%, rgba(224, 242, 254, 0.38), rgba(224, 242, 254, 0));
	opacity: 0.75;
	transition: opacity 0.22s ease, transform 0.22s ease;
}

.categories-sidebar .category-sidebar-toggle::after {
	content: attr(title);
	position: absolute;
	left: calc(100% + 10px);
	top: 50%;
	padding: 8px 10px;
	border-radius: 999px;
	background: rgba(8, 47, 73, 0.92);
	border: 1px solid rgba(186, 230, 253, 0.32);
	box-shadow: 0 16px 28px rgba(15, 23, 42, 0.22);
	color: #f0f9ff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.01em;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transform: translateY(-50%) translateX(-8px) scale(0.96);
	transform-origin: left center;
	transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.categories-sidebar .category-sidebar-toggle:hover {
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(186, 230, 253, 0.18));
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 14px 26px rgba(15, 23, 42, 0.22);
}

.categories-sidebar .category-sidebar-toggle:hover::before {
	opacity: 1;
	transform: scale(1.08);
}

.categories-sidebar.is-collapsed .category-sidebar-toggle:hover::after,
.categories-sidebar.is-collapsed .category-sidebar-toggle:focus-visible::after {
	opacity: 1;
	transform: translateY(-50%) translateX(0) scale(1);
}

.categories-sidebar .category-sidebar-toggle:focus-visible {
	outline: 0;
	border-color: rgba(224, 242, 254, 0.62);
	box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.18), 0 14px 26px rgba(15, 23, 42, 0.22);
}

.categories-sidebar .category-sidebar-toggle i {
	font-size: 16px;
	position: relative;
	z-index: 1;
	transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.categories-sidebar.is-collapsed {
	width: 58px;
	padding: 10px 8px;
	border-radius: 20px;
	overflow: hidden;
	background: linear-gradient(180deg, rgba(8, 47, 73, 0.62), rgba(15, 23, 42, 0.52));
	box-shadow: 0 18px 34px rgba(15, 23, 42, 0.24);
	scrollbar-width: none;
	transform: translateY(-50%) translateX(-6px);
}

.categories-sidebar.is-collapsed:hover {
	transform: translateY(-50%) translateX(0);
}

.categories-sidebar.is-collapsed::-webkit-scrollbar {
	display: none;
}

.categories-sidebar.is-collapsed .category-sidebar-toggle {
	margin: 0 auto;
	width: 40px;
	height: 40px;
	border-color: rgba(224, 242, 254, 0.32);
	box-shadow: 0 14px 28px rgba(8, 47, 73, 0.28);
	overflow: visible;
}

.categories-sidebar.is-collapsed .category-sidebar-toolbar {
	justify-content: center;
	margin-bottom: 0;
}

.categories-sidebar.is-collapsed .category-sidebar-toggle i {
	transform: scale(1.02);
}

.categories-sidebar.is-collapsed .categories-sidebar-inner {
	opacity: 0;
	pointer-events: none;
	transform: translateX(-14px) scale(0.96);
	filter: blur(3px);
	height: 0;
	overflow: hidden;
	margin: 0;
}

.categories-sidebar.is-collapsed .category-search-box,
.categories-sidebar.is-collapsed .category-search-empty,
.categories-sidebar.is-collapsed .category-item {
	display: none !important;
}

.categories-sidebar::-webkit-scrollbar {
	width: 8px;
	height: 8px;
}

.categories-sidebar::-webkit-scrollbar-track {
	background: rgba(255, 255, 255, 0.08);
	border-radius: 999px;
}

.categories-sidebar::-webkit-scrollbar-thumb {
	background: linear-gradient(180deg, rgba(186, 230, 253, 0.95), rgba(125, 211, 252, 0.55));
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.18);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.categories-sidebar::-webkit-scrollbar-thumb:hover {
	background: linear-gradient(180deg, rgba(224, 242, 254, 0.98), rgba(125, 211, 252, 0.72));
}

.categories-sidebar .category-search-box {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	padding: 9px 10px;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 14px;
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(186, 230, 253, 0.08));
	backdrop-filter: blur(14px);
	box-shadow: 0 10px 22px rgba(15, 23, 42, 0.14);
	color: rgba(255, 255, 255, 0.78);
}

.categories-sidebar .category-search-icon {
	font-size: 15px;
	color: rgba(224, 242, 254, 0.82);
	flex: 0 0 auto;
}

.categories-sidebar .category-search-input {
	flex: 1;
	min-width: 0;
	border: 0;
	outline: none;
	background: transparent;
	color: #f8fafc;
	font-size: 13px;
	line-height: 1.4;
}

.categories-sidebar .category-search-input::placeholder {
	color: rgba(226, 232, 240, 0.7);
}

.categories-sidebar .category-search-clear {
	width: 24px;
	height: 24px;
	border: 0;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.12);
	color: rgba(241, 245, 249, 0.84);
	cursor: pointer;
	transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.categories-sidebar .category-search-clear:hover {
	background: rgba(255, 255, 255, 0.24);
	color: #fff;
	transform: scale(1.04);
}

.categories-sidebar .category-search-empty {
	margin: 0 0 10px;
	padding: 8px 10px;
	border-radius: 12px;
	background: rgba(15, 23, 42, 0.22);
	border: 1px dashed rgba(186, 230, 253, 0.38);
	color: rgba(224, 242, 254, 0.86);
	font-size: 12px;
	line-height: 1.4;
}

.categories-sidebar .category-item {
	position: relative;
	overflow: visible;
	margin-bottom: 7px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
	transition: background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.categories-sidebar .category-item:hover {
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(186, 230, 253, 0.14));
	border-color: rgba(186, 230, 253, 0.22);
	box-shadow: 0 10px 22px rgba(15, 23, 42, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.08);
	color: #fff;
	transform: translateX(2px);
}

.categories-sidebar .category-item.active {
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(125, 211, 252, 0.2));
	border-color: rgba(186, 230, 253, 0.42);
	box-shadow: 0 14px 28px rgba(14, 116, 144, 0.16), 0 0 0 1px rgba(186, 230, 253, 0.18) inset;
	color: #fff;
}

.categories-sidebar .category-item.is-persisted-selection {
	box-shadow: 0 14px 28px rgba(14, 116, 144, 0.16), 0 0 0 1px rgba(186, 230, 253, 0.18) inset, inset 3px 0 0 rgba(224, 242, 254, 0.5);
}

.categories-sidebar .category-item.is-persisted-selection .category-count {
	padding: 2px 7px;
	border-radius: 999px;
	background: rgba(224, 242, 254, 0.14);
	box-shadow: inset 0 0 0 1px rgba(224, 242, 254, 0.16);
}

.categories-sidebar .category-item.search-hidden {
	display: none;
}

.categories-sidebar .category-item .category-description {
	white-space: normal;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

@keyframes bookmarkCategoryDropPulse {
	0% {
		transform: translateY(-50%) translateX(0) scale(0.96);
		opacity: 0.72;
	}
	100% {
		transform: translateY(-50%) translateX(4px) scale(1.08);
		opacity: 1;
	}
}

@keyframes bookmarkCategoryDropSuccess {
	0% {
		box-shadow: 0 0 0 0 rgba(125, 211, 252, 0.55), 0 0 0 1px rgba(186, 230, 253, 0.22) inset;
		background: rgba(255, 255, 255, 0.18);
	}
	45% {
		box-shadow: 0 0 0 4px rgba(125, 211, 252, 0.2), 0 0 0 2px rgba(186, 230, 253, 0.95) inset, 0 16px 32px rgba(14, 116, 144, 0.22);
		background: linear-gradient(135deg, rgba(255, 255, 255, 0.34), rgba(125, 211, 252, 0.34));
	}
	100% {
		box-shadow: 0 0 0 0 rgba(125, 211, 252, 0), 0 0 0 1px rgba(186, 230, 253, 0.12) inset;
		background: rgba(255, 255, 255, 0.18);
	}
}

.categories-sidebar .category-item.drag-over {
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(125, 211, 252, 0.3));
	box-shadow: 0 0 0 2px rgba(186, 230, 253, 0.92) inset, 0 14px 30px rgba(14, 116, 144, 0.18);
	color: #fff;
	transform: translateX(4px);
}

.categories-sidebar .category-item.drag-over::before {
	content: "";
	position: absolute;
	left: -10px;
	top: 50%;
	width: 11px;
	height: 11px;
	border-top: 3px solid rgba(186, 230, 253, 0.96);
	border-right: 3px solid rgba(186, 230, 253, 0.96);
	border-radius: 2px;
	box-shadow: 0 0 14px rgba(125, 211, 252, 0.35);
	transform: translateY(-50%) rotate(45deg);
	animation: bookmarkCategoryDropPulse 0.78s ease-in-out infinite alternate;
	pointer-events: none;
}

.categories-sidebar .category-item.drag-over::after {
	content: attr(data-drop-label);
	position: absolute;
	right: 10px;
	top: -10px;
	max-width: calc(100% - 48px);
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba(8, 47, 73, 0.9);
	border: 1px solid rgba(186, 230, 253, 0.75);
	box-shadow: 0 10px 20px rgba(8, 47, 73, 0.22);
	color: #f0f9ff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.02em;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	pointer-events: none;
}

.categories-sidebar .category-item.drop-success {
	animation: bookmarkCategoryDropSuccess 0.95s ease-out;
	color: #fff;
}

.categories-sidebar .category-item.drop-success::after {
	content: "✓";
	position: absolute;
	right: 10px;
	top: 50%;
	width: 18px;
	height: 18px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	background: rgba(8, 47, 73, 0.88);
	border: 1px solid rgba(186, 230, 253, 0.82);
	box-shadow: 0 8px 18px rgba(8, 47, 73, 0.2);
	color: #e0f2fe;
	font-size: 11px;
	font-weight: 800;
	line-height: 1;
	transform: translateY(-50%);
	pointer-events: none;
}

@media (max-width: 1024px) {
	.categories-sidebar {
		position: fixed;
		left: 10px;
		width: 180px;
		padding: 12px;
	}

	.categories-sidebar .category-sidebar-toolbar {
		gap: 8px;
	}
}

@media (max-width: 768px) {
	.categories-sidebar {
		position: fixed;
		left: 0;
		right: 0;
		top: auto;
		bottom: 80px;
		transform: none;
		width: auto;
		margin: 0 10px;
		max-height: none;
		display: flex;
		overflow-x: auto;
		overflow-y: hidden;
		gap: 8px;
		padding: 10px;
		border-radius: 20px;
	}

	.categories-sidebar .category-sidebar-toolbar {
		gap: 8px;
	}

	.categories-sidebar.is-collapsed {
		left: 10px;
		right: auto;
		bottom: 86px;
		width: 66px;
		margin: 0;
		border-radius: 20px;
		transform: none;
	}

	.categories-sidebar.is-collapsed:hover {
		transform: translateY(-2px);
	}

	.categories-sidebar.is-collapsed .category-sidebar-toggle {
		width: 44px;
		height: 44px;
	}

	.categories-sidebar.is-collapsed .category-sidebar-toolbar {
		justify-content: center;
	}

	.categories-sidebar .category-sidebar-toggle::after {
		display: none;
	}

	.categories-sidebar .category-search-box {
		min-width: 0;
	}

	.categories-sidebar .category-search-empty {
		min-width: 160px;
		margin: 0;
	}

	.categories-sidebar::-webkit-scrollbar {
		width: 6px;
		height: 6px;
	}
}

.bookmark-note-modal.bookmark-note-detail-modal > .bookmark-note-modal-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 38px;
	height: 38px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.82);
	border: 1px solid rgba(255, 255, 255, 0.52);
	color: #0f172a;
	box-shadow: 0 12px 24px rgba(15, 23, 42, 0.16);
	z-index: 3;
}

.bookmark-note-modal.bookmark-note-detail-modal > .bookmark-note-modal-close:hover {
	background: rgba(255, 255, 255, 0.96);
	color: #1d4ed8;
}

.bookmark-note-modal.bookmark-note-detail-modal {
	width: min(760px, calc(100vw - 20px));
	color: var(--note-detail-ink, #0f172a);
	background: transparent;
	box-shadow: none;
	padding: 0;
}

.bookmark-note-detail-paper {
	--note-bg: #FFE08A;
	--note-bg-soft: rgb(255, 245, 203);
	--note-ink: #2B2118;
	--note-muted: rgba(67, 56, 45, 0.74);
	--note-line: rgba(107, 79, 52, 0.24);
	--note-pin: #A16207;
	--note-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
	--note-font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
	--note-title-size: 18px;
	--note-body-size: 14px;
	--note-title-line-height: 1.35;
	--note-title-weight: 700;
	--note-title-letter-spacing: 0px;
	--note-body-letter-spacing: 0px;
	--note-body-paragraph-spacing: 0.45em;
	--note-detail-title-size: 28px;
	--note-detail-body-size: 15px;
	--note-content-width: 100%;
	--note-card-padding: 16px;
	position: relative;
	border-radius: 24px 24px 22px 22px;
	padding: calc(var(--note-card-padding, 16px) + 8px) calc(var(--note-card-padding, 16px) + 6px) calc(var(--note-card-padding, 16px) + 4px);
	background:
		linear-gradient(180deg, rgba(255,255,255,0.2), transparent 24%),
		linear-gradient(135deg, var(--note-bg-soft), var(--note-bg));
	border: 1px solid var(--note-line);
	box-shadow: var(--note-shadow);
	color: var(--note-ink);
	font-family: var(--note-font);
	overflow: hidden;
}

.bookmark-note-detail-paper::before {
	content: "";
	position: absolute;
	inset: 14px 16px 16px;
	border-radius: 16px;
	background: repeating-linear-gradient(
		180deg,
		transparent 0,
		transparent 30px,
		rgba(255, 255, 255, 0.16) 30px,
		rgba(255, 255, 255, 0.16) 31px
	);
	pointer-events: none;
}

.bookmark-note-detail-pin,
.bookmark-note-detail-head,
.bookmark-note-detail-grid,
.bookmark-note-detail-modal h3 {
	position: relative;
	z-index: 1;
}

.bookmark-note-detail-pin {
	top: 12px;
}

.bookmark-note-detail-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin: 6px 42px 12px 0;
}

.bookmark-note-modal.bookmark-note-detail-modal h3 {
	margin: 0 34px 14px 0;
	color: var(--note-ink);
	font-size: var(--note-detail-title-size, 28px);
	line-height: var(--note-title-line-height, 1.3);
	font-weight: var(--note-title-weight, 800);
	letter-spacing: var(--note-title-letter-spacing, 0px);
	max-width: var(--note-content-width, 100%);
}

.bookmark-note-detail-shell {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: minmax(0, 1.45fr) minmax(250px, 0.9fr);
	gap: 16px;
	align-items: start;
}

.bookmark-note-detail-main,
.bookmark-note-detail-side {
	display: grid;
	gap: 14px;
}

.bookmark-note-detail-main {
	width: min(100%, var(--note-content-width, 100%));
}

.bookmark-note-detail-content-card {
	min-height: 100%;
}

.bookmark-note-detail-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
}

.bookmark-note-detail-item {
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 16px;
	background: rgba(255, 255, 255, 0.36);
	padding: 12px 14px;
	backdrop-filter: blur(10px);
}

.bookmark-note-detail-label {
	font-size: 12px;
	color: var(--note-detail-muted, #64748b);
	margin-bottom: 4px;
	font-weight: 700;
}

.bookmark-note-detail-value {
	color: var(--note-detail-ink, #0f172a);
	font-size: 14px;
	line-height: 1.6;
	word-break: break-word;
	font-family: var(--note-detail-font, inherit);
}

.bookmark-note-detail-body {
	min-height: 220px;
	max-height: 56vh;
	overflow-y: auto;
	background: rgba(255, 255, 255, 0.68);
	border: 1px solid var(--note-detail-line, #dbe3ee);
	border-radius: 14px;
	padding: 14px 16px;
	line-height: var(--note-detail-body-line-height, 1.9);
	font-size: var(--note-detail-body-size, 15px);
	letter-spacing: var(--note-body-letter-spacing, 0px);
}

.bookmark-note-detail-body p {
	margin: 0;
}

.bookmark-note-detail-body p + p {
	margin-top: var(--note-body-paragraph-spacing, 0.45em);
}

.bookmark-note-detail-actions {
	position: relative;
	z-index: 1;
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 16px;
	overflow: visible;
	padding: 0;
}

.bookmark-note-detail-btn {
	height: 40px;
	border-radius: 999px;
	border: none;
	padding: 0 16px;
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	gap: 8px;
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	cursor: pointer;
}

.bookmark-note-detail-btn.secondary {
	background: rgba(255, 255, 255, 0.54);
	color: var(--note-ink);
	border: 1px solid rgba(255, 255, 255, 0.34);
}

.bookmark-note-detail-btn.primary {
	background: #2563eb;
	color: #fff;
	box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.bookmark-note-detail-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	box-shadow: none;
}

.bookmark-note-detail-value.is-empty {
	color: var(--note-detail-muted, #64748b);
}

@media (max-width: 767.98px) {
	.bookmark-note-detail-actions {
		flex-direction: column;
	}

	.bookmark-note-detail-btn {
		width: 100%;
		justify-content: center;
	}

	.bookmark-note-modal.bookmark-note-detail-modal {
		width: min(100%, calc(100vw - 16px));
	}

	.bookmark-note-detail-head {
		display: block;
		margin-right: 32px;
	}

	.bookmark-note-detail-shell {
		grid-template-columns: 1fr;
	}

		.bookmark-note-modal.bookmark-note-detail-modal h3 {
		font-size: 22px;
	}

	.bookmark-note-detail-body {
		min-height: 180px;
		max-height: 50vh;
	}
}
