:root {
	--bg: #0f1115;
	--panel: #151823;
	--text: #e6e9ef;
	--muted: #a6adbb;
	--primary: #6ea8fe;
	--primary-hover: #5b9bfe;
	--secondary: #2a2f3f;
	--accent: #7ee787;
	--danger: #ff6b6b;
	--border: #222634;
	--shadow: 0 10px 30px rgba(0,0,0,0.4);
	--glow: 0 0 0 1px rgba(255,255,255,0.03), 0 10px 30px rgba(0,0,0,0.5);
}

* {
	box-sizing: border-box;
}

html, body {
	margin: 0;
	padding: 0;
	background: radial-gradient(1200px 800px at 10% 10%, #121624, var(--bg));
	color: var(--text);
	font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
	min-height: 100vh;
	position: relative;
	overflow-x: hidden;
}

.bg-canvas {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
}

.app-header {
	padding: 16px 20px;
	border-bottom: 1px solid var(--border);
	background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
	backdrop-filter: blur(6px);
	position: sticky;
	top: 0;
	z-index: 10;
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.app-header h1 {
	margin: 0;
	font-size: 20px;
	letter-spacing: 0.5px;
}

.panel-toggle {
	position: fixed;
	right: 24px;
	top: 24px;
	width: 50px;
	height: 50px;
	border-radius: 999px;
	border: 1px solid rgba(110,168,254,0.45);
	background: radial-gradient(circle at 30% 30%, rgba(183,148,255,0.6), rgba(110,168,254,0.35), rgba(12,18,32,0.9));
	color: #f5f7ff;
	font-size: 22px;
	line-height: 1;
	display: grid;
	place-items: center;
	box-shadow: 0 16px 40px rgba(0,0,0,0.45);
	z-index: 60;
	cursor: pointer;
	backdrop-filter: blur(10px);
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease, opacity 0.3s ease;
}

.panel-toggle:hover {
	transform: translateY(-2px) scale(1.02);
	box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.panel-toggle:active {
	transform: translateY(1px) scale(0.98);
}

.panel-toggle:focus-visible {
	outline: 2px solid rgba(126,231,135,0.8);
	outline-offset: 3px;
}

.brand-title {
	background: linear-gradient(120deg, #b2c6ff, #7ee787, #6ea8fe, #b794ff);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	font-weight: 800;
	font-size: 22px;
	background-size: 200% 200%;
	animation: titleGlow 12s linear infinite;
}

.brand-subtitle {
	margin: 4px 0 0;
	color: rgba(230,233,239,0.72);
	font-size: 13px;
	max-width: 420px;
}

.app-main {
	max-width: 980px;
	margin: 20px auto 40px;
	padding: 0 16px;
	display: grid;
	gap: 16px;
	position: relative;
	z-index: 5;
	transition: opacity 0.3s ease, transform 0.3s ease;
}

body.interface-collapsed .app-header,
body.interface-collapsed .app-main {
	opacity: 0;
	transform: translateY(-24px);
	pointer-events: none;
}

body.interface-collapsed .app-main {
	transform: translateY(-20px) scale(0.98);
}

body.interface-collapsed .panel-toggle {
	background: radial-gradient(circle at 50% 40%, rgba(248,244,199,0.9), rgba(189,215,255,0.35), rgba(13,18,28,0.85));
	box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}

.panel {
	background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 16px;
	box-shadow: var(--glow);
	position: relative;
	overflow: hidden;
	transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.panel:hover {
	transform: translateY(-1px);
	box-shadow: 0 12px 36px rgba(0,0,0,0.5);
}

.panel::before {
	content: "";
	position: absolute;
	inset: -40% -60%;
	background: radial-gradient(ellipse at center, rgba(126,231,135,0.12), transparent 60%);
	opacity: 0.8;
	transform: rotate(8deg);
	pointer-events: none;
	transition: transform 0.6s ease, opacity 0.6s ease;
}

.panel:hover::before {
	transform: rotate(0deg);
	opacity: 1;
}

.field {
	display: grid;
	gap: 8px;
	margin-bottom: 12px;
}

label {
	color: var(--muted);
	font-size: 14px;
}

input[type="date"],
input[type="number"],
select,
textarea {
	background: var(--panel);
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 10px 12px;
	outline: none;
	width: 100%;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
}

textarea {
	resize: vertical;
}

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 8px;
}

button,
.import-label {
	background: var(--primary);
	color: #0b1020;
	border: none;
	border-radius: 10px;
	padding: 10px 14px;
	cursor: pointer;
	font-weight: 600;
	transition: transform 0.02s ease-in, background 0.15s ease;
	box-shadow: 0 6px 16px rgba(110,168,254,0.25);
	user-select: none;
	position: relative;
	overflow: hidden;
	background: linear-gradient(140deg, rgba(110,168,254,0.95), rgba(126,231,135,0.95), rgba(183,148,255,0.95));
	background-size: 200% 200%;
	animation: buttonGradient 8s ease infinite;
	isolation: isolate;
}

button.secondary,
.import-label.secondary {
	background: var(--secondary);
	color: var(--text);
	box-shadow: none;
	border: 1px solid var(--border);
	animation: none;
}

button:hover { transform: translateY(-1px); }
button.secondary:hover, .import-label.secondary:hover { background: #353b52; }
button:active, .import-label:active { transform: translateY(1px); }

.import-label {
	display: inline-flex;
	align-items: center;
}

button::after,
.import-label::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(120deg, rgba(255,255,255,0.25), rgba(255,255,255,0.02));
	mix-blend-mode: screen;
	opacity: 0;
	transform: translateX(-30%);
	transition: opacity 0.2s ease, transform 0.4s ease;
	z-index: -1;
}

button:hover::after,
.import-label:hover::after {
	opacity: 0.4;
	transform: translateX(0);
}

.hidden { display: none; }

.time-target {
	font-size: 14px;
	color: var(--accent);
	margin-bottom: 8px;
}

.question {
	font-size: 18px;
	line-height: 1.6;
	margin: 8px 0 8px;
}

.timeline {
	position: relative;
	display: grid;
	gap: 14px;
	padding-left: 22px; /* 为竖线与节点留白 */
}

.user-section {
	position: relative;
	padding-left: 12px;
	display: grid;
	gap: 12px;
}

.user-section + .user-section {
	margin-top: 18px;
}

.user-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 6px 10px;
	border-left: 3px solid rgba(110,168,254,0.45);
	background: rgba(12,14,24,0.4);
	border-radius: 10px;
}

.user-name {
	font-weight: 700;
	font-size: 15px;
}

.user-tag {
	font-size: 12px;
	padding: 2px 8px;
	border-radius: 999px;
	background: rgba(126,231,135,0.12);
	color: #9af0bd;
	border: 1px solid rgba(126,231,135,0.4);
}

.user-header .user-tag.other {
	background: rgba(110,168,254,0.12);
	color: #b9cfff;
	border: 1px solid rgba(110,168,254,0.4);
}

.timeline::before {
	content: "";
	position: absolute;
	left: 10px;
	top: 0;
	bottom: 0;
	width: 2px;
	background: linear-gradient(180deg, rgba(110,168,254,0.4), rgba(126,231,135,0.4));
}

.item {
	display: grid;
	gap: 6px;
	background: rgba(255,255,255,0.02);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 12px;
	position: relative;
	transition: transform 0.12s ease, border-color 0.2s ease, background 0.2s ease;
}

.item::before {
	content: "";
	position: absolute;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	left: -18px;
	top: 16px;
	background: #b2c6ff;
	box-shadow: 0 0 0 3px rgba(110,168,254,0.25);
	animation: nodePulse 6s ease-in-out infinite;
}

.item:hover {
	transform: translateY(-1px);
	background: rgba(255,255,255,0.03);
	border-color: #2b3150;
}

.item-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 10px;
	flex-wrap: wrap;
}

.item-date {
	font-size: 14px;
	color: var(--muted);
}

.item-question {
	font-weight: 600;
}

.item-answer {
	white-space: pre-wrap;
	line-height: 1.6;
}

.item-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.danger {
	background: var(--danger);
	color: white;
}

.comment-toggle {
	background: rgba(47,52,70,0.8) !important;
	color: var(--text) !important;
	border: 1px solid rgba(110,168,254,0.3) !important;
	box-shadow: none !important;
}

.comment-section {
	display: grid;
	gap: 8px;
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid rgba(34,38,52,0.8);
}

.comment-list {
	display: grid;
	gap: 8px;
}

.comment {
	background: rgba(18,22,34,0.6);
	border: 1px solid rgba(53,63,92,0.6);
	border-radius: 10px;
	padding: 8px 10px;
}

.comment-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 10px;
	font-size: 12px;
	color: var(--muted);
	margin-bottom: 4px;
}

.comment-author {
	font-weight: 600;
	color: #b9cfff;
}

.comment-time {
	font-size: 11px;
	color: rgba(166,173,187,0.6);
}

.comment-content {
	font-size: 14px;
	line-height: 1.5;
	color: var(--text);
	white-space: pre-wrap;
}

.comment-empty {
	font-size: 13px;
	color: rgba(166,173,187,0.7);
	font-style: italic;
}

.comment-form {
	display: grid;
	gap: 8px;
}

.comment-form textarea {
	min-height: 70px;
	resize: vertical;
}

/* 徽标 */
.badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 700;
	padding: 4px 8px;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: rgba(255,255,255,0.03);
	color: var(--text);
}
.badge.past {
	color: #b2c6ff;
	border-color: rgba(110,168,254,0.4);
	background: linear-gradient(120deg, rgba(110,168,254,0.25), rgba(59,130,246,0.1));
}
.badge.future {
	color: #a7f3c6;
	border-color: rgba(126,231,135,0.4);
	background: linear-gradient(120deg, rgba(126,231,135,0.25), rgba(16,185,129,0.1));
}

