:root {
    --bg: #f0f2f5;
    --surface: #ffffff;
    --surface-hover: #f8f9fa;
    --border: #e0e0e0;
    --text: #333333;
    --text-secondary: #666666;
    --accent: #1890ff;
    --accent-hover: #40a9ff;
    --accent-glow: rgba(24, 144, 255, 0.2);
    --success: #52c41a;
    --warning: #faad14;
    --danger: #ff4d4f;
    --danger-hover: #ff7875;
    --progress-bg: #e9ecef;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.2s ease;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --font-mono: 'SF Mono', 'Cascadia Code', 'Consolas', 'Monaco', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== 页头 ========== */
.site-header {
    background: #ffffff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 80px;  /* 由64px增加至80px */
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo img {
    height: 40px;
    vertical-align: middle;
}
.desktop-nav ul {
    list-style: none;
    display: flex;
    gap: 32px;
}
.desktop-nav a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    font-size: 15px;
    transition: color var(--transition);
}
.desktop-nav a:hover {
    color: var(--accent);
}
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text);
    cursor: pointer;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background var(--transition);
}
.menu-toggle:hover {
    background: rgba(0, 0, 0, 0.04);
}

/* 移动端侧边栏菜单 */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}
.sidebar-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
    z-index: 1200;
    transition: right 0.3s ease;
    padding: 24px;
    display: flex;
    flex-direction: column;
}
.sidebar-menu.show {
    right: 0;
}
.sidebar-close {
    align-self: flex-end;
    background: none;
    border: none;
    font-size: 26px;
    color: var(--text);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    margin-bottom: 24px;
    transition: background var(--transition);
}
.sidebar-close:hover {
    background: rgba(0, 0, 0, 0.04);
}
.sidebar-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.sidebar-nav a {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text);
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    transition: background var(--transition);
}
.sidebar-nav a:hover {
    background: #f5f5f5;
    color: var(--accent);
}

/* ========== 主内容区域 ========== */
.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 60px 24px 32px;  /* 顶部距离加大，之前为32px */
    display: flex;
    flex-direction: column;
    align-items: center;
}
.tool-container {
    width: 100%;
    max-width: 680px;
    background: var(--surface);
    border-radius: 20px;
    padding: 36px 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 28px;
}
.header .icon {
    font-size: 44px;
    margin-bottom: 8px;
    display: block;
    animation: float 3s ease-in-out infinite;
    color: var(--accent);
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.header h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}
.header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
.input-group input {
    flex: 1;
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    background: #fafafa;
    color: var(--text);
    font-size: 14px;
    font-family: var(--font-mono);
    transition: all var(--transition);
    outline: none;
}
.input-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
    background: #fff;
}
.input-group input::placeholder {
    color: #aaa;
    font-family: 'Inter', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 13px;
}

.btn {
    padding: 13px 24px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all var(--transition);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 12px var(--accent-glow);
}
.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: 0 6px 20px rgba(24, 144, 255, 0.35);
    transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) {
    transform: scale(0.97);
}
.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover:not(:disabled) {
    background: var(--danger-hover);
    transform: translateY(-1px);
}
.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}
.btn .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.proxy-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.proxy-row label {
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 4px;
}
.proxy-row input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.proxy-url-input {
    flex: 1;
    min-width: 180px;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #fafafa;
    color: var(--text);
    font-size: 12px;
    font-family: var(--font-mono);
    outline: none;
    transition: all var(--transition);
    display: none;
}
.proxy-url-input.show {
    display: block;
}
.proxy-url-input:focus {
    border-color: var(--accent);
    background: #fff;
}

.info-panel {
    background: #fafafa;
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    display: none;
}
.info-panel.show {
    display: block;
}
.info-panel .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
}
.info-panel .info-row + .info-row {
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}
.info-panel .info-label {
    color: var(--text-secondary);
}
.info-panel .info-value {
    font-weight: 600;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 12px;
}
.info-panel .info-value.accent {
    color: var(--accent);
}

.quality-selector {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.quality-selector.show {
    display: flex;
}
.quality-chip {
    padding: 8px 14px;
    border-radius: 20px;
    border: 2px solid var(--border);
    background: #fafafa;
    color: var(--text);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all var(--transition);
    user-select: none;
}
.quality-chip:hover {
    border-color: var(--accent);
    background: rgba(24, 144, 255, 0.04);
}
.quality-chip.active {
    border-color: var(--accent);
    background: rgba(24, 144, 255, 0.1);
    color: var(--accent);
    font-weight: 700;
}

.progress-section {
    display: none;
    margin-bottom: 16px;
}
.progress-section.show {
    display: block;
}
.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
}
.progress-percent {
    font-weight: 700;
    font-size: 18px;
    color: var(--accent);
    font-family: var(--font-mono);
}
.progress-stats {
    color: var(--text-secondary);
    font-size: 11px;
    font-family: var(--font-mono);
}
.progress-bar-outer {
    height: 8px;
    background: var(--progress-bg);
    border-radius: 10px;
    overflow: hidden;
}
.progress-bar-inner {
    height: 100%;
    background: var(--accent);
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}
.progress-detail {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.status-message {
    font-size: 13px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-top: 10px;
    display: none;
    font-weight: 500;
}
.status-message.show {
    display: block;
}
.status-message.info {
    background: rgba(24, 144, 255, 0.08);
    color: var(--accent);
    border: 1px solid rgba(24, 144, 255, 0.2);
}
.status-message.success {
    background: rgba(82, 196, 26, 0.08);
    color: var(--success);
    border: 1px solid rgba(82, 196, 26, 0.2);
}
.status-message.error {
    background: rgba(255, 77, 79, 0.08);
    color: var(--danger);
    border: 1px solid rgba(255, 77, 79, 0.2);
}
.status-message.warning {
    background: rgba(250, 173, 20, 0.08);
    color: var(--warning);
    border: 1px solid rgba(250, 173, 20, 0.2);
}

.footer-note {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 20px;
    opacity: 0.8;
}

/* ========== 页脚 ========== */
.site-footer {
    background: transparent; 
    padding: 20px 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}
.site-footer a{text-decoration:none;color: var(--text-secondary);}
/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .desktop-nav { display: none; }
    .menu-toggle { display: flex; }
    .tool-container {
        padding: 24px 16px;
        border-radius: 16px;
    }
    .input-group { flex-direction: column; gap: 8px; }
    .btn { width: 100%; justify-content: center; }
    .header h1 { font-size: 22px; }
    .proxy-row { flex-direction: column; align-items: flex-start; }
    .proxy-url-input { width: 100%; }
    .main-content { padding: 48px 16px 24px; }
}