:root {
	--primary-color: #6a11cb;
	--primary-dark: #2575fc;
	--secondary-color: #ff5e7d;
	--success-color: #10b981;
	--dark-bg: #0f0f1b;
	--dark-card: #18182a
}

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

body {
	font-family: Poppins,sans-serif;
	background: linear-gradient(135deg,#0f0f1b,#151531);
	color: #ecf0f1;
	min-height: 100vh;
	padding: 20px;
	display: flex;
	flex-direction: column;
	align-items: center;
	position: relative;
	overflow-x: hidden
}

header {
	text-align: center;
	margin: 20px 0 15px;
	width: 100%;
	animation: fadeDown .5s ease
}

@keyframes fadeDown {
	0% {
		opacity: 0;
		transform: translateY(-10px)
	}

	100% {
		opacity: 1;
		transform: translateY(0)
	}
}

h1 {
	font-size: 2rem;
	font-weight: 600;
	margin-bottom: 5px;
	background: linear-gradient(90deg,#6a11cb,#2575fc);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent
}

.subtitle {
	font-size: .95rem;
	color: rgba(255,255,255,.7);
	max-width: 500px;
	margin: 0 auto
}

.container {
	width: 100%;
	max-width: 800px;
	padding-top: 15px
}

.input-section {
	background: rgba(25,25,40,.8);
	border-radius: 14px;
	padding: 20px;
	margin-bottom: 25px;
	box-shadow: 0 10px 20px rgba(0,0,0,.4);
	border: 1px solid rgba(100,100,180,.15)
}

.url-input-container {
	position: relative;
	margin-bottom: 15px
}

.url-input-container input {
	width: 100%;
	padding: 14px 18px 14px 46px;
	background: rgba(15,15,30,.7);
	border: 1px solid rgba(120,120,200,.2);
	border-radius: 10px;
	color: #f5f6fa;
	font-size: .95rem;
	transition: all .25s ease
}

.url-input-container input:focus {
	outline: 0;
	border-color: rgba(106,17,203,.5);
	box-shadow: 0 0 0 3px rgba(106,17,203,.2)
}

.url-input-container i {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	color: #6d6be0;
	font-size: 1rem
}

.btn-container {
	display: flex;
	gap: 12px;
	margin-top: 12px
}

button {
	flex: 1;
	background: linear-gradient(to right,var(--primary-color),var(--primary-dark));
	color: #fff;
	border: none;
	padding: 14px 10px;
	font-size: .95rem;
	font-weight: 500;
	border-radius: 8px;
	cursor: pointer;
	transition: all .2s ease;
	position: relative;
	overflow: hidden
}

button:hover {
	transform: translateY(-2px)
}

#copyBtn {
	background: linear-gradient(to right,#00c9a7,#00d2a7)
}

button i {
	margin-right: 8px
}

.player-container {
	margin-top: 25px;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 10px 25px rgba(0,0,0,.3);
	position: relative;
	background: rgba(22,22,38,.9);
	display: none;
	border: 1px solid rgba(100,100,180,.15)
}

.player-header {
	padding: 10px 16px;
	background: rgba(30,30,50,.8);
	border-bottom: 1px solid rgba(100,100,120,.1);
	display: flex;
	justify-content: space-between;
	align-items: center
}

.player-header i, .download-video {
	margin: 0;
	font-size: .85rem;
	color: #a7a9ff;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%
}

.keyboard-hint {
	font-size: .8rem;
	color: rgba(255,255,255,.5);
	background: rgba(0,0,0,.3);
	padding: 4px 8px;
	border-radius: 4px;
	display: flex;
	align-items: center;
	gap: 5px
}

.keyboard-hint i {
	font-size: .9rem;
	color: #6d6be0
}

/* 下载和键盘提示锚点样式 */
.download-anchor, .keyboard-anchor {
	opacity: 0.6;
	transition: all 0.3s ease;
	cursor: pointer;
	color: inherit;
	text-decoration: none;
	display: flex;
	align-items: center;
	gap: 5px;
}

.download-anchor:hover, .keyboard-anchor:hover {
	opacity: 1;
}

.keyboard-anchor {
	width: 100%;
	justify-content: center;
}

.download-video {
	display: flex;
	align-items: center;
	gap: 8px;
}

.download-video a {
	display: flex;
	align-items: center;
}

.download-video span {
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
#video-container {
	width: 100%;
	padding-bottom: 56.25%;
	position: relative;
	background-color: #000
}

#video-player {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	outline: 0
}

.buffer-indicator {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%,-50%);
	display: none;
	flex-direction: column;
	align-items: center;
	color: #fff;
	z-index: 10
}