/* Modal comments */
.modal-comments {
	display: grid;
	gap: 8px;
	max-height: 220px;
	overflow-y: auto;
	padding-right: 4px;
}

.modal-comments .comment {
	background: rgba(20,24,36,0.7);
	border-color: rgba(59,71,102,0.6);
}

.modal-comments .comment-empty {
	color: rgba(166,173,187,0.6);
}

/* 根据类别改变时间节点颜色 */
.item[data-bucket="past"]::before {
	background: #9bb8ff;
	box-shadow: 0 0 0 3px rgba(110,168,254,0.25);
}
.item[data-bucket="future"]::before {
	background: #7ee787;
	box-shadow: 0 0 0 3px rgba(126,231,135,0.25);
}

@media (max-width: 640px) {
	.actions { gap: 8px; }
	button, .import-label { padding: 10px 12px; }
	.question { font-size: 16px; }
}

@keyframes titleGlow {
	0% { background-position: 0% 50%; text-shadow: 0 0 10px rgba(110,168,254,0.4); }
	50% { background-position: 100% 50%; text-shadow: 0 0 16px rgba(126,231,135,0.45); }
	100% { background-position: 200% 50%; text-shadow: 0 0 10px rgba(183,148,255,0.4); }
}

@keyframes buttonGradient {
	0% { background-position: 0% 50%; }
	50% { background-position: 100% 50%; }
	100% { background-position: 0% 50%; }
}

