/* ================= 共享增强样式 - xiongdaa 工具集 (Enhanced) ================= */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

/* ===== 多主题系统 ===== */
:root, [data-theme="aurora"] {
    --glass-bg: rgba(15, 20, 35, 0.45);
    --glass-border: rgba(120, 200, 255, 0.15);
    --glass-shadow: 0 15px 40px rgba(0, 20, 60, 0.4);
    --glass-blur: blur(24px) saturate(160%);
    --text-main: #e8f0ff;
    --text-muted: rgba(200, 220, 255, 0.7);
    --theme-accent: #6ee7b7;
    --theme-accent2: #60a5fa;
    --theme-glow: rgba(110, 231, 183, 0.3);
    --card-radius: 24px;
    --body-bg: linear-gradient(135deg, #0a0e1a 0%, #0d1b2a 40%, #1b2838 100%);
    --overlay-bg: radial-gradient(ellipse at 30% 20%, rgba(110,231,183,0.08) 0%, transparent 50%), radial-gradient(ellipse at 70% 80%, rgba(96,165,250,0.06) 0%, transparent 50%), radial-gradient(circle at center, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.5) 100%);
    --sidebar-width: 220px;
    --grid-columns: 3;
    --grid-gap: 14px;
}

[data-theme="cyberpunk"] {
    --glass-bg: rgba(10, 0, 20, 0.6);
    --glass-border: rgba(255, 0, 128, 0.25);
    --glass-shadow: 0 0 30px rgba(255, 0, 128, 0.15), 0 15px 40px rgba(0,0,0,0.5);
    --glass-blur: blur(20px) saturate(200%);
    --text-main: #fff0f5;
    --text-muted: rgba(255, 200, 220, 0.65);
    --theme-accent: #ff2d7b;
    --theme-accent2: #00f0ff;
    --theme-glow: rgba(255, 45, 123, 0.4);
    --card-radius: 8px;
    --body-bg: linear-gradient(180deg, #0a0014 0%, #1a0028 50%, #0a0014 100%);
    --overlay-bg: radial-gradient(ellipse at 50% 0%, rgba(255,0,128,0.1) 0%, transparent 60%), radial-gradient(ellipse at 50% 100%, rgba(0,240,255,0.05) 0%, transparent 40%), radial-gradient(circle at center, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.6) 100%);
    --sidebar-width: 200px;
    --grid-columns: 2;
    --grid-gap: 12px;
}

[data-theme="ink"] {
    --glass-bg: rgba(245, 240, 230, 0.12);
    --glass-border: rgba(200, 180, 150, 0.2);
    --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    --glass-blur: blur(20px) saturate(100%);
    --text-main: #f0e8d8;
    --text-muted: rgba(220, 200, 170, 0.7);
    --theme-accent: #d4a574;
    --theme-accent2: #8fbc8f;
    --theme-glow: rgba(212, 165, 116, 0.2);
    --card-radius: 4px;
    --body-bg: linear-gradient(160deg, #1a1814 0%, #2a2520 40%, #1a1814 100%);
    --overlay-bg: radial-gradient(ellipse at 20% 30%, rgba(212,165,116,0.06) 0%, transparent 50%), radial-gradient(circle at center, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.4) 100%);
    --sidebar-width: 210px;
    --grid-columns: 2;
    --grid-gap: 16px;
}

[data-theme="galaxy"] {
    --glass-bg: rgba(10, 5, 30, 0.5);
    --glass-border: rgba(147, 130, 255, 0.18);
    --glass-shadow: 0 0 40px rgba(100, 50, 200, 0.1), 0 15px 40px rgba(0,0,0,0.5);
    --glass-blur: blur(28px) saturate(140%);
    --text-main: #e8e0ff;
    --text-muted: rgba(180, 170, 220, 0.7);
    --theme-accent: #b388ff;
    --theme-accent2: #ff80ab;
    --theme-glow: rgba(179, 136, 255, 0.3);
    --card-radius: 20px;
    --body-bg: linear-gradient(135deg, #050010 0%, #0a0520 40%, #150a30 100%);
    --overlay-bg: radial-gradient(ellipse at 60% 20%, rgba(179,136,255,0.08) 0%, transparent 50%), radial-gradient(ellipse at 30% 80%, rgba(255,128,171,0.05) 0%, transparent 50%), radial-gradient(circle at center, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.5) 100%);
    --sidebar-width: 230px;
    --grid-columns: 3;
    --grid-gap: 14px;
}

