/* 现代化CSS变量 */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #10b981;
    --secondary-dark: #059669;
    --background: #ffffff;
    --surface: #f8fafc;
    --surface-elevated: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    max-width: 680px;
    margin: 0 auto;
    padding: 20px;
    background: var(--surface);
    color: var(--text-primary);
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

.page-header {
    text-align: center;
    margin-bottom: 20px;
    padding: 32px 24px;
    background: var(--surface-elevated);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    letter-spacing: -0.025em;
}

.page-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 8px;
}

.page-instruction {
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 500;
    background: rgba(99, 102, 241, 0.1);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(99, 102, 241, 0.2);
    display: inline-block;
    margin-top: 4px;
}

.resource-group {
    margin-bottom: 20px;
    padding: 24px;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}



/* 只在非触摸设备上启用hover效果 */
@media (hover: hover) and (pointer: fine) {
    .resource-group:hover {
        transform: translateY(-2px);
        box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 10px 10px -5px rgb(0 0 0 / 0.04);
    }
}

/* 触摸设备的点击反馈 */
@media (hover: none) and (pointer: coarse) {
    .resource-group:active {
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
        border-color: var(--primary);
    }
}

.resource-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.resource-title {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* Tag标签样式 */
.tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.tag.proxy {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.tag.no-proxy {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.tag.dual-link {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* SVG图标样式 */
.btn-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
}

.resource-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.button-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

.btn {
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    min-width: 80px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    font-weight: 500;
    font-size: 0.875rem;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

/* 只在非触摸设备上启用按钮hover效果 */
@media (hover: hover) and (pointer: fine) {
    .btn:hover::before {
        left: 100%;
    }

    .btn:hover {
        background: var(--primary-dark);
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
    }
}

.btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.copy-btn {
    padding: 12px 20px;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    flex-shrink: 0;
    min-width: 80px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    font-weight: 500;
    font-size: 0.875rem;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.copy-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

/* 只在非触摸设备上启用复制按钮hover效果 */
@media (hover: hover) and (pointer: fine) {
    .copy-btn:hover::before {
        left: 100%;
    }

    .copy-btn:hover {
        background: var(--secondary-dark);
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    }
}

.copy-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

/* 长按按钮样式 */
.long-press-btn {
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.btn-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, rgba(255,255,255,0.3), rgba(255,255,255,0.5));
    transition: width 0.1s ease;
    pointer-events: none;
    z-index: 1;
}

.long-press-btn.long-pressing .btn-progress {
    animation: longPressProgress 0.8s linear forwards;
}

.long-press-btn.long-press-complete {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

@keyframes longPressProgress {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

/* 确保按钮内容在进度条之上 */
.long-press-btn .btn-icon,
.long-press-btn span {
    position: relative;
    z-index: 2;
}

/* Toast 提示样式 */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: var(--surface-elevated);
    color: var(--text-primary);
    padding: 14px 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%) scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 420px;
    font-size: 0.8125rem;
    line-height: 1.4;
    letter-spacing: -0.01em;
    white-space: pre-line;
    backdrop-filter: blur(8px);
    word-break: keep-all;
    overflow-wrap: anywhere;
    font-weight: 600;
}

/* 移动端Toast优化 + 超小屏幕适配 */
@media (max-width: 480px) {
    .toast {
        right: 16px;
        top: 16px;
        padding: 12px 16px;
        font-size: 0.75rem;
        line-height: 1.3;
        max-width: calc(100vw - 32px);
        letter-spacing: -0.02em;
    }

    body {
        padding: 10px;
    }

    .page-title {
        font-size: 1.2em;
    }

    .resource-group {
        padding: 10px;
    }

    .btn, .copy-btn {
        padding: 10px 12px;
        font-size: 14px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 390px) {
    .toast {
        right: 12px;
        top: 12px;
        padding: 10px 14px;
        font-size: 0.7rem;
        line-height: 1.25;
        max-width: calc(100vw - 24px);
        letter-spacing: -0.025em;
    }
}

.toast.show {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.toast.success {
    border-left: 4px solid var(--secondary);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, var(--surface-elevated) 100%);
}

.toast.error {
    border-left: 4px solid #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, var(--surface-elevated) 100%);
}

.toast.info {
    border-left: 4px solid var(--primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, var(--surface-elevated) 100%);
}

/* 装饰性背景元素 */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.03) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    bottom: -50%;
    left: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.03) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

/* 移动端适配 */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    .page-title {
        font-size: 1.3em;
    }

    .page-description {
        font-size: 0.85em;
    }

    .resource-group {
        padding: 12px;
        margin-bottom: 12px;
    }

    .resource-title {
        font-size: 1em;
    }

    .resource-description {
        font-size: 0.85em;
    }

    .button-row {
        gap: 8px;
    }

    .btn, .copy-btn {
        padding: 10px 12px;
        font-size: 14px;
        min-width: 60px;
    }

    .toast {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 13px;
    }
}