@keyframes nodePulse {
	0%, 100% { box-shadow: 0 0 0 3px rgba(110,168,254,0.25); }
	50% { box-shadow: 0 0 0 6px rgba(126,231,135,0.2); }
}

/* 弹窗样式 */
.modal {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.8);
	backdrop-filter: blur(8px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

.modal:not(.hidden) {
	opacity: 1;
	pointer-events: all;
}

.modal-content {
	background: linear-gradient(180deg, rgba(21,24,35,0.98), rgba(15,17,21,0.98));
	border: 1px solid var(--border);
	border-radius: 16px;
	max-width: 500px;
	width: 90%;
	max-height: 80vh;
	overflow-y: auto;
	box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05);
	transform: scale(0.9);
	transition: transform 0.3s ease;
}

.modal:not(.hidden) .modal-content {
	transform: scale(1);
}

.modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px 24px;
	border-bottom: 1px solid var(--border);
}

.modal-header h3 {
	margin: 0;
	font-size: 20px;
	background: linear-gradient(120deg, #b2c6ff, #7ee787);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.close-btn {
	background: none;
	border: none;
	color: var(--muted);
	font-size: 32px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	width: 32px;
	height: 32px;
	transition: color 0.2s ease, transform 0.2s ease;
	box-shadow: none;
	animation: none;
}

.close-btn:hover {
	color: var(--text);
	transform: rotate(90deg);
}

.modal-body {
	padding: 24px;
}

.star-info {
	display: grid;
	gap: 16px;
}

.info-item {
	display: grid;
	grid-template-columns: 80px 1fr;
	gap: 12px;
	align-items: start;
}

.info-item.full {
	grid-template-columns: 1fr;
}

.info-item .label {
	color: var(--muted);
	font-size: 14px;
	font-weight: 600;
}

.info-item .value {
	color: var(--text);
	font-size: 16px;
}

.question-text, .answer-text {
	color: var(--text);
	line-height: 1.6;
	padding: 12px;
	background: rgba(255,255,255,0.03);
	border-radius: 8px;
	border: 1px solid var(--border);
	white-space: pre-wrap;
}

.question-text {
	font-weight: 600;
	color: var(--accent);
}

.star-tooltip {
	position: fixed;
	min-width: 160px;
	max-width: 260px;
	background: rgba(18, 22, 34, 0.92);
	border: 1px solid rgba(110,168,254,0.4);
	box-shadow: 0 12px 30px rgba(0,0,0,0.45);
	border-radius: 10px;
	padding: 10px 12px;
	color: var(--text);
	font-size: 13px;
	line-height: 1.5;
	backdrop-filter: blur(6px);
	pointer-events: none;
	z-index: 1200;
	opacity: 1;
	transition: opacity 0.15s ease;
}

.star-tooltip.hidden {
	opacity: 0;
	visibility: hidden;
}

.star-tooltip-name {
	font-weight: 700;
	color: #b9cfff;
	margin-bottom: 6px;
}

.star-tooltip-row {
	color: var(--muted);
}

.star-tooltip-row strong {
	color: var(--text);
}

.star-tooltip-question,
.star-tooltip-answer {
	margin-top: 6px;
	font-size: 12px;
	line-height: 1.5;
	color: var(--text);
	background: rgba(255,255,255,0.04);
	border: 1px solid rgba(110,168,254,0.25);
	padding: 8px;
	border-radius: 8px;
	white-space: pre-wrap;
}

.star-tooltip-question {
	color: var(--accent);
	font-weight: 600;
}

.star-overlay {
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 40;
}

.star-hitbox {
	position: absolute;
	transform: translate(-50%, -50%);
	pointer-events: auto;
	border-radius: 50%;
	cursor: pointer;
	width: 44px;
	height: 44px;
	background: transparent;
}

.star-hitbox::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(255,255,255,0.65), rgba(255,255,255,0));
	opacity: 0;
	transition: opacity 0.18s ease;
}

.star-hitbox.past::after {
	background: radial-gradient(circle, rgba(155,184,255,0.7), rgba(155,184,255,0));
}

.star-hitbox.future::after {
	background: radial-gradient(circle, rgba(126,231,135,0.7), rgba(126,231,135,0));
}

.star-hitbox:hover::after {
	opacity: 1;
}