[data-theme="sakura"] {
    --glass-bg: rgba(255, 240, 245, 0.15);
    --glass-border: rgba(255, 182, 193, 0.25);
    --glass-shadow: 0 10px 30px rgba(200, 100, 130, 0.15);
    --glass-blur: blur(22px) saturate(130%);
    --text-main: #fff0f3;
    --text-muted: rgba(255, 200, 210, 0.7);
    --theme-accent: #ff9eb5;
    --theme-accent2: #ffd1dc;
    --theme-glow: rgba(255, 158, 181, 0.3);
    --card-radius: 28px;
    --body-bg: linear-gradient(135deg, #1a0a10 0%, #2a1520 40%, #1a0a10 100%);
    --overlay-bg: radial-gradient(ellipse at 40% 30%, rgba(255,158,181,0.08) 0%, transparent 50%), radial-gradient(ellipse at 70% 70%, rgba(255,209,220,0.06) 0%, transparent 50%), radial-gradient(circle at center, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.4) 100%);
    --sidebar-width: 220px;
    --grid-columns: 3;
    --grid-gap: 16px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --glass-bg: rgba(15, 15, 25, 0.55);
        --glass-border: rgba(120, 200, 255, 0.18);
        --glass-shadow: 0 15px 40px rgba(0, 20, 60, 0.5);
    }
}

:root.night-mode {
    --glass-bg: rgba(5, 5, 10, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Noto Sans SC', 'PingFang SC', sans-serif; -webkit-tap-highlight-color: transparent; }

body {
    min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center;
    background: var(--body-bg); background-attachment: fixed;
    color: var(--text-main); padding: 20px; overflow-x: hidden;
    transition: background 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--overlay-bg);
    z-index: 1; transition: background 0.8s ease;
}

/* 环境光效画布 */
#ambient-canvas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0; pointer-events: none; opacity: 0.6;
    transition: opacity 0.5s ease;
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(50px) scale(0.96); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border); border-radius: var(--card-radius);
    box-shadow: var(--glass-shadow); position: relative;
    animation: slideUpFade 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: background 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease, border-radius 0.5s ease;
}
.glass-card:hover {
    box-shadow: var(--glass-shadow), 0 0 0 1px var(--theme-accent), 0 0 30px var(--theme-glow);
}

/* 视频背景 */
#bg-video {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -999; object-fit: cover; display: none; pointer-events: none;
}
#bg-video.active { display: block; }
#bg-video[data-scale="contain"] { object-fit: contain; background: #000; }
#bg-video[data-scale="original"] { object-fit: none; width: auto; height: auto; max-width: 100%; max-height: 100%; }
#bg-video-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3); z-index: -998; pointer-events: none;
}

/* Toast 提示 */
#toast {
    position: fixed; top: -60px; left: 50%; transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15); padding: 12px 24px; border-radius: 50px;
    font-size: 0.9rem; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: top 0.4s ease; z-index: 9999; display: flex; align-items: center; gap: 10px;
}
#toast.show { top: 30px; }

/* 点击特效 */
.click-effect {
    position: fixed; pointer-events: none; z-index: 9999;
    border-radius: 50%;
    animation: clickRipple 0.6s ease-out forwards;
}
@keyframes clickRipple {
    0% { width: 0; height: 0; opacity: 0.5; border: 2px solid var(--theme-accent); }
    100% { width: 100px; height: 100px; opacity: 0; border: 2px solid transparent; }
}
.click-heart {
    position: fixed; pointer-events: none; z-index: 9999;
    font-size: 20px; color: #ff6b9d;
    animation: heartFloat 1.2s ease-out forwards;
}
@keyframes heartFloat {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-80px) scale(0.5); }
}
.click-particle {
    position: fixed; pointer-events: none; z-index: 9999;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--theme-accent);
    animation: particleExplode 0.8s ease-out forwards;
}
@keyframes particleExplode {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0); }
}