.buffer-spinner {
	width: 30px;
	height: 30px;
	border: 3px solid rgba(255,255,255,.1);
	border-top: 3px solid #5d75ff;
	border-radius: 50%;
	animation: spin 1s linear infinite
}

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

.buffer-text {
	margin-top: 8px;
	font-size: .85rem;
	color: rgba(255,255,255,.7)
}

.history-prompt {
	position: absolute;
	bottom: 40px;
	left: 20px;
	background: rgba(20,20,35,.85);
	backdrop-filter: blur(4px);
	border-radius: 6px;
	padding: 6px 10px;
	display: flex;
	align-items: center;
	gap: 10px;
	z-index: 5;
	transform: translateY(100px);
	opacity: 0;
	transition: all .3s ease;
	max-width: calc(100% - 40px);
	border: 1px solid rgba(100,100,180,.2);
	pointer-events: none;
	height: auto;
	white-space: nowrap
}

.history-prompt.show {
	transform: translateY(0);
	opacity: 1;
	pointer-events: auto
}

.prompt-text {
	font-size: .8rem;
	color: rgba(255,255,255,.9);
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis
}

.prompt-btn {
	padding: 4px 10px;
	font-size: .8rem;
	border-radius: 4px;
	flex: none;
	cursor: pointer;
	border: none;
	background: rgba(255,255,255,.1);
	color: #fff;
	transition: all .2s ease
}

.prompt-btn:hover {
	background: rgba(255,255,255,.15);
	transform: none
}

.close-btn {
	width: 24px;
	height: 24px;
	padding: 4px 0 4px 10px;
	border-radius: 4px;
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255,255,255,0);
	border: none;
	color: #fff;
	cursor: pointer;
	transition: all .2s ease
}

.close-btn:hover {
	color: rgba(255,255,255,.7);
	transform: none
}

footer {
	margin-top: 40px;
	text-align: center;
	padding: 20px;
	font-size: .8rem;
	color: rgba(255,255,255,.35);
	width: 100%
}

.copied-indicator {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%,-50%);
	background: rgba(25,25,42,.9);
	backdrop-filter: blur(5px);
	padding: 15px 30px;
	border-radius: 50px;
	display: flex;
	align-items: center;
	gap: 12px;
	box-shadow: 0 10px 25px rgba(0,0,0,.4);
	z-index: 100;
	opacity: 0;
	pointer-events: none;
	border: 1px solid rgba(100,100,180,.2)
}

.copied-indicator i {
	background: var(--success-color);
	border-radius: 50%;
	width: 26px;
	height: 26px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: .8rem;
	animation: pulse .5s ease
}

.copied-text {
	font-weight: 500;
	font-size: .95rem
}

.keyboard-help {
	position: fixed;
	bottom: 20px;
	right: 20px;
	background: rgba(25,25,42,.9);
	backdrop-filter: blur(5px);
	border-radius: 8px;
	padding: 15px;
	z-index: 5;
	transform: translateY(100px);
	opacity: 0;
	transition: all .3s ease;
	max-width: 380px;
	border: 1px solid rgba(100,100,180,.2);
	pointer-events: none
}

.keyboard-help.show {
	transform: translateY(0);
	opacity: 1;
	pointer-events: auto
}

.keyboard-help h3 {
	font-size: 1rem;
	margin-bottom: 10px;
	color: #a7a9ff;
	display: flex;
	align-items: center;
	gap: 8px
}

.keyboard-help h3 i {
	color: #6d6be0
}

.shortcuts-grid {
	display: grid;
	grid-template-columns: auto auto;
	gap: 10px
}

.shortcut-item {
	display: flex;
	align-items: center;
	gap: 8px
}

.key {
	background: rgba(125,125,125,.2);
	padding: 3px 8px;
	border-radius: 4px;
	font-size: .8rem;
	min-width: 30px;
	text-align: center
}

.keyboard-help p {
	padding: 10px 0;
	font-size: .85rem
}

.action {
	font-size: .9rem;
	color: rgba(255,255,255,.8)
}

