/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --primary: #7c3aed;
    --primary-light: #a78bfa;
    --primary-dark: #5b21b6;
    --accent: #f59e0b;
    --accent-light: #fbbf24;
    --secondary: #ec4899;
    --success: #10b981;
    --bg: #0b0d17;
    --card-bg: rgba(255,255,255,0.04);
    --card-border: rgba(255,255,255,0.08);
    --card-hover-border: rgba(255,255,255,0.15);
    --text: #f1f5f9;
    --text-light: #b0b8c8;
    --text-muted: #6b7280;
    --radius: 16px;
    --max-width: 1000px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: "Inter", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; width: 100%; position: relative; z-index: 2; }

/* ===== Animated Background ===== */
.bg-canvas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    overflow: hidden; pointer-events: none; z-index: 0;
}
.bg-orb {
    position: absolute; border-radius: 50%; filter: blur(80px);
    opacity: 0.5; animation: orbFloat 20s ease-in-out infinite;
}
.bg-orb:nth-child(1) {
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(124,58,237,0.3), transparent);
    top: -200px; left: -200px; animation-delay: 0s;
}
.bg-orb:nth-child(2) {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(236,72,153,0.2), transparent);
    bottom: -150px; right: -150px; animation-delay: -7s;
}
.bg-orb:nth-child(3) {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(245,158,11,0.15), transparent);
    top: 40%; left: 60%; animation-delay: -14s;
}
@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, -50px) scale(1.1); }
    50% { transform: translate(-30px, 30px) scale(0.9); }
    75% { transform: translate(40px, 40px) scale(1.05); }
}

/* ===== Header ===== */
.header {
    background: rgba(11,13,23,0.8);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: sticky; top: 0; z-index: 100;
}
.header-inner {
    display: flex; align-items: center; gap: 12px; padding: 14px 24px; flex-wrap: wrap;
}
.logo {
    font-size: 1.2rem; font-weight: 800;
    background: linear-gradient(135deg, #a78bfa, #f472b6);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    white-space: nowrap; letter-spacing: -0.5px;
}
.logo:hover { text-decoration: none; opacity: 0.9; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; margin-left: auto; }
.nav a {
    padding: 8px 16px; border-radius: 10px; font-size: .85rem; font-weight: 500;
    color: var(--text-light); transition: all var(--transition);
}
.nav a:hover { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }
.donate-btn {
    padding: 8px 18px; border-radius: 20px; border: 1px solid rgba(245,158,11,0.3);
    background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(245,158,11,0.05));
    color: #fbbf24; font-size: .85rem; font-weight: 600;
    cursor: pointer; transition: all var(--transition);
}
.donate-btn:hover { background: rgba(245,158,11,0.2); transform: translateY(-1px); }

/* ===== Search ===== */
.search-box { text-align: center; margin: 0 auto 32px; max-width: 480px; }
.search-input {
    width: 100%; padding: 14px 20px 14px 48px;
    border-radius: 16px; border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04); color: #fff; font-size: .9rem;
    outline: none; transition: all var(--transition);
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: rgba(167,139,250,0.4); background: rgba(255,255,255,0.06); }
.search-wrap { position: relative; }
.search-wrap::before {
    content: '🔍'; position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    font-size: 1rem; z-index: 1; opacity: 0.5;
}