/* 夜间模式按钮激活 */
.control-btn.night-active i { color: #ffd700; }

/* 底部作者标注 */
.author-credit {
    text-align: center; padding: 15px 30px; font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    margin-top: 30px;
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    position: relative; z-index: 10;
}
.author-credit p { margin: 2px 0; }
.author-credit a {
    color: rgba(255,255,255,0.7); text-decoration: none;
    transition: color 0.3s; cursor: pointer;
}
.author-credit a:hover { color: var(--theme-accent); }

/* ===== 主题切换器 ===== */
.theme-switcher {
    position: fixed; bottom: 20px; right: 20px; z-index: 1000;
    display: flex; flex-direction: column; gap: 6px; align-items: flex-end;
}
.theme-switcher-btn {
    width: 42px; height: 42px; border-radius: 50%;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border); color: #fff;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer; transition: all 0.3s; font-size: 1rem;
}
.theme-switcher-btn:hover { background: rgba(255,255,255,0.15); transform: scale(1.1); }
.theme-panel {
    display: none; flex-direction: column; gap: 6px;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border); border-radius: 16px;
    padding: 12px; margin-bottom: 6px;
    animation: slideUpFade 0.3s ease forwards;
}
.theme-panel.show { display: flex; }
.theme-option {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 14px; border-radius: 10px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
    cursor: pointer; transition: all 0.2s; font-size: 0.78rem; color: var(--text-muted);
    white-space: nowrap;
}
.theme-option:hover { background: rgba(255,255,255,0.1); color: #fff; }
.theme-option.active { border-color: var(--theme-accent); color: var(--theme-accent); background: rgba(255,255,255,0.08); }
.theme-dot {
    width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.2);
}
.theme-dot.aurora { background: linear-gradient(135deg, #6ee7b7, #60a5fa); }
.theme-dot.cyberpunk { background: linear-gradient(135deg, #ff2d7b, #00f0ff); }
.theme-dot.ink { background: linear-gradient(135deg, #d4a574, #8fbc8f); }
.theme-dot.galaxy { background: linear-gradient(135deg, #b388ff, #ff80ab); }
.theme-dot.sakura { background: linear-gradient(135deg, #ff9eb5, #ffd1dc); }
.theme-dot.sidebar { background: linear-gradient(135deg, #ff6b6b, #48cae4); }
.theme-dot.tabbed { background: linear-gradient(135deg, #fb923c, #ec4899); }
.theme-dot.grid { background: linear-gradient(135deg, #34d399, #60a5fa); }
.theme-dot.terminal { background: linear-gradient(135deg, #4ade80, #facc15); }
.theme-dot.neon { background: linear-gradient(135deg, #ff2d7b, #facc15); }
.theme-dot.waterfall { background: linear-gradient(135deg, #38bdf8, #818cf8); }
.theme-dot.dashboard { background: linear-gradient(135deg, #22d3ee, #a78bfa); }
.theme-dot.vaporwave { background: linear-gradient(135deg, #ff6ec7, #00d4ff); }
.theme-dot.magazine { background: linear-gradient(135deg, #e84545, #c9a84c); }

/* 主题切换过渡 */
.theme-transitioning * { transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important; }

/* 返回主页按钮 - 左上角 */
.back-home-btn {
    position: fixed; top: 20px; left: 20px; z-index: 100;
    width: 45px; height: 45px; border-radius: 50%;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border); color: #fff;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer; text-decoration: none;
    transition: all 0.3s;
}
.back-home-btn:hover { background: rgba(255,255,255,0.2); transform: scale(1.1); }

/* 工具卡片容器 */
.tool-card {
    padding: 40px; width: 100%; max-width: 700px; position: relative; z-index: 10;
}
.tool-card h1 {
    font-size: 1.6rem; font-weight: 700; margin-bottom: 6px; text-align: center;
}
.tool-card .tool-subtitle {
    text-align: center; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 30px;
}

.tool-card textarea, .tool-card input[type="text"], .tool-card input[type="number"] {
    width: 100%; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
    color: #fff; padding: 12px 16px; border-radius: 12px; outline: none;
    font-size: 0.95rem; resize: vertical; transition: all 0.3s;
}
.tool-card textarea:focus, .tool-card input:focus {
    border-color: var(--theme-accent); background: rgba(255,255,255,0.12);
}
.tool-card textarea { min-height: 100px; font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace; }
.tool-card textarea::placeholder, .tool-card input::placeholder { color: rgba(255,255,255,0.35); }

.tool-btn {
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
    color: #fff; padding: 10px 20px; border-radius: 12px; cursor: pointer;
    transition: all 0.2s; font-size: 0.9rem;
}
.tool-btn:hover { background: rgba(255,255,255,0.2); border-color: var(--theme-accent); }
.tool-btn.primary { background: rgba(165,180,252,0.2); border-color: var(--theme-accent); }
.tool-btn.primary:hover { background: rgba(165,180,252,0.3); }

.tool-row { display: flex; gap: 10px; margin: 15px 0; flex-wrap: wrap; }
.tool-label {
    display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; margin-top: 15px;
}
.tool-label:first-child { margin-top: 0; }

.tool-output {
    width: 100%; min-height: 60px; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px; padding: 12px 16px; font-size: 0.9rem; color: var(--text-main);
    word-break: break-all; font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    cursor: pointer; transition: all 0.2s; position: relative;
}
.tool-output:hover { border-color: var(--theme-accent); }
.tool-output .copy-hint {
    position: absolute; top: 8px; right: 12px; font-size: 0.7rem; color: var(--text-muted);
    opacity: 0; transition: opacity 0.2s;
}
.tool-output:hover .copy-hint { opacity: 1; }

.tool-actions { display: flex; gap: 10px; margin: 15px 0; flex-wrap: wrap; }

@media (max-width: 768px) {
    body { padding: 10px; }
    .tool-card { padding: 25px; }
}

/* === 鼠标替换 - 同心圆光标 === */
/* 隐藏默认鼠标 */
* { cursor: none !important; }

/* 同心圆光标容器 */
#cursor-concentric {
    position: fixed; pointer-events: none; z-index: 999999;
    transform: translate(-50%, -50%);
    display: flex; justify-content: center; align-items: center;
    opacity: 0;
    transition: opacity 0.15s ease;
}
#cursor-concentric.active { opacity: 1; }

/* 外圈大圆 */
#cursor-concentric .outer {
    position: absolute;
    width: 100%; height: 100%;
    border-radius: 50%;
    border: 2.5px solid #a5b4fc;
    box-shadow: 0 0 12px rgba(165,180,252,0.4), inset 0 0 8px rgba(165,180,252,0.1);
    animation: cursorPulse 2s ease-in-out infinite;
}
@keyframes cursorPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.08); opacity: 1; }
}

/* 内圈小圆 */
#cursor-concentric .inner {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(165,180,252,0.7);
    box-shadow: 0 0 8px rgba(165,180,252,0.3), inset 0 0 6px rgba(165,180,252,0.15);
    animation: innerPulse 2s ease-in-out infinite;
}
@keyframes innerPulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

/* 中心光点 */
#cursor-concentric .dot {
    position: absolute;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: #a5b4fc;
    box-shadow: 0 0 10px rgba(165,180,252,0.6), 0 0 20px rgba(165,180,252,0.3);
}

/* 点击时的扩散波纹 */
#cursor-concentric.click .outer {
    animation: clickRipple 0.5s ease-out forwards !important;
}
@keyframes clickRipple {
    0% { transform: scale(1); opacity: 0.8; border-width: 2.5px; }
    100% { transform: scale(2.5); opacity: 0; border-width: 1px; }
}

/* 拖尾动画 - 扩散环 */
@keyframes trailRing {
    0% { opacity: 0.6; transform: translate(-50%, -50%) scale(0.3); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(2); }
}

/* 拖尾动画 - 小粒子 */
@keyframes trailDot {
    0% { opacity: 0.8; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--mx), var(--my)) scale(0); }
}

/* === 加载骨架屏 === */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-line {
    height: 14px; border-radius: 8px;
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
    margin-bottom: 10px;
}
.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-line.long { width: 100%; }
.skeleton-line.title { height: 24px; width: 50%; margin-bottom: 16px; }
.skeleton-line.avatar { width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 16px; }
.skeleton-line.card { height: 80px; border-radius: 16px; margin-bottom: 12px; }

/* 页面级骨架屏覆盖层 */
#skeleton-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 99999; display: flex; justify-content: center; align-items: center;
    background: rgba(15, 15, 20, 0.95);
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
#skeleton-overlay.fade-out { opacity: 0; visibility: hidden; pointer-events: none; }
.skeleton-content {
    width: 90%; max-width: 600px; padding: 40px;
}
.skeleton-spinner {
    width: 40px; height: 40px; margin: 0 auto 20px;
    border: 3px solid rgba(165,180,252,0.2);
    border-top-color: var(--theme-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton-text {
    text-align: center; color: var(--text-muted); font-size: 0.85rem;
    margin-top: 16px; opacity: 0.7;
}

/* === View Transition API 页面过渡 === */
::view-transition-old(root) {
    animation: vt-fade-out 0.3s ease forwards;
}
::view-transition-new(root) {
    animation: vt-fade-in 0.4s ease forwards;
}
@keyframes vt-fade-out {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.98); }
}
@keyframes vt-fade-in {
    from { opacity: 0; transform: scale(1.02); }
    to { opacity: 1; transform: scale(1); }
}