.rate-indicator {
	position: absolute;
	top: 20px;
	right: 20px;
	background: rgba(25,25,42,.9);
	backdrop-filter: blur(5px);
	border-radius: 8px;
	padding: 8px 15px;
	z-index: 5;
	transform: translateY(-50px);
	opacity: 0;
	transition: all .3s ease;
	border: 1px solid rgba(100,100,180,.2);
	font-size: .9rem;
	color: #a7a9ff;
	display: flex;
	align-items: center;
	gap: 8px;
	pointer-events: none; /* 确保不可见时不响应鼠标事件 */
}

.rate-indicator.show {
	transform: translateY(0);
	opacity: 1;
	pointer-events: auto; /* 显示时允许鼠标事件 */
}
.rate-indicator i {
	color: #6d6be0
}

.rate-indicator.show {
	transform: translateY(0);
	opacity: 1
}

.loader {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%,-50%);
	display: none;
	flex-direction: column;
	align-items: center;
	z-index: 20
}

.loader-spinner {
	width: 40px;
	height: 40px;
	border: 4px solid rgba(255,255,255,.1);
	border-top: 4px solid #5d75ff;
	border-radius: 50%;
	animation: spin 1s linear infinite
}

.loader-text {
	margin-top: 12px;
	font-size: .9rem;
	color: rgba(255,255,255,.8)
}

.btn-loading {
	position: relative;
	overflow: hidden
}

.btn-loading::after {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg,transparent,rgba(255,255,255,.2),transparent);
	animation: loading 1.5s infinite
}

@keyframes loading {
	100% {
		left: 100%
	}
}

@keyframes pulse {
	0% {
		transform: scale(.8);
		opacity: .7
	}

	50% {
		transform: scale(1.1)
	}

	100% {
		transform: scale(1)
	}
}

@keyframes fadeInCopied {
	0% {
		opacity: 0;
		transform: translate(-50%,-40%)
	}

	20% {
		opacity: 1;
		transform: translate(-50%,-50%)
	}

	80% {
		opacity: 1;
		transform: translate(-50%,-50%)
	}

	100% {
		opacity: 0;
		transform: translate(-50%,-60%)
	}
}

@media (max-width:768px) {
	h1 {
		font-size: 1.7rem
	}

	.btn-container {
		flex-direction: column
	}

	.subtitle {
		font-size: .9rem;
		padding: 0 10px
	}

	.url-input-container input {
		padding: 12px 15px 12px 42px;
		font-size: .9rem
	}

	.history-prompt {
		gap: 8px;
		padding: 5px 10px
	}

	.player-header {
		flex-direction: column;
		gap: 8px;
		align-items: flex-start
	}

	.download-video {
		max-width: 100%
	}

	.keyboard-help {
		max-width: 280px;
		padding: 12px;
		right: 10px;
		bottom: 10px
	}

	.keyboard-hint {
		display: none
	}
}

@media (max-width:480px) {
	h1 {
		font-size: 1.5rem
	}

	.player-header {
		padding: 8px 12px
	}

	.download-video {
		font-size: .85rem
	}

	button {
		padding: 12px 10px;
		font-size: .9rem
	}

	.copied-indicator {
		padding: 12px 25px;
		border-radius: 40px
	}

	.history-prompt {
		left: 10px;
		bottom: 10px;
		max-width: calc(100% - 20px)
	}

	.prompt-text {
		font-size: .8rem
	}

	.shortcuts-grid {
		grid-template-columns: 1fr
	}

	.keyboard-help {
		max-width: calc(100% - 20px);
		right: 10px
	}

	.rate-indicator {
		top: 10px;
		right: 10px;
		font-size: .8rem;
		padding: 6px 12px
	}
}

/* 下载浮窗样式 */
.download-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.download-modal-content {
    background-color: #18182a;
    border-radius: 12px;
    width: 90%;
    max-width: 610px;
    height: 50vh; /* 修改为可视窗口的50%高度 */
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease;
}

.download-modal-header {
    padding: 15px 20px;
    background-color: rgba(30, 30, 50, 0.8);
    border-bottom: 1px solid rgba(100, 100, 120, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.download-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #a7a9ff;
}

.download-modal-body {
    flex: 1;
    overflow: hidden;
}

.download-frame-container {
    width: 100%;
    height: 100%;
    position: relative;
}

/* 下载加载指示器 */
.download-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(24, 24, 42, 0.8);
    z-index: 10;
}

.download-loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #5d75ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.download-loader-text {
    margin-top: 12px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* 响应式调整 */
@media (max-width: 768px) {
    .download-modal-content {
        width: 95%;
        height: 50vh; /* 响应式布局中也保持50%高度 */
    }
}