/* ===== Pages ===== */
.page { display: none; padding: 24px 0 60px; }
.page.active { display: block; animation: fadeIn .4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Hero ===== */
.hero { text-align: center; padding: 80px 0 32px; }
.hero-badge {
    display: inline-block; padding: 6px 20px; border-radius: 20px;
    background: rgba(124,58,237,0.15); border: 1px solid rgba(124,58,237,0.25);
    color: var(--primary-light); font-size: .8rem; font-weight: 600;
    margin-bottom: 24px; letter-spacing: 0.5px;
}
.hero h1 { font-size: 3.2rem; font-weight: 800; line-height: 1.15; margin-bottom: 16px;
    background: linear-gradient(135deg, #e2e8f0 0%, #a78bfa 40%, #f472b6 70%, #fbbf24 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    letter-spacing: -1.5px;
}
.hero-sub { color: var(--text-light); font-size: 1.05rem; max-width: 500px; margin: 0 auto; line-height: 1.7; }

/* ===== Quick Stats ===== */
.quick-stats {
    display: flex; justify-content: center; gap: 40px; margin: 28px 0 40px;
}
.quick-stat { text-align: center; }
.quick-stat-num { font-size: 1.8rem; font-weight: 800; color: #fff; }
.quick-stat-label { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }

/* ===== Category Section ===== */
.category-section { margin-bottom: 36px; }
.category-section.hidden { display: none; }
.category-header {
    display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.category-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}
.category-title { font-size: 1rem; font-weight: 600; color: #fff; }

/* ===== Tool Grid ===== */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tool-card {
    display: flex; align-items: center; gap: 14px;
    background: var(--card-bg); border-radius: var(--radius);
    padding: 18px 20px; cursor: pointer;
    transition: all var(--transition);
    border: 1px solid var(--card-border);
}
.tool-card:hover {
    background: rgba(255,255,255,0.07);
    border-color: var(--card-hover-border);
    transform: translateY(-2px);
}
.tool-card:active { transform: scale(0.98); }
.tool-card-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; flex-shrink: 0;
}
.tool-card-text h3 { font-size: .92rem; font-weight: 600; color: #fff; margin-bottom: 2px; }
.tool-card-text p { font-size: .75rem; color: var(--text-muted); }

/* ===== Tool Colors ===== */
.tc-pdf .tool-card-icon { background: rgba(239,68,68,0.2); }
.tc-merge .tool-card-icon { background: rgba(59,130,246,0.2); }
.tc-split .tool-card-icon { background: rgba(245,158,11,0.2); }
.tc-compress .tool-card-icon { background: rgba(16,185,129,0.2); }
.tc-imgcompress .tool-card-icon { background: rgba(236,72,153,0.2); }
.tc-imgconvert .tool-card-icon { background: rgba(124,58,237,0.2); }
.tc-wordcount .tool-card-icon { background: rgba(59,130,246,0.2); }
.tc-dedup .tool-card-icon { background: rgba(16,185,129,0.2); }
.tc-textdiff .tool-card-icon { background: rgba(245,158,11,0.2); }
.tc-qrcode .tool-card-icon { background: rgba(124,58,237,0.2); }
.tc-password .tool-card-icon { background: rgba(239,68,68,0.2); }
.tc-md2word .tool-card-icon { background: rgba(59,130,246,0.2); }
.tc-text2ppt .tool-card-icon { background: rgba(245,158,11,0.2); }
.tc-word2txt .tool-card-icon { background: rgba(16,185,129,0.2); }
.tc-video .tool-card-icon { background: rgba(239,68,68,0.2); }

/* ===== Tool Header ===== */
.tool-header {
    display: flex; align-items: center; gap: 16px; margin-bottom: 28px;
    padding-top: 20px;
}
.tool-header h2 { font-size: 1.3rem; font-weight: 700; }
.back-btn {
    padding: 10px 18px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04); color: var(--text-light); cursor: pointer;
    font-size: .85rem; transition: all var(--transition);
}
.back-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ===== Upload Area ===== */
.upload-area {
    border: 2px dashed rgba(255,255,255,0.1); border-radius: var(--radius);
    padding: 50px 20px; text-align: center; transition: all var(--transition);
    background: rgba(255,255,255,0.03); cursor: pointer;
}
.upload-area:hover, .upload-area.drag-over {
    border-color: rgba(167,139,250,0.4); background: rgba(124,58,237,0.06);
}
.upload-icon { font-size: 2.5rem; margin-bottom: 12px; }
.upload-area p { color: var(--text); margin-bottom: 4px; font-size: .9rem; }
.upload-hint { font-size: .8rem; color: var(--text-muted); }
.upload-btn { color: var(--primary-light); font-weight: 600; cursor: pointer; text-decoration: underline; }

/* ===== File List ===== */
.file-list { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.file-item {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255,255,255,0.04); padding: 10px 16px; border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
}
.file-item .file-icon { font-size: 1.1rem; }
.file-item .file-name { flex: 1; font-size: .85rem; word-break: break-all; color: var(--text); }
.file-item .file-size { color: var(--text-muted); font-size: .78rem; }
.file-item .file-remove {
    background: rgba(239,68,68,0.15); color: #fca5a5; border: none;
    border-radius: 50%; width: 26px; height: 26px; cursor: pointer;
    font-size: .9rem; display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
}
.file-item .file-remove:hover { background: rgba(239,68,68,0.3); }

/* ===== Tool Actions ===== */
.tool-actions { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.primary-btn {
    padding: 12px 28px; border-radius: 12px; border: none;
    background: linear-gradient(135deg, var(--primary), #6d28d9);
    color: #fff; font-size: .95rem; font-weight: 600;
    cursor: pointer; transition: all var(--transition);
    display: inline-flex; align-items: center; gap: 6px;
}
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(124,58,237,0.3); }
.primary-btn:disabled { opacity: .35; cursor: not-allowed; transform: none; box-shadow: none; }
.small-btn {
    padding: 8px 16px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04); color: var(--text-light); cursor: pointer;
    font-size: .82rem; transition: all var(--transition);
}
.small-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.sort-controls { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--text-light); }

/* ===== Progress ===== */
.progress-bar { margin-top: 16px; height: 4px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 2px; transition: width .3s; }

/* ===== Modal ===== */
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.65); z-index: 999; backdrop-filter: blur(12px);
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn .2s ease;
}
.modal-content {
    background: #1a1c2e; border-radius: var(--radius);
    padding: 36px; max-width: 460px; width: 90%; position: relative;
    text-align: center; border: 1px solid rgba(255,255,255,0.08);
}
.modal h2 { font-size: 1.3rem; margin-bottom: 8px; }
.close-btn { position: absolute; top: 12px; right: 16px; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); transition: all var(--transition); }
.close-btn:hover { color: #fff; }
.qrcode-grid { display: flex; gap: 24px; justify-content: center; margin: 20px 0; flex-wrap: wrap; }
.qrcode-item { text-align: center; }
.qrcode-item p { font-weight: 600; margin-bottom: 8px; color: var(--text-light); font-size: .85rem; }
.donate-note { color: var(--text-muted); margin-top: 4px; font-size: .85rem; }

/* ===== Split Options ===== */
.split-options { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.split-options select, .text-input {
    padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04); color: var(--text); font-size: .88rem; outline: none;
}
.split-options select:focus, .text-input:focus { border-color: rgba(167,139,250,0.4); }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: .85rem; cursor: pointer; color: var(--text-light); }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

