/* ═══════════════════════════════════════════════════════════
   CrossShare — 渐变玻璃风（Glassmorphism）
   布局：居中单列（max 40rem），极光渐变背景 + 毛玻璃卡片
   断点：640px（紧凑移动端）
   ═══════════════════════════════════════════════════════════ */

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

/* ── 设计变量 ───────────────────────────────────────── */

:root {
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--mono: "SF Mono", "Fira Code", "Cascadia Code", monospace;
	--safe-bottom: env(safe-area-inset-bottom, 0px);
	--content-w: 40rem;
	--radius-lg: 24px;
	--radius-md: 16px;
	--radius-sm: 12px;
	--grad-primary: linear-gradient(135deg, #a78bfa 0%, #6366f1 48%, #3b82f6 100%);
	--blur: blur(22px) saturate(150%);
}

[data-theme="light"] {
	--bg: #eef2fb;
	--text: #1b2340;
	--text2: #5d6788;
	--primary: #6366f1;
	--primary-rgb: 99, 102, 241;
	--danger: #e5484d;
	--danger-hover: #f05d61;
	--success: #16a34a;
	--glass: rgba(255, 255, 255, 0.55);
	--glass-strong: rgba(255, 255, 255, 0.78);
	--glass-border: rgba(255, 255, 255, 0.75);
	--field-bg: rgba(255, 255, 255, 0.62);
	--field-border: rgba(93, 103, 136, 0.22);
	--chip-bg: rgba(255, 255, 255, 0.66);
	--panel-solid: rgba(252, 253, 255, 0.95);
	--shadow: 0 24px 60px rgba(80, 90, 160, 0.18);
	--soft-shadow: 0 10px 30px rgba(80, 90, 160, 0.12);
	--blob-a: rgba(139, 92, 246, 0.42);
	--blob-b: rgba(59, 130, 246, 0.36);
	--blob-c: rgba(236, 72, 153, 0.26);
}

[data-theme="dark"] {
	--bg: #0b1020;
	--text: #edf0ff;
	--text2: #98a2c8;
	--primary: #818cf8;
	--primary-rgb: 129, 140, 248;
	--danger: #ef5f67;
	--danger-hover: #ff7d84;
	--success: #34d399;
	--glass: rgba(21, 26, 48, 0.55);
	--glass-strong: rgba(24, 30, 56, 0.82);
	--glass-border: rgba(255, 255, 255, 0.1);
	--field-bg: rgba(9, 13, 28, 0.5);
	--field-border: rgba(255, 255, 255, 0.12);
	--chip-bg: rgba(30, 37, 68, 0.6);
	--panel-solid: rgba(20, 26, 50, 0.97);
	--shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
	--soft-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
	--blob-a: rgba(124, 58, 237, 0.4);
	--blob-b: rgba(37, 99, 235, 0.34);
	--blob-c: rgba(219, 39, 119, 0.24);
}

/* ── 基础 ───────────────────────────────────────────── */

html {
	-webkit-text-size-adjust: 100%;
	-webkit-tap-highlight-color: transparent;
	overflow-x: hidden;
}

body {
	min-height: 100vh;
	min-height: 100dvh;
	font-family: var(--font);
	background: var(--bg);
	color: var(--text);
	line-height: 1.5;
	overflow-x: clip;
	transition:
		background 0.25s ease,
		color 0.25s ease;
}

:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}

.hidden {
	display: none !important;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

::-webkit-scrollbar {
	width: 6px;
}

::-webkit-scrollbar-track {
	background: transparent;
}

::-webkit-scrollbar-thumb {
	background: rgba(var(--primary-rgb), 0.3);
	border-radius: 3px;
}

summary::-webkit-details-marker {
	display: none;
}

summary {
	list-style: none;
}

/* ── 极光背景 ───────────────────────────────────────── */

.aurora {
	position: fixed;
	inset: 0;
	z-index: -1;
	overflow: hidden;
	pointer-events: none;
}

.blob {
	position: absolute;
	width: 60vmax;
	height: 60vmax;
	border-radius: 50%;
	will-change: transform;
}

.blob-a {
	top: -22vmax;
	left: -14vmax;
	background: radial-gradient(circle at 40% 40%, var(--blob-a), transparent 68%);
	animation: blobDriftA 34s ease-in-out infinite alternate;
}

.blob-b {
	top: -10vmax;
	right: -20vmax;
	background: radial-gradient(circle at 55% 45%, var(--blob-b), transparent 68%);
	animation: blobDriftB 42s ease-in-out infinite alternate;
}

.blob-c {
	bottom: -26vmax;
	left: 18vmax;
	background: radial-gradient(circle at 50% 50%, var(--blob-c), transparent 68%);
	animation: blobDriftC 38s ease-in-out infinite alternate;
}

@keyframes blobDriftA {
	to {
		transform: translate(9vmax, 7vmax) scale(1.12);
	}
}

@keyframes blobDriftB {
	to {
		transform: translate(-8vmax, 9vmax) scale(0.92);
	}
}

@keyframes blobDriftC {
	to {
		transform: translate(-7vmax, -8vmax) scale(1.1);
	}
}

/* ── 页面骨架 ───────────────────────────────────────── */

.app-shell {
	position: relative;
	width: min(var(--content-w), 100%);
	min-height: 100vh;
	min-height: 100dvh;
	margin: 0 auto;
	padding: 1.5rem 1.25rem calc(3rem + var(--safe-bottom));
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.stage {
	display: grid;
	gap: 1.25rem;
}

/* ── 顶栏 ───────────────────────────────────────────── */

.app-header {
	position: relative;
	z-index: 30;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.brand {
	display: flex;
	align-items: center;
	gap: 0.875rem;
	color: var(--text);
	text-decoration: none;
	min-width: 0;
}

.brand img {
	width: 2.75rem;
	height: 2.75rem;
	flex-shrink: 0;
	border-radius: 14px;
	box-shadow: 0 10px 26px rgba(var(--primary-rgb), 0.35);
}

.brand h1 {
	font-size: 1.5rem;
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -0.01em;
	background: var(--grad-primary);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

.subtitle {
	margin-top: 0.2rem;
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.25;
	color: var(--text2);
}

.header-actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-shrink: 0;
}

.icon-btn {
	width: 2.5rem;
	height: 2.5rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 1px solid var(--glass-border);
	border-radius: 999px;
	background: var(--glass);
	backdrop-filter: var(--blur);
	-webkit-backdrop-filter: var(--blur);
	box-shadow: var(--soft-shadow);
	color: var(--text);
	font-size: 1rem;
	font-weight: 700;
	font-family: var(--font);
	line-height: 1;
	cursor: pointer;
	user-select: none;
	transition:
		color 0.15s,
		border-color 0.15s,
		box-shadow 0.15s,
		transform 0.15s;
	-webkit-tap-highlight-color: transparent;
}

.icon-btn:hover {
	color: var(--primary);
	border-color: rgba(var(--primary-rgb), 0.5);
	box-shadow: 0 10px 30px rgba(var(--primary-rgb), 0.25);
	transform: translateY(-1px);
}

#themeToggle {
	font-size: 1.125rem;
}

#langToggle {
	width: auto;
	min-width: 2.5rem;
	padding: 0 0.75rem;
	font-size: 0.75rem;
	letter-spacing: 0.05em;
}

/* ── 设置面板 ───────────────────────────────────────── */

.settings {
	position: absolute;
	z-index: 40;
	top: 4.75rem;
	right: 1.25rem;
	width: min(22rem, calc(100vw - 2.5rem));
	padding: 1.125rem;
	border: 1px solid var(--glass-border);
	border-radius: var(--radius-md);
	background: var(--panel-solid);
	backdrop-filter: var(--blur);
	-webkit-backdrop-filter: var(--blur);
	box-shadow: var(--shadow);
	animation: slideDown 0.2s ease;
}

.settings label {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	margin-bottom: 0.75rem;
}

.settings label span {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--text2);
}

.settings-actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}

#healthStatus {
	font-size: 0.8125rem;
	color: var(--text2);
}

/* ── 发送 / 接收 切换 ───────────────────────────────── */

.tabs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.25rem;
	width: min(20rem, 100%);
	margin: 0 auto;
	padding: 0.3rem;
	border: 1px solid var(--glass-border);
	border-radius: 999px;
	background: var(--glass);
	backdrop-filter: var(--blur);
	-webkit-backdrop-filter: var(--blur);
	box-shadow: var(--soft-shadow);
}

.tab {
	height: 2.75rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--text2);
	font-family: var(--font);
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	transition:
		color 0.15s,
		background 0.15s,
		box-shadow 0.15s;
	-webkit-tap-highlight-color: transparent;
}