/* ===== Text Large Textarea ===== */
.text-input-large {
    width: 100%; min-height: 180px; padding: 16px; border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08); font-size: .9rem; font-family: inherit;
    resize: vertical; line-height: 1.6; margin-top: 8px;
    background: rgba(255,255,255,0.03); color: var(--text);
    transition: all var(--transition);
}
.text-input-large:focus { outline: none; border-color: rgba(167,139,250,0.3); background: rgba(255,255,255,0.05); }
.text-input-large::placeholder { color: var(--text-muted); }
.text-input-large[readonly] { opacity: .6; }

/* ===== Stats Box ===== */
.stats-box { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; justify-content: center; }
.stat-item {
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px; padding: 16px 22px; text-align: center; min-width: 80px;
}
.stat-num { display: block; font-size: 1.8rem; font-weight: 800; background: linear-gradient(135deg, var(--primary-light), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 2px; }

/* ===== Diff ===== */
.diff-container { display: flex; flex-wrap: wrap; gap: 14px; }
.diff-col { flex: 1; min-width: 240px; }
.diff-col h3 { font-size: .85rem; margin-bottom: 6px; color: var(--text-muted); font-weight: 600; }
.diff-col-full { flex: 0 0 100%; }
.diff-output {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px;
    padding: 16px; min-height: 60px; font-size: .85rem; line-height: 1.6; white-space: pre-wrap; word-break: break-all;
}
.diff-added { background: rgba(16,185,129,0.12); color: #6ee7b7; padding: 1px 4px; border-radius: 3px; margin: 1px 0; }
.diff-removed { background: rgba(239,68,68,0.12); color: #fca5a5; padding: 1px 4px; border-radius: 3px; margin: 1px 0; }

/* ===== QR ===== */
.qr-center { text-align: center; }
.qr-container { margin: 20px auto; display: inline-block; padding: 20px; background: #fff; border-radius: 12px; }
#qrcode-text { margin-top: 8px; color: var(--text-muted); word-break: break-all; font-size: .8rem; }

/* ===== Password ===== */
.pw-center { max-width: 560px; margin: 0 auto; }
.pw-options { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 20px; justify-content: center; }
.pw-result { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center; }
.pw-result input { flex: 1; min-width: 200px; text-align: center; letter-spacing: 3px; font-family: 'Courier New', monospace; font-size: 1.1rem; }
input[type="color"] { width: 36px; height: 36px; border: none; border-radius: 8px; cursor: pointer; background: transparent; padding: 0; }
input[type="range"] { width: 140px; accent-color: var(--primary); cursor: pointer; background: transparent; }
input[type="number"] { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); color: var(--text); border-radius: 10px; padding: 8px 12px; font-size: .88rem; outline: none; }

/* ===== Footer ===== */
.footer {
    margin-top: auto; background: rgba(11,13,23,0.5);
    border-top: 1px solid rgba(255,255,255,0.04); padding: 20px 0;
    text-align: center; font-size: .82rem; color: var(--text-muted);
}
.footer-links { margin-top: 4px; }
.footer-links a, .footer-links span { color: var(--text-muted); cursor: pointer; transition: color var(--transition); font-size: .8rem; }
.footer-links span:hover { color: var(--text-light); }

/* ===== No Results ===== */
.no-results { text-align: center; padding: 60px 20px; color: var(--text-muted); display: none; }
.no-results.visible { display: block; }

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .hero { padding: 50px 0 24px; }
    .hero h1 { font-size: 2rem; }
    .hero-sub { font-size: .9rem; }
    .nav { margin-left: 0; width: 100%; justify-content: center; }
    .header-inner { justify-content: center; }
    .tool-grid { grid-template-columns: 1fr; }
    .quick-stats { gap: 20px; }
    .quick-stat-num { font-size: 1.3rem; }
    .donate-btn { margin-left: auto; }
    .stats-box { gap: 6px; }
    .stat-item { padding: 12px 14px; min-width: 60px; }
    .stat-num { font-size: 1.2rem; }
    .diff-container { flex-direction: column; }
    .diff-col { min-width: auto; }
}