.tab:hover {
	color: var(--text);
}

.tab.active {
	background: var(--grad-primary);
	color: #fff;
	box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.4);
}

.tab-content {
	display: none;
}

.tab-content.active {
	display: grid;
	gap: 1.25rem;
}

/* ── 玻璃卡片 ───────────────────────────────────────── */

.glass-card {
	position: relative;
	border: 1px solid var(--glass-border);
	border-radius: var(--radius-lg);
	background: var(--glass);
	backdrop-filter: var(--blur);
	-webkit-backdrop-filter: var(--blur);
	box-shadow: var(--shadow);
	transition:
		background 0.25s ease,
		border-color 0.25s ease;
}

.send-card,
.receive-card {
	display: grid;
	gap: 1.125rem;
	padding: 1.375rem;
}

/* ── 发送卡片收起条 ─────────────────────────────────── */

.send-card-strip {
	display: none;
	width: 100%;
	align-items: center;
	gap: 0.625rem;
	padding: 0.625rem 0.75rem;
	border: 1px solid rgba(var(--primary-rgb), 0.25);
	border-radius: var(--radius-sm);
	background: rgba(var(--primary-rgb), 0.08);
	color: var(--text);
	font-family: var(--font);
	font-size: 0.9375rem;
	text-align: left;
	cursor: pointer;
	transition:
		border-color 0.15s,
		background 0.15s;
}

.send-card-strip:hover,
.send-card-strip:focus-visible {
	border-color: rgba(var(--primary-rgb), 0.5);
	background: rgba(var(--primary-rgb), 0.14);
	outline: none;
}

.send-card-strip-icon {
	width: 1.5rem;
	height: 1.5rem;
	flex: 0 0 auto;
	border-radius: 999px;
	background: var(--grad-primary);
	box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.4);
	mask: none;
}

.send-card-strip-icon::before {
	content: "";
	display: block;
	width: 100%;
	height: 100%;
	background: #fff;
	mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M2.5 11.4 20.3 3.2c.86-.4 1.75.5 1.36 1.36l-8.2 17.8c-.38.84-1.6.76-1.87-.12l-1.9-6.05-6.05-1.9c-.88-.27-.96-1.49-.12-1.88Z'/%3E%3C/svg%3E")
		center / 0.8rem 0.8rem no-repeat;
}

.send-card-strip-text {
	min-width: 0;
	flex: 1 1 auto;
	font-weight: 700;
	line-height: 1.25;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.send-card-strip::after {
	content: "";
	width: 0.5rem;
	height: 0.5rem;
	flex: 0 0 auto;
	border-top: 2px solid var(--text2);
	border-right: 2px solid var(--text2);
	transform: rotate(45deg);
}

.send-card.collapsed {
	gap: 0;
	padding: 0.625rem;
}

.send-card.collapsed > :not(.send-card-strip) {
	display: none;
}

.send-card.collapsed .send-card-strip {
	display: flex;
}

/* ── 文本 / 文件模式切换 ────────────────────────────── */

.mode-switch {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.25rem;
	padding: 0.25rem;
	border: 1px solid var(--field-border);
	border-radius: var(--radius-sm);
	background: var(--field-bg);
}

.mode {
	height: 2.5rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	border: 0;
	border-radius: calc(var(--radius-sm) - 4px);
	background: transparent;
	color: var(--text2);
	font-family: var(--font);
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	transition:
		color 0.15s,
		background 0.15s,
		box-shadow 0.15s;
	-webkit-tap-highlight-color: transparent;
}

.mode::before {
	content: "";
	width: 1.125rem;
	height: 1.125rem;
	background: currentColor;
	mask-position: center;
	mask-repeat: no-repeat;
	mask-size: contain;
}

.mode[data-mode="text"]::before {
	mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6Zm0 2.5L17.5 8H14V4.5ZM8 12h8v2H8v-2Zm0 4h8v2H8v-2Z'/%3E%3C/svg%3E");
}

.mode[data-mode="file"]::before {
	mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M14 2H7a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3V8l-6-6Zm0 2.5L17.5 8H14V4.5ZM8 12h8v2H8v-2Zm0 4h6v2H8v-2Z'/%3E%3C/svg%3E");
}

.mode:hover {
	color: var(--text);
}

.mode.active {
	background: var(--grad-primary);
	color: #fff;
	box-shadow: 0 6px 18px rgba(var(--primary-rgb), 0.35);
}

/* ── 输入框 ─────────────────────────────────────────── */

input[type="text"],
input[type="number"],
input[type="password"],
textarea {
	width: 100%;
	max-width: 100%;
	padding: 0.75rem 0.875rem;
	background: var(--field-bg);
	border: 1px solid var(--field-border);
	border-radius: var(--radius-sm);
	color: var(--text);
	font-size: 1rem;
	font-family: var(--font);
	outline: none;
	transition:
		border-color 0.15s,
		box-shadow 0.15s,
		background 0.25s ease;
	-webkit-appearance: none;
	appearance: none;
}

input::placeholder,
textarea::placeholder {
	color: var(--text2);
	opacity: 0.75;
}

input:focus,
textarea:focus {
	border-color: rgba(var(--primary-rgb), 0.65);
	box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.16);
	outline: none;
}

/* ── 文本编辑区 ─────────────────────────────────────── */

.text-editor {
	position: relative;
}

#pushText {
	min-height: 11rem;
	padding: 1rem 1.125rem 2.25rem;
	font-size: 1rem;
	line-height: 1.7;
	resize: vertical;
}

.char-count {
	position: absolute;
	right: 0.875rem;
	bottom: 0.75rem;
	padding: 0.2rem 0.6rem;
	border-radius: 999px;
	background: rgba(var(--primary-rgb), 0.12);
	color: var(--primary);
	font-size: 0.6875rem;
	font-weight: 700;
	line-height: 1.2;
	pointer-events: none;
}

.char-count:empty {
	display: none;
}

/* ── 文件拖放区 ─────────────────────────────────────── */

.drop-zone {
	position: relative;
	min-height: 11rem;
	display: grid;
	place-items: center;
	align-content: center;
	gap: 0.5rem;
	padding: 1.5rem 1.25rem;
	border: 1.5px dashed rgba(var(--primary-rgb), 0.4);
	border-radius: var(--radius-md);
	background: rgba(var(--primary-rgb), 0.05);
	color: var(--text);
	text-align: center;
	cursor: pointer;
	transition:
		border-color 0.15s,
		background 0.15s;
}

.drop-zone:hover,
.drop-zone.dragover {
	border-color: rgba(var(--primary-rgb), 0.7);
	background: rgba(var(--primary-rgb), 0.1);
}

.drop-zone input[type="file"] {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
	font-size: 0;
}

.drop-icon {
	width: 3rem;
	height: 3rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 14px;
	background: var(--grad-primary);
	color: #fff;
	box-shadow: 0 12px 28px rgba(var(--primary-rgb), 0.4);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.drop-zone.dragover .drop-icon {
	transform: translateY(-2px) scale(1.05);
	box-shadow: 0 16px 36px rgba(var(--primary-rgb), 0.5);
}

.drop-icon svg {
	width: 1.75rem;
	height: 1.75rem;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.drop-icon-ready {
	display: none;
}

.drop-zone.has-file .drop-icon-upload {
	display: none;
}

.drop-zone.has-file .drop-icon-ready {
	display: block;
}

.drop-zone p {
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.35;
}

.drop-subtitle {
	color: var(--text2);
	font-size: 0.875rem;
	line-height: 1.35;
}

.selected-file-list {
	position: relative;
	z-index: 3;
	width: min(19rem, 100%);
	max-height: 8rem;
	display: grid;
	gap: 0.375rem;
	margin: 0.375rem 0 0;
	padding: 0;
	overflow: auto;
	list-style: none;
	text-align: left;
}

.selected-file-item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto 1.75rem;
	align-items: center;
	gap: 0.625rem;
	padding: 0.5rem 0.625rem;
	border: 1px solid var(--glass-border);
	border-radius: 10px;
	background: var(--chip-bg);
	box-shadow: var(--soft-shadow);
}

.selected-file-name {
	overflow: hidden;
	color: var(--text);
	font-size: 0.8125rem;
	font-weight: 700;
	line-height: 1.25;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.selected-file-size {
	color: var(--text2);
	font-size: 0.75rem;
	font-weight: 600;
	white-space: nowrap;
}

.selected-file-remove {
	width: 1.75rem;
	height: 1.75rem;
	display: grid;
	place-items: center;
	border: 1px solid transparent;
	border-radius: 50%;
	background: transparent;
	color: var(--text2);
	cursor: pointer;
	transition:
		background 0.15s ease,
		color 0.15s ease,
		border-color 0.15s ease;
}

.selected-file-remove:hover,
.selected-file-remove:focus-visible {
	border-color: rgba(229, 72, 77, 0.3);
	background: rgba(229, 72, 77, 0.12);
	color: var(--danger);
	outline: none;
}

.selected-file-remove svg {
	width: 0.9rem;
	height: 0.9rem;
	stroke: currentColor;
	stroke-width: 2.3;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.file-clear {
	position: absolute;
	top: 0.875rem;
	right: 0.875rem;
	z-index: 4;
	width: 1.875rem;
	height: 1.875rem;
	display: grid;
	place-items: center;
	border: 1px solid var(--glass-border);
	border-radius: 50%;
	background: var(--chip-bg);
	color: var(--text2);
	cursor: pointer;
	box-shadow: var(--soft-shadow);
	transition:
		background 0.15s ease,
		color 0.15s ease,
		border-color 0.15s ease;
}

.file-clear:hover,
.file-clear:focus-visible {
	border-color: rgba(229, 72, 77, 0.3);
	background: rgba(229, 72, 77, 0.12);
	color: var(--danger);
	outline: none;
}

.file-clear svg {
	width: 0.95rem;
	height: 0.95rem;
	stroke: currentColor;
	stroke-width: 2.25;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* ── 发送选项行 ─────────────────────────────────────── */

.options-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}

.direct-toggle {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	min-width: 0;
	color: var(--text);
	cursor: pointer;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.direct-toggle input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.toggle-track {
	width: 2.625rem;
	height: 1.5rem;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	padding: 0.1875rem;
	border: 1px solid var(--field-border);
	border-radius: 999px;
	background: var(--field-bg);
	transition:
		background 0.18s ease,
		border-color 0.18s ease,
		box-shadow 0.18s ease;
}

.toggle-thumb {
	width: 1.05rem;
	height: 1.05rem;
	border-radius: 50%;
	background: var(--text2);
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
	transition:
		background 0.18s ease,
		transform 0.18s ease;
}

.direct-toggle input:checked + .toggle-track {
	border-color: transparent;
	background: var(--grad-primary);
	box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.4);
}

.direct-toggle input:checked + .toggle-track .toggle-thumb {
	background: #fff;
	transform: translateX(1.125rem);
}

.direct-toggle input:focus-visible + .toggle-track {
	outline: 2px solid var(--primary);
	outline-offset: 0.1875rem;
}

.direct-toggle-text {
	display: block;
	min-width: 0;
}

.direct-toggle-title {
	display: block;
	font-size: 0.875rem;
	font-weight: 700;
	line-height: 1.3;
}

.direct-toggle-desc {
	display: block;
	color: var(--text2);
	font-size: 0.75rem;
	font-weight: 500;
	line-height: 1.3;
}

/* ── 更多设置（TTL） ────────────────────────────────── */

.push-more {
	position: relative;
	flex-shrink: 0;
}

.push-more > summary,
.pull-more > summary {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	width: max-content;
	padding: 0.45rem 0.875rem;
	border: 1px solid var(--field-border);
	border-radius: 999px;
	background: transparent;
	color: var(--text2);
	font-size: 0.8125rem;
	font-weight: 700;
	cursor: pointer;
	user-select: none;
	transition:
		color 0.15s,
		border-color 0.15s,
		background 0.15s;
}

.push-more > summary:hover,
.pull-more > summary:hover {
	color: var(--text);
	border-color: rgba(var(--primary-rgb), 0.45);
	background: rgba(var(--primary-rgb), 0.07);
}

.push-more > summary::after,
.pull-more > summary::after {
	content: "";
	width: 0.4rem;
	height: 0.4rem;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translateY(-0.0625rem);
	transition: transform 0.15s ease;
}

.push-more[open] > summary::after,
.pull-more[open] > summary::after {
	transform: rotate(225deg) translateY(-0.0625rem);
}

.push-more .options-row {
	width: max-content;
	margin-top: 0.5rem;
	margin-left: auto;
	padding: 0.75rem 0.875rem;
	border: 1px solid var(--field-border);
	border-radius: var(--radius-sm);
	background: var(--field-bg);
	animation: slideDown 0.15s ease;
}

.inline {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.875rem;
	color: var(--text2);
}

.inline input[type="number"] {
	width: 6rem;
	height: 2.375rem;
	padding: 0 0.5rem;
	text-align: center;
}

.unit {
	font-size: 0.875rem;
	color: var(--text2);
}

/* ── 按钮 ───────────────────────────────────────────── */

.btn {
	padding: 0.625rem 1.25rem;
	border: none;
	border-radius: var(--radius-sm);
	font-size: 0.9375rem;
	font-weight: 600;
	font-family: var(--font);
	cursor: pointer;
	transition: all 0.15s;
	white-space: nowrap;
	-webkit-tap-highlight-color: transparent;
}

.btn-hero {
	height: 3.375rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.625rem;
	border-radius: 999px;
	background: var(--grad-primary);
	color: #fff;
	font-size: 1.0625rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	line-height: 1;
	box-shadow:
		0 14px 34px rgba(var(--primary-rgb), 0.45),
		inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-hero::before {
	content: "";
	width: 1.125rem;
	height: 1.125rem;
	flex: 0 0 auto;
	background: currentColor;
	clip-path: polygon(4% 48%, 94% 6%, 66% 94%, 49% 61%, 24% 77%, 36% 55%);
}

.btn-hero:not(:disabled):hover {
	transform: translateY(-1px);
	box-shadow:
		0 18px 44px rgba(var(--primary-rgb), 0.55),
		inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-hero:not(:disabled):active {
	transform: scale(0.98);
}

.btn-hero:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.btn-primary {
	background: var(--grad-primary);
	color: #fff;
	border-radius: 999px;
	box-shadow: 0 8px 22px rgba(var(--primary-rgb), 0.4);
}

.btn-primary:not(:disabled):hover {
	transform: translateY(-1px);
	box-shadow: 0 12px 28px rgba(var(--primary-rgb), 0.5);
}

.btn-primary:active {
	transform: scale(0.97);
}

.btn-primary:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.btn-danger {
	background: var(--danger);
	color: #fff;
	border-radius: 999px;
	box-shadow: 0 8px 22px rgba(229, 72, 77, 0.35);
}

.btn-danger:hover {
	background: var(--danger-hover);
}

.btn-danger:active {
	transform: scale(0.97);
}

.btn-sm {
	min-height: 2.375rem;
	padding: 0 0.875rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--glass-border);
	border-radius: 999px;
	background: var(--chip-bg);
	color: var(--text);
	font-size: 0.8125rem;
	font-weight: 700;
	text-decoration: none;
}

.btn-sm:hover {
	border-color: rgba(var(--primary-rgb), 0.5);
	color: var(--primary);
}

.btn-ghost {
	background: transparent;
	border: 1px solid var(--field-border);
	color: var(--text2);
}

.btn-ghost:hover {
	border-color: var(--text2);
	color: var(--text);
}

/* ── 接收页 ─────────────────────────────────────────── */

.pull-control {
	display: grid;
	gap: 0.75rem;
}

.field-label {
	font-size: 0.9375rem;
	font-weight: 700;
	color: var(--text);
}

.pull-input {
	display: flex;
	gap: 0.625rem;
}

.pull-input input {
	flex: 1;
	min-width: 0;
	height: 3rem;
}

.pull-input .btn {
	flex-shrink: 0;
	min-width: 6rem;
	height: 3rem;
}

.checkbox {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.875rem;
	color: var(--text2);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.checkbox input[type="checkbox"] {
	width: 1.125rem;
	height: 1.125rem;
	flex-shrink: 0;
	accent-color: var(--primary);
}

.receive-option {
	align-items: flex-start;
}

.receive-option span {
	min-width: 0;
	display: grid;
	gap: 0.2rem;
}

.receive-option strong {
	color: var(--text);
	font-size: 0.9375rem;
	line-height: 1.25;
}

.receive-option small {
	color: var(--text2);
	font-size: 0.8125rem;
	line-height: 1.35;
}

/* ── 更多操作（清除 / 删除） ─────────────────────────── */

.pull-more {
	width: 100%;
}

.pull-actions {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-top: 0.875rem;
	padding: 0.75rem;
	border: 1px solid var(--field-border);
	border-radius: var(--radius-sm);
	background: var(--field-bg);
}

.delete-section {
	margin-top: 0.75rem;
	padding: 0.75rem;
	border: 1px solid rgba(229, 72, 77, 0.25);
	border-radius: var(--radius-sm);
	background: rgba(229, 72, 77, 0.05);
}

.delete-section .pull-input input,
.delete-section .pull-input .btn {
	height: 2.75rem;
}

/* ── 结果面板 ───────────────────────────────────────── */

.result {
	width: 100%;
	padding: 1.375rem;
	animation: slideDown 0.2s ease;
	overflow: hidden;
}

#deleteResult {
	margin-top: 0.75rem;
	padding: 0.75rem;
	border: 1px solid var(--field-border);
	border-radius: var(--radius-sm);
	background: var(--field-bg);
	box-shadow: none;
}

.result-key {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.875rem;
	gap: 0.75rem;
	min-width: 0;
}

.result-key > span {
	font-family: var(--mono);
	font-size: 1.5rem;
	font-weight: 800;
	background: var(--grad-primary);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	word-break: break-all;
	overflow-wrap: anywhere;
	min-width: 0;
}

.result-key-actions {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
	justify-content: flex-end;
	flex-shrink: 0;
	max-width: 100%;
}

.result-key-actions .btn-sm {
	flex-shrink: 0;
}

.result-meta {
	font-size: 0.875rem;
	color: var(--text2);
	line-height: 1.8;
	word-break: break-word;
	overflow-wrap: anywhere;
}

/* ── 直连状态 ───────────────────────────────────────── */

.p2p-status {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--text);
	font-size: 0.9375rem;
	line-height: 1.5;
}

.p2p-spinner {
	width: 0.875rem;
	height: 0.875rem;
	border: 2px solid rgba(var(--primary-rgb), 0.25);
	border-top-color: var(--primary);
	border-radius: 999px;
	flex-shrink: 0;
	animation: p2pSpin 0.8s linear infinite;
}

.p2p-dot {
	width: 0.5rem;
	height: 0.5rem;
	background: var(--success);
	border-radius: 999px;
	flex-shrink: 0;
	box-shadow: 0 0 8px var(--success);
}

.p2p-status-main {
	min-width: 0;
	font-weight: 600;
}

.p2p-elapsed {
	margin-left: auto;
	color: var(--text2);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.p2p-status-detail {
	margin-top: 0.875rem;
	padding: 0.75rem 0.875rem;
	background: var(--field-bg);
	border: 1px solid var(--field-border);
	border-radius: var(--radius-sm);
	color: var(--text2);
	font-family: var(--mono);
	font-size: 0.8125rem;
	line-height: 1.5;
	word-break: break-all;
	overflow-wrap: anywhere;
}

/* ── 过期倒计时 ─────────────────────────────────────── */

.countdown {
	width: max-content;
	max-width: 100%;
	margin: 0 0 0.875rem;
	padding: 0.45rem 0.875rem;
	border-radius: 999px;
	background: rgba(var(--primary-rgb), 0.12);
	color: var(--primary);
	font-size: 0.875rem;
	font-weight: 700;
	text-align: center;
	letter-spacing: 0.02em;
	font-variant-numeric: tabular-nums;
	transition: all 0.3s ease;
}

.countdown-warning {
	color: #d97706;
	background: rgba(245, 158, 11, 0.14);
}

.countdown-expired {
	color: var(--danger);
	background: rgba(229, 72, 77, 0.12);
}

/* ── 接收结果 ───────────────────────────────────────── */

.pull-text-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.625rem;
}

.pull-label {
	font-size: 0.8125rem;
	font-weight: 700;
	color: var(--text2);
}

#pullTextContent {
	background: var(--field-bg);
	border: 1px solid var(--field-border);
	padding: 0.875rem;
	border-radius: var(--radius-sm);
	font-family: var(--mono);
	font-size: 0.8125rem;
	line-height: 1.6;
	white-space: pre-wrap;
	word-break: break-all;
	max-height: 320px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	margin-bottom: 0.75rem;
	color: var(--text);
}

.file-download {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.75rem;
	gap: 0.625rem;
	min-width: 0;
}

.file-download span {
	font-family: var(--mono);
	font-size: 0.875rem;
	word-break: break-all;
	overflow-wrap: anywhere;
	min-width: 0;
}

.file-download .btn-sm {
	flex-shrink: 0;
}

/* ── 二维码弹窗 ─────────────────────────────────────── */

.modal {
	position: fixed;
	inset: 0;
	z-index: 120;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(8, 10, 24, 0.55);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.modal-panel {
	position: relative;
	width: min(100%, 360px);
	padding: 1.125rem;
	background: var(--panel-solid);
	border: 1px solid var(--glass-border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow);
	backdrop-filter: var(--blur);
	-webkit-backdrop-filter: var(--blur);
	animation: slideDown 0.2s ease;
}

.modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 0.875rem;
}

.modal-header h2 {
	font-size: 1rem;
	font-weight: 700;
}

.modal-header .icon-btn {
	width: 2.125rem;
	height: 2.125rem;
	box-shadow: none;
}

.qr-box {
	display: flex;
	justify-content: center;
	padding: 0.75rem;
	background: #fff;
	border-radius: var(--radius-sm);
}

#qrCanvas {
	display: block;
	width: 300px;
	height: 300px;
	max-width: 100%;
}

.qr-link {
	margin-top: 0.875rem;
	padding: 0.75rem;
	background: var(--field-bg);
	border: 1px solid var(--field-border);
	border-radius: var(--radius-sm);
	color: var(--text2);
	font-family: var(--mono);
	font-size: 0.75rem;
	line-height: 1.5;
	word-break: break-all;
	overflow-wrap: anywhere;
}

/* ── Toast ──────────────────────────────────────────── */

.toast {
	position: fixed;
	bottom: calc(1.5rem + var(--safe-bottom));
	left: 50%;
	transform: translateX(-50%);
	background: var(--glass-strong);
	border: 1px solid var(--glass-border);
	color: var(--text);
	padding: 0.75rem 1.25rem;
	border-radius: 999px;
	font-size: 0.875rem;
	font-weight: 600;
	z-index: 100;
	animation: toastIn 0.2s ease;
	max-width: calc(100vw - 2rem);
	text-align: center;
	box-shadow: var(--shadow);
	backdrop-filter: var(--blur);
	-webkit-backdrop-filter: var(--blur);
}

.toast.error {
	border-color: rgba(229, 72, 77, 0.5);
	color: var(--danger);
}

.toast.success {
	border-color: rgba(22, 163, 74, 0.5);
	color: var(--success);
}

/* ── 动画 ───────────────────────────────────────────── */

@keyframes slideDown {
	from {
		opacity: 0;
		transform: translateY(-8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes toastIn {
	from {
		opacity: 0;
		transform: translateX(-50%) translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateX(-50%) translateY(0);
	}
}

@keyframes p2pSpin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.blob-a,
	.blob-b,
	.blob-c {
		animation: none;
	}

	.btn-hero:not(:disabled):hover,
	.btn-primary:not(:disabled):hover,
	.icon-btn:hover {
		transform: none;
	}
}

/* ── ≤640px：紧凑移动端 ─────────────────────────────── */

@media (max-width: 640px) {
	.app-shell {
		padding: 1rem 0.875rem calc(2.5rem + var(--safe-bottom));
		gap: 1.125rem;
	}

	.brand img {
		width: 2.25rem;
		height: 2.25rem;
		border-radius: 11px;
	}

	.brand h1 {
		font-size: 1.25rem;
	}

	.subtitle {
		font-size: 0.75rem;
	}

	.icon-btn {
		width: 2.25rem;
		height: 2.25rem;
	}

	.settings {
		right: 0.875rem;
		top: 4.25rem;
	}

	.send-card,
	.receive-card {
		padding: 1.125rem;
		gap: 1rem;
	}

	#pushText {
		min-height: 9.5rem;
	}

	.options-bar {
		flex-direction: column;
		align-items: stretch;
		gap: 0.75rem;
	}

	.push-more {
		align-self: flex-end;
	}

	.pull-input {
		flex-direction: column;
	}

	.pull-input .btn {
		width: 100%;
	}

	.result {
		padding: 1.125rem;
	}

	.result-key {
		align-items: flex-start;
		flex-direction: column;
	}

	.result-key > span {
		font-size: 1.25rem;
	}

	.result-key-actions {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		width: 100%;
	}

	.result-key-actions .btn-sm {
		width: 100%;
		min-width: 0;
	}

	input[type="text"],
	input[type="number"],
	input[type="password"],
	textarea {
		font-size: 16px;
	}
}
