/* ===== Theme Variables ===== */
:root {
    --primary: #4361ee;
    --primary-light: #e8ecfd;
    --primary-rgb: 67,97,238;
    --secondary: #3f37c9;
    --success: #06d6a0;
    --warning: #ffd166;
    --danger: #ef476f;
    --dark: #1d1d2c;
    --light: #f8f9fa;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --sidebar-width: 260px;
    --header-height: 60px;

    /* Frosted glass/hazy theme */
    --bg-body-solid: #f4f6f9;
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-sidebar: rgba(255, 255, 255, 0.75);
    --bg-sidebar-search: rgba(240, 242, 245, 0.6);
    --bg-input: rgba(255, 255, 255, 0.8);
    --bg-result: rgba(248, 249, 250, 0.6);
    --bg-footer: rgba(255, 255, 255, 0.6);
    --bg-hover: rgba(248, 249, 250, 0.8);
    
    --text-primary: #333;
    --text-secondary: #555;
    --text-muted: #6c757d;
    --border-color: rgba(233, 236, 239, 0.8);
    --border-focus: var(--primary);
    --shadow-card: 0 4px 16px rgba(0,0,0,.04);
    --shadow-hover: 0 8px 25px rgba(67,97,238,.12);

    --code-bg: #f5f5f5;
    --code-border: #e0e0e0;
    --code-text: #333;
    --code-tag: #0550ae;
    --code-attr: #953800;
    --code-val: #0a3069;
    --code-comment: #6a737d;
    --code-bracket: #6c757d;
    --code-entity: #8250df;
    --code-linenr-bg: #f0f0f0;
    --code-linenr-border: #ddd;
    --code-linenr-text: #999;
    --code-caret: #333;
    --code-selection: rgba(67,97,238,.18);
}

/* ===== Global Toast (消息提示) ===== */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}
.custom-toast {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    color: #333;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toastSlideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    pointer-events: auto;
}
.custom-toast.toast-error {
    background: rgba(254, 242, 242, 0.9);
    border-color: rgba(252, 165, 165, 0.5);
    color: #991b1b;
}
.custom-toast.toast-success {
    background: rgba(240, 253, 244, 0.9);
    border-color: rgba(134, 239, 172, 0.5);
    color: #166534;
}
.custom-toast i {
    font-size: 1.1rem;
}
.custom-toast.fade-out {
    animation: toastFadeOut 0.3s ease-in forwards;
}
@keyframes toastSlideDown {
    from { opacity: 0; transform: translateY(-20px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastFadeOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-10px) scale(0.95); }
}
/* 针对 Webkit 内核 (Chrome, Safari, Edge) */
/* ===== Global Scrollbar (隐形化美化) ===== */
/* 针对 Webkit 内核 (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* 针对 Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg-body-solid);
    background-image: radial-gradient(circle at top left, #fdfbfb 0%, #ebedee 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background .3s, color .3s;
}

/* ===== Navbar ===== */
.navbar-custom {
    background: 
        radial-gradient(ellipse at center, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.02) 0px, rgba(255, 255, 255, 0.02) 1px, transparent 1px, transparent 10px),
        linear-gradient(135deg, rgba(30, 64, 215, 0.92) 0%, rgba(60, 90, 235, 0.88) 70%, rgba(85, 150, 245, 0.8) 100%);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    height: var(--header-height);
    box-shadow: 0 4px 20px rgba(40, 70, 220, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.navbar-custom .navbar-brand {
    color: #fff;
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.navbar-custom .navbar-brand i {
    display: inline-block;
    color: #fff;
    transition: transform .4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.navbar-custom .navbar-brand:hover i {
    transform: rotate(15deg) scale(1.15);
}
.navbar-custom .nav-link { 
    color: rgba(255,255,255,0.85); 
    font-weight: 600;
    padding: .45rem 1rem;
    margin: 0 .25rem;
    border-radius: 8px;
    transition: all .25s ease;
    position: relative;
}
.navbar-custom .nav-link i {
    transition: transform .25s ease;
    display: inline-block;
}
.navbar-custom .nav-link:hover { 
    color: #fff; 
    background: rgba(255, 255, 255, 0.2);
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.navbar-custom .nav-link:hover i {
    transform: scale(1.1);
}
.navbar-custom .search-box { max-width: 320px; }
.navbar-custom .search-box .form-control {
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    padding-left: 36px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    transition: all .3s ease;
    box-shadow: none;
}
.navbar-custom .search-box .form-control::placeholder { color: rgba(255,255,255,0.6); }
.navbar-custom .search-box .form-control:focus {
    background: #fff;
    color: #333;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: transparent;
}
.navbar-custom .search-box .search-icon {
    position: absolute; left: 12px; top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.7);
    pointer-events: none; z-index: 5;
}
.navbar-custom .search-box .form-control:focus ~ .search-icon { color: var(--primary); }
.navbar-action-group {
    flex-wrap: nowrap;
    min-width: 0;
}
.navbar-login-btn,
.navbar-user-toggle {
    flex-shrink: 1;
    white-space: nowrap;
}
.navbar-user-toggle {
    display: inline-flex;
    align-items: center;
    gap: .15rem;
    max-width: 100%;
}
.navbar-user-name {
    display: inline-block;
    max-width: 7.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}
@media (max-width: 991.98px) {
    .navbar-user-name {
        display: none;
    }
}

/* Module Tabs */
.module-tabs { display: flex; gap: 4px; margin-left: 24px; }
.module-tab {
    color: rgba(255,255,255,.6); text-decoration: none; font-size: .85rem; font-weight: 500;
    padding: 4px 14px; border-radius: 20px; transition: all .2s; white-space: nowrap;
}
.module-tab:hover { color: #fff; background: rgba(255,255,255,.12); }
.module-tab.active { color: #fff; background: rgba(255,255,255,.2); }

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: var(--header-height);
    left: 0; bottom: 0;
    background: var(--bg-sidebar);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 100;
    transition: transform .3s ease, background .3s, border-color .3s;
    padding-top: 0;
}
.sidebar-search {
    position: sticky; top: 0; z-index: 2;
    padding: 12px 14px 8px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    transition: background .3s, border-color .3s;
}
.sidebar-search .form-control {
    border-radius: 18px;
    padding-left: 32px;
    font-size: .85rem;
    background: var(--bg-sidebar-search);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.sidebar-search .form-control:focus {
    background: var(--bg-card);
    border-color: var(--border-focus);
    box-shadow: 0 0 0 .15rem rgba(var(--primary-rgb),.15);
}
.sidebar-search-icon {
    position: absolute; left: 10px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: .8rem; pointer-events: none;
}
.sidebar .nav-link.search-hidden,
.sidebar .nav-category.search-hidden { display: none !important; }
.sidebar .nav-category {
    font-size: .72rem; font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: .45rem 1rem;
    margin-top: .5rem;
    cursor: default;
}
.sidebar .nav-link {
    color: var(--text-primary);
    padding: .45rem 1rem .45rem 1.5rem;
    margin: 0.15rem 0.5rem;
    font-size: .86rem; 
    border-radius: 8px;
    display: flex; align-items: center; gap: .5rem;
    position: relative;
    transition: all .35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

/* 我们需要给文字包裹一个 span 或者直接利用 flex 布局的特性，这里我们通过调整 z-index 确保内容在上 */
.sidebar .nav-link > * {
    position: relative;
    z-index: 2;
}

/* 背景滑块：悬浮或选中时从左向右填满 */
.sidebar .nav-link::before {
    content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 0;
    background: rgba(var(--primary-rgb), 0.06); border-radius: 8px; z-index: -1;
    transition: width .4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 动态标记：基础样式 */
.sidebar .nav-link::after {
    content: ''; position: absolute; bottom: 0; left: 0;
    width: 4px; height: 0; background: var(--primary); border-radius: 4px;
    opacity: 0; transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.4);
    z-index: 0; /* 确保细线在文字下方，但不要被背景遮挡 */
    pointer-events: none; /* 防止遮挡点击 */
}

.sidebar .nav-link i { width: 20px; text-align: center; color: var(--text-muted); transition: all .35s cubic-bezier(0.4, 0, 0.2, 1); position: relative; z-index: 2; }

/* 悬浮状态：左侧出现标记，背景填满，整体右移 */
.sidebar .nav-link:hover { color: var(--primary); transform: translateX(4px); }
.sidebar .nav-link:hover::before { width: 100%; }
.sidebar .nav-link:hover:not(.active)::after { height: 16px; opacity: 1; left: 0; bottom: 50%; transform: translateY(50%) rotate(0deg); }
.sidebar .nav-link:hover i { color: var(--primary); transform: scale(1.1); }

/* 选中状态：流体动画变成线，然后到右侧旋转固定为菱形 */
.sidebar .nav-link.active { color: var(--primary); font-weight: 600; transform: translateX(0); }
.sidebar .nav-link.active::before { width: 100%; background: rgba(var(--primary-rgb), 0.1); }
.sidebar .nav-link.active::after { 
    opacity: 1; 
    left: calc(100% - 16px); 
    width: 7px; 
    height: 7px; 
    border-radius: 1.5px;
    bottom: 50%;
    /* 移除这里的 transform，完全由动画控制最终状态，避免冲突 */
    animation: fluidSlideBottom 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.sidebar .nav-link.active i { color: var(--primary); }

@keyframes fluidSlideBottom {
    /* 1. 起点：左侧中间，悬浮时的竖条 */
    0% {
        left: 0; bottom: 50%; width: 4px; height: 16px; border-radius: 4px;
        transform: translateY(50%) rotate(0deg);
        box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.4);
    }
    /* 2. 下沉：像夕阳一样沉入海底（变短变宽，准备游动） */
    15% {
        left: 0; bottom: 0; width: 8px; height: 2px; border-radius: 2px;
        transform: translateY(0) rotate(0deg);
        box-shadow: 0 0 4px rgba(var(--primary-rgb), 0.2);
    }
    /* 3. 海底潜行：贴着底部拉长，像一条光带游向右侧（残夜潜行） */
    45% {
        left: 0; bottom: 0; width: 100%; height: 2px; border-radius: 2px;
        transform: translateY(0) rotate(0deg);
        box-shadow: 0 0 4px rgba(var(--primary-rgb), 0.2);
    }
    /* 4. 到达彼岸：在右下角收缩成一个小光点，准备升起 */
    70% {
        left: calc(100% - 16px); bottom: 0; width: 4px; height: 2px; border-radius: 2px;
        transform: translateY(0) rotate(0deg);
        box-shadow: 0 0 4px rgba(var(--primary-rgb), 0.2);
    }
    /* 5. 海日生残夜：从右下角缓缓升起到中间，同时旋转绽放成耀眼的菱形 */
    100% {
        left: calc(100% - 16px); bottom: 50%; width: 7px; height: 7px; border-radius: 1.5px;
        transform: translateY(50%) rotate(-315deg);
        box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.8);
    }
}

/* ===== Sidebar Resize Handle ===== */
.sidebar-resize-handle {
    position: fixed;
    top: var(--header-height); bottom: 0;
    left: var(--sidebar-width);
    width: 5px;
    cursor: col-resize;
    z-index: 101;
    background: transparent;
    transition: background .15s;
}
.sidebar-resize-handle:hover,
.sidebar-resize-handle.dragging {
    background: var(--primary);
    opacity: .35;
}
.sidebar .nav-link i { width: 20px; text-align: center; color: var(--text-muted); transition: all .25s cubic-bezier(0.4, 0, 0.2, 1); }

/* ===== Main Content ===== */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 1.25rem; flex: 1;
    min-height: calc(100vh - var(--header-height));
    /* 更柔和的呼吸感切换动画 */
    animation: contentBreathIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
@keyframes contentBreathIn {
    0% { 
        opacity: 0; 
        transform: translateY(15px) scale(0.99); 
        filter: blur(4px);
    }
    100% { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
        filter: blur(0);
    }
}

/* ===== Tool Cards (Index) ===== */
.tool-category-title {
    font-size: 1.1rem; font-weight: 700;
    color: var(--dark);
    margin-bottom: 1rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid transparent;
    display: inline-block;
    background-image: linear-gradient(var(--primary), var(--primary));
    background-size: 0% 2px;
    background-position: left bottom;
    background-repeat: no-repeat;
    animation: titleUnderline .5s ease-out .15s forwards;
}
@keyframes titleUnderline {
    to { background-size: 100% 2px; }
}
.tool-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px; padding: 1rem;
    text-decoration: none;
    color: var(--text-primary);
    display: flex; align-items: center; gap: 1rem;
    transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow .3s ease, border-color .3s ease;
    border: 1px solid var(--border-color);
    height: 100%;
    position: relative;
    z-index: 1;
}

/* 渐变边框层 */
.tool-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 13px; /* 12px + 1px */
    padding: 1.5px;
    background: var(--card-gradient, linear-gradient(135deg, var(--primary), var(--secondary)));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
    z-index: -1;
}

.tool-card:has(.icon-backend) { --card-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%); --card-shadow: rgba(102, 126, 234, 0.25); }
.tool-card:has(.icon-frontend) { --card-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%); --card-shadow: rgba(250, 112, 154, 0.25); }
.tool-card:has(.icon-encode) { --card-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); --card-shadow: rgba(79, 172, 254, 0.25); }
.tool-card:has(.icon-crypto) { --card-gradient: linear-gradient(135deg, #09203f 0%, #537895 100%); --card-shadow: rgba(9, 32, 63, 0.25); }
.tool-card:has(.icon-text) { --card-gradient: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%); --card-shadow: rgba(224, 195, 252, 0.25); }
.tool-card:has(.icon-image) { --card-gradient: linear-gradient(135deg, #f6d365 0%, #fda085 100%); --card-shadow: rgba(246, 211, 101, 0.25); }
.tool-card:has(.icon-network) { --card-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); --card-shadow: rgba(67, 233, 123, 0.25); }
.tool-card:has(.icon-daily) { --card-gradient: linear-gradient(135deg, #ff758c 0%, #ff7eb3 100%); --card-shadow: rgba(255, 117, 140, 0.25); }
.tool-card:has(.icon-questionnaire) { --card-gradient: linear-gradient(135deg, #5b86e5 0%, #36d1dc 100%); --card-shadow: rgba(54, 209, 220, 0.24); }
.tool-card:has(.icon-game) { --card-gradient: linear-gradient(135deg, #b224ef 0%, #7579ff 100%); --card-shadow: rgba(178, 36, 239, 0.25); }

.tool-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 30px var(--card-shadow, var(--shadow-hover));
    border-color: transparent;
    color: var(--text-primary);
}
.tool-card:hover::after { opacity: 1; }
.tool-card:active {
    transform: translateY(-1px) scale(.98);
    transition-duration: .1s;
}
.tool-card .tool-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; color: #fff; flex-shrink: 0;
    transition: transform .25s ease;
}
.tool-card:hover .tool-icon {
    transform: scale(1.1) rotate(-3deg);
}

/* 首页卡片交错入场 */
.tool-card-wrapper {
    opacity: 0;
    animation: cardFadeIn .4s ease-out forwards;
}
.tool-card-wrapper:nth-child(1)  { animation-delay: .04s; }
.tool-card-wrapper:nth-child(2)  { animation-delay: .08s; }
.tool-card-wrapper:nth-child(3)  { animation-delay: .12s; }
.tool-card-wrapper:nth-child(4)  { animation-delay: .16s; }
.tool-card-wrapper:nth-child(5)  { animation-delay: .20s; }
.tool-card-wrapper:nth-child(6)  { animation-delay: .24s; }
.tool-card-wrapper:nth-child(7)  { animation-delay: .28s; }
.tool-card-wrapper:nth-child(8)  { animation-delay: .32s; }
.tool-card-wrapper:nth-child(n+9){ animation-delay: .35s; }
@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.tool-card .tool-info {
    min-width: 0;
    overflow: hidden;
}
.tool-card .tool-info h6 { margin: 0; font-weight: 600; font-size: .9rem; }
.tool-card .tool-info p {
    margin: 0; font-size: .78rem; color: var(--text-muted); line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.tool-usage-badge {
    display: inline-block; font-size: .68rem; color: var(--text-muted);
    background: var(--bg-result); padding: 1px 8px; border-radius: 10px;
    margin-top: 4px; white-space: nowrap;
}

.icon-backend { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.icon-frontend { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.icon-encode { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.icon-crypto { background: linear-gradient(135deg, #09203f 0%, #537895 100%); }
.icon-text { background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%); }
.icon-image { background: linear-gradient(135deg, #f6d365 0%, #fda085 100%); }
.icon-network { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.icon-daily { background: linear-gradient(135deg, #ff758c 0%, #ff7eb3 100%); }
.icon-questionnaire { background: linear-gradient(135deg, #5b86e5 0%, #36d1dc 100%); }
.icon-game { background: linear-gradient(135deg, #b224ef 0%, #7579ff 100%); }

/* ===== Tool Page ===== */
.tool-header {
    margin-bottom: 1rem;
    position: relative;
    z-index: 120;
}
.tool-header h4 {
    font-weight: 700; color: var(--dark);
    font-size: 1.15rem;
    margin-bottom: .25rem;
    display: flex; align-items: center; gap: .5rem;
}
.tool-help-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    z-index: 121;
}
.tool-help-btn {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 1.5px solid #adb5bd;
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: .72rem; font-weight: 700;
    font-style: italic; font-family: Georgia, serif;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: help; transition: all .2s;
    flex-shrink: 0; line-height: 1; padding: 0;
    position: relative;
    z-index: 122;
}
.tool-help-btn:hover { border-color: var(--primary); color: #fff; background: var(--primary); }
.tool-help-box {
    display: none; position: absolute;
    top: calc(100% + 8px); left: 50%;
    transform: translateX(-50%);
    width: 420px; max-width: 90vw;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    font-size: .85rem;
    color: var(--text-primary);
    line-height: 1.7;
    box-shadow: 0 8px 30px rgba(0,0,0,.18);
    z-index: 130;
    animation: helpFadeIn .15s ease;
}
.tool-help-box::before {
    content: ''; position: absolute;
    top: -7px; left: 50%; transform: translateX(-50%);
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid var(--border-color);
}
.tool-help-box::after {
    content: ''; position: absolute;
    top: -6px; left: 50%; transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid var(--bg-card);
}
.tool-help-wrap:hover .tool-help-box { display: block; }
.tool-help-box h6 { font-weight: 700; color: var(--primary); margin-bottom: .5rem; font-size: .88rem; }
.tool-help-box ol, .tool-help-box ul { margin-bottom: .25rem; padding-left: 1.25rem; }
.tool-help-box li { margin-bottom: .2rem; }
.tool-help-box code { background: var(--bg-result); padding: 1px 5px; border-radius: 3px; font-size: .82rem; color: var(--text-primary); }
@media (max-width: 575.98px) {
    .tool-help-box { width: 280px; left: 0; transform: none; }
    .tool-help-box::before, .tool-help-box::after { left: 16px; transform: none; }
}
@keyframes helpFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-4px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.tool-header p { color: var(--text-muted); font-size: .88rem; margin: 0; }

/* ===== Standardized Text Sizing ===== */
.tool-panel h5 { font-size: 1rem; font-weight: 700; }
.tool-panel h6 { font-size: .88rem; font-weight: 700; }
.tool-panel .form-label { font-weight: 600; font-size: .85rem; color: var(--text-secondary); }
.tool-panel .form-control { font-size: .88rem; }
.tool-panel .form-select { font-size: .88rem; }
.tool-panel .btn { font-size: .85rem; }
.tool-panel .text-muted, .tool-panel .form-text { font-size: .8rem; }
.tool-panel .badge { font-size: .72rem; }

.tool-panel {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px; padding: 1rem;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    transition: background .3s, border-color .3s;
    animation: panelSlideIn .35s ease-out;
}
@keyframes panelSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.tool-panel textarea.form-control {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: .85rem; resize: vertical;
    overflow-y: auto;
    transition: height .15s ease;
}
.tool-panel textarea.form-control.auto-grow {
    overflow-y: hidden;
}
.btn-primary { background: var(--primary); border-color: var(--primary); transition: transform .15s cubic-bezier(0.4, 0, 0.2, 1), background .15s, box-shadow .15s; position: relative; overflow: hidden; }
.btn-primary:hover { background: #3a56d4; border-color: #3a56d4; box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3); }
.btn-primary:active { transform: scale(0.96); box-shadow: 0 2px 6px rgba(var(--primary-rgb), 0.2); }
/* 核心按钮扫光动画 */
.btn-primary::after {
    content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg); transition: none; z-index: 1; pointer-events: none;
}
.btn-primary:hover::after {
    /* 将动画改为单次执行，且速度放缓，避免闪烁感 */
    animation: btnShine 0.8s ease-out forwards;
}
@keyframes btnShine {
    0% { left: -100%; }
    100% { left: 200%; }
}

.btn-outline-secondary { border-color: rgba(0,0,0,.2); color: var(--text-secondary); transition: all .15s cubic-bezier(0.4, 0, 0.2, 1); }
.btn-outline-secondary:hover { border-color: #6c757d; background: rgba(108,117,125,0.05); color: var(--text-primary); }
.btn-outline-secondary:active { transform: scale(0.96); }

.btn-outline-primary { border-color: rgba(13,110,253,.4); color: #0d6efd; transition: all .15s cubic-bezier(0.4, 0, 0.2, 1); }
.btn-outline-primary:hover { background: rgba(13,110,253,0.05); color: #0a58ca; }
.btn-outline-primary:active { transform: scale(0.96); }

.btn-outline-success { border-color: rgba(25,135,84,.4); color: #198754; transition: all .15s cubic-bezier(0.4, 0, 0.2, 1); }
.btn-outline-success:hover { background: rgba(25,135,84,0.05); color: #146c43; }
.btn-outline-success:active { transform: scale(0.96); }

.btn-outline-danger { border-color: rgba(220,53,69,.4); color: #dc3545; transition: all .15s cubic-bezier(0.4, 0, 0.2, 1); }
.btn-outline-danger:hover { background: rgba(220,53,69,0.05); color: #b02a37; }
.btn-outline-danger:active { transform: scale(0.96); }

.btn-outline-warning { border-color: rgba(255,193,7,.5); color: #ffc107; transition: all .15s cubic-bezier(0.4, 0, 0.2, 1); }
.btn-outline-warning:hover { background: rgba(255,193,7,0.05); color: #cc9a06; }
.btn-outline-warning:active { transform: scale(0.96); }
#btnFavTool { white-space: nowrap; }

.btn-outline-info { border-color: rgba(13,202,240,.4); color: #0dcaf0; transition: all .15s cubic-bezier(0.4, 0, 0.2, 1); }
.btn-outline-info:hover { background: rgba(13,202,240,0.05); color: #0aacce; }
.btn-outline-info:active { transform: scale(0.96); }

/* 修复 Bootstrap 默认的 btn-light 悬浮文字发白问题 */
.btn-light { background: #f8f9fa; border-color: #f8f9fa; color: #212529; transition: all .15s cubic-bezier(0.4, 0, 0.2, 1); }
.btn-light:hover { background: #e2e6ea; border-color: #dae0e5; color: #212529; }
.btn-light:active { transform: scale(0.96); }

.btn-tool {
    border-radius: 8px; font-weight: 600;
    font-size: .85rem; padding: .4rem 1rem;
    transition: all .15s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-tool:active { transform: scale(.96); }
.result-area {
    background: var(--bg-result);
    border: 1px solid var(--border-color);
    border-radius: 8px; padding: .75rem;
    min-height: 60px;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: .85rem; white-space: pre-wrap;
    word-break: break-all;
    color: var(--text-primary);
    transition: background .3s, border-color .3s;
}
.copy-btn {
    position: absolute; top: 8px; right: 8px;
    font-size: .75rem; line-height: 1;
    transition: transform .15s ease;
    z-index: 10;
}
.copy-btn:active { transform: scale(.85); }

.upload-drop-zone { 
    cursor: pointer; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    border: 2px dashed rgba(67, 97, 238, 0.3);
    background: rgba(67, 97, 238, 0.02);
    position: relative;
    overflow: hidden;
}
/* 空白状态下的缓慢呼吸动画 */
.upload-drop-zone:not(.has-file) {
    animation: dropZoneBreath 3s ease-in-out infinite alternate;
}
@keyframes dropZoneBreath {
    0% { border-color: rgba(67, 97, 238, 0.2); background: rgba(67, 97, 238, 0.01); }
    100% { border-color: rgba(67, 97, 238, 0.5); background: rgba(67, 97, 238, 0.04); }
}
/* 鼠标悬浮或拖拽文件进入时的吸附效果 */
.upload-drop-zone:hover, .upload-drop-zone.dragover { 
    background: rgba(67, 97, 238, 0.08); 
    border-color: var(--primary);
    transform: scale(1.01);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.1);
}
.upload-drop-zone.dragover {
    /* 拖拽进入时停止呼吸动画，保持高亮 */
    animation: none;
    border-style: solid;
}

/* ===== Calculator ===== */
.calculator-wrapper { font-family: "SF Mono", "Consolas", monospace; }
.calculator-display {
    font-size: 1.25rem; min-height: 2.5rem;
    background: var(--bg-result) !important;
    color: var(--text-primary);
}
.calculator-keys .calc-btn {
    min-height: 40px; font-weight: 600; border-radius: 8px;
}

/* ===== Diff Tool ===== */
.diff-textarea { font-family: "SFMono-Regular", Consolas, monospace; font-size: .85rem; }
.diff-stats-bar { display: flex; gap: .75rem; flex-wrap: wrap; padding: .35rem 0; font-size: .85rem; }
.diff-stat { padding: .2rem .4rem; border-radius: 5px; }
.diff-added { background: rgba(6, 214, 160, .2); color: #0d6b4a; }
.diff-removed { background: rgba(239, 71, 111, .2); color: #b91c3c; }
.diff-modified { background: rgba(255, 209, 102, .3); color: #996600; }
.diff-result-wrapper {
    border: 1px solid var(--border-color);
    border-radius: 8px; overflow: auto;
    max-height: 500px; background: var(--bg-card);
}
.diff-result { font-family: "SFMono-Regular", Consolas, monospace; font-size: .85rem; }
.diff-line { display: flex; min-height: 1.5em; line-height: 1.5; }
.diff-line-num {
    min-width: 3em; padding: 0 .5em;
    text-align: right; color: var(--text-muted);
    user-select: none; flex-shrink: 0;
    border-right: 1px solid var(--border-color);
}
.diff-line-content { flex: 1; padding: 0 .5em; white-space: pre; overflow-x: auto; }
.diff-line.same .diff-line-content { background: var(--bg-card); }
.diff-line.added .diff-line-content { background: rgba(6, 214, 160, .25); }
.diff-line.removed .diff-line-content { background: rgba(239, 71, 111, .2); }
.diff-line.added .diff-line-num { background: rgba(6, 214, 160, .15); }
.diff-line.removed .diff-line-num { background: rgba(239, 71, 111, .15); }

/* ===== Footer ===== */
.footer {
    margin-left: var(--sidebar-width);
    padding: 1rem; text-align: center;
    font-size: .8rem; color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    background: linear-gradient(to top, rgba(240, 244, 255, 0.8) 0%, rgba(255, 255, 255, 0.4) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background .3s, border-color .3s;
}

/* ===== Mobile ===== */
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.4); z-index: 99;
}

/* navbar-brand：防止在窄屏被压缩换行 */
.navbar-custom .navbar-brand {
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100vw - 180px);
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        background: rgba(255, 255, 255, 0.82);
    }
    .sidebar.show { transform: translateX(0); }
    .sidebar-overlay.show { display: block; }
    .main-content { margin-left: 0; padding: 1rem .75rem; }
    .footer { margin-left: 0; }
    .tool-panel { padding: 1rem; border-radius: 10px; }
    .tool-header h4 { font-size: 1.1rem; }
    .tool-header p { font-size: .82rem; }
    .tool-card { padding: 1rem; gap: .75rem; }
    .tool-card .tool-icon { width: 40px; height: 40px; font-size: 1.1rem; border-radius: 10px; }
    .tool-card .tool-info h6 { font-size: .85rem; }
    .tool-card .tool-info p { font-size: .72rem; }
    .result-area { padding: .75rem; }
    .diff-stats-bar { gap: .5rem; font-size: .82rem; }
    .tool-panel textarea.form-control { font-size: .8rem; }
    .sidebar-module-switch {
        top: 0;
        z-index: 4;
        background: rgba(255, 255, 255, 0.88);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }
    .sidebar-search {
        top: 56px;
        z-index: 3;
        background: linear-gradient(to bottom, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.82));
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        box-shadow: 0 8px 18px rgba(67, 97, 238, 0.06);
    }
    .sidebar .nav-category {
        position: relative;
        z-index: 1;
    }
    /* 左右双栏工具页在平板以下变单列 */
    .row > [class*="col-lg-6"] { width: 100%; }
}

@media (max-width: 767.98px) {
    /* 三栏标签彻底隐藏（Bootstrap d-none d-md-flex 的兜底保障） */
    .module-tabs { display: none !important; }

    /* 左右双栏工具页（col-md-6）在手机端变单列 */
    .row > .col-md-6 { width: 100%; }
}

@media (max-width: 575.98px) {
    .main-content { padding: .75rem .5rem; }
    .tool-panel { padding: .75rem; }
    .tool-category-title { font-size: .95rem; }
    /* brand 在极窄屏进一步缩小字号并截断 */
    .navbar-custom .navbar-brand {
        font-size: 1rem;
        max-width: calc(100vw - 160px);
    }
    /* sup 版本号在极窄屏隐藏，省出宝贵空间 */
    #siteVersion { display: none !important; }
    .navbar-custom {
        padding-left: .75rem !important;
        padding-right: .75rem !important;
    }
    .navbar-action-group {
        gap: .35rem !important;
    }
    .navbar-login-btn {
        padding: .28rem .55rem;
        min-width: 2.1rem;
    }
    .navbar-login-btn i {
        margin-right: 0 !important;
    }
    #userLoggedArea {
        gap: .35rem !important;
        min-width: 0;
    }
    .navbar-user-toggle {
        gap: .12rem;
    }
    .navbar-user-name {
        display: none;
    }
    #navVipBadge {
        margin-left: .15rem !important;
    }
    .nav-coins-badge {
        padding: 2px 7px;
        font-size: .74rem;
    }
    .nav-coins-badge i {
        font-size: .8rem;
    }
    #btnFavTool {
        padding: 4px 8px !important;
        min-width: 36px;
        justify-content: center;
        gap: 0 !important;
    }
    #btnFavTool .fav-btn-label {
        display: none;
    }
    /* 工具卡片在极窄屏优化 */
    .tool-card { gap: .6rem; }
    .tool-card .tool-icon { width: 36px; height: 36px; font-size: 1rem; border-radius: 8px; }
    /* 帮助弹窗宽度适配 */
    .tool-help-box { width: 280px; left: 0; transform: none; }
    .tool-help-box::before, .tool-help-box::after { left: 16px; transform: none; }
    /* 更新日志时间线 */
    .changelog-timeline { padding: 0; }
}

/* 侧边栏顶部模块切换（手机端） */
.sidebar-module-switch {
    display: flex; gap: 8px; padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-sidebar);
    position: sticky; top: 0; z-index: 2;
}
.smw-btn {
    flex: 1; display: flex; align-items: center; justify-content: center;
    gap: 6px; padding: 8px 10px; border-radius: 10px;
    text-decoration: none; font-size: .88rem; font-weight: 600;
    color: var(--text-muted); background: var(--bg-sidebar-search);
    border: 1px solid var(--border-color);
    transition: all .18s;
}
.smw-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }
.smw-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.smw-btn i { font-size: 1rem; }

/* ===== Code Editor (HTML Preview) ===== */
.code-editor-wrap {
    position: relative; height: 400px;
    border: 1px solid var(--code-border);
    border-radius: .375rem; overflow: hidden;
    background: var(--code-bg);
    transition: background .3s, border-color .3s;
}
.code-editor-wrap .code-highlight,
.code-editor-wrap .code-input {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: .84rem; line-height: 1.6;
    padding: 10px 10px 10px 42px;
    margin: 0; border: none; outline: none; resize: none;
    white-space: pre; overflow: auto;
    tab-size: 2; -moz-tab-size: 2;
    word-wrap: normal;
}
.code-editor-wrap .code-highlight {
    pointer-events: none; z-index: 1;
    color: var(--code-text); background: transparent;
}
.code-editor-wrap .code-input {
    z-index: 2; color: transparent; background: transparent;
    caret-color: var(--code-caret);
    -webkit-text-fill-color: transparent;
}
.code-editor-wrap .code-input::selection { background: var(--code-selection); }
.code-editor-wrap .code-input::-moz-selection { background: var(--code-selection); }
.code-editor-wrap .code-input::placeholder { -webkit-text-fill-color: var(--text-muted); }
.code-editor-wrap .line-numbers {
    position: absolute; top: 0; left: 0; width: 36px; bottom: 0;
    background: var(--code-linenr-bg);
    border-right: 1px solid var(--code-linenr-border);
    z-index: 3; overflow: hidden;
    padding: 10px 6px 10px 0;
    text-align: right;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: .84rem; line-height: 1.6;
    color: var(--code-linenr-text); user-select: none;
    transition: background .3s, border-color .3s;
}

.hl-tag { color: var(--code-tag); }
.hl-attr { color: var(--code-attr); }
.hl-val { color: var(--code-val); }
.hl-text { color: var(--code-text); }
.hl-comment { color: var(--code-comment); font-style: italic; }
.hl-entity { color: var(--code-entity); }
.hl-doctype { color: var(--code-tag); }
.hl-eq { color: var(--code-text); }
.hl-bracket { color: var(--code-bracket); }

.html-toolbar {
    display: flex; flex-wrap: wrap;
    border: 1px solid var(--border-color); border-radius: 8px;
    background: var(--bg-result); overflow: hidden; margin-bottom: 10px;
}
.toolbar-row {
    display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
    padding: 5px 10px; flex: 1 0 46%;
    border-bottom: 1px solid var(--border-color);
    box-sizing: border-box;
}
.toolbar-row .btn { font-size: .78rem; padding: 2px 8px; position: relative; }
.toolbar-group-label {
    font-size: .7rem; color: var(--text-muted); font-weight: 600;
    white-space: nowrap; padding: 0 4px 0 0; min-width: 32px;
}

/* ===== Modern Tooltip ===== */
.tooltip {
    --bs-tooltip-bg: rgba(30, 41, 59, 0.9);
    --bs-tooltip-color: #fff;
    --bs-tooltip-padding-x: 0.75rem;
    --bs-tooltip-padding-y: 0.4rem;
    --bs-tooltip-border-radius: 8px;
    --bs-tooltip-opacity: 1;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.tooltip.show {
    animation: tooltipFadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes tooltipFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ===== Tag Tooltip (shared) ===== */
.tag-tooltip {
    position: fixed; z-index: 9999; width: 280px;
    background: var(--bg-card, #fff); border: 1px solid var(--border-color, #dee2e6);
    border-radius: 10px; box-shadow: 0 8px 32px rgba(0,0,0,.15), 0 2px 8px rgba(0,0,0,.08);
    padding: 14px 16px; pointer-events: auto;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .18s, visibility .18s, transform .18s;
}
.tag-tooltip.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.tag-tooltip-header { font-size: .92rem; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; line-height: 1.4; }
.tt-tag-code {
    display: inline-block; background: #e8f0fe; color: #1a56db;
    font-family: "SFMono-Regular", Consolas, monospace; font-size: .78rem; font-weight: 600;
    padding: 1px 7px; border-radius: 4px; vertical-align: middle; margin-right: 2px;
}
.tag-tooltip-desc { font-size: .8rem; color: var(--text-muted, #6c757d); line-height: 1.55; margin-bottom: 0; }
.tag-tooltip-divider { height: 1px; background: var(--border-color, #e9ecef); margin: 10px 0; }
.tag-tooltip-preview-label { font-size: .7rem; font-weight: 600; color: var(--text-muted, #999); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.tag-tooltip-preview {
    background: var(--bg-result, #f8f9fa); border: 1px solid var(--border-color, #e9ecef);
    border-radius: 6px; padding: 10px 12px; font-size: .84rem; line-height: 1.5;
    overflow: hidden; max-height: 120px; color: var(--text-primary);
}

.html-preview-frame {
    border: 1px solid var(--border-color);
    border-radius: .375rem; padding: 12px;
    min-height: 400px; max-height: 400px;
    overflow-y: auto; background: var(--bg-card);
    color: var(--text-primary);
    transition: background .3s, border-color .3s;
}
.html-preview-frame.plain-mode {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: .85rem; white-space: pre-wrap;
}

/* ===== Comment Section ===== */
.comment-section { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border-color); }
.comment-title { font-weight: 700; font-size: 1rem; margin-bottom: 12px; color: var(--text-primary); }
.comment-textarea { resize: none; font-size: .88rem; }
.comment-list { margin-top: 8px; }
.comment-item {
    display: flex; gap: 10px; padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    animation: commentSlideIn .3s ease-out;
}
@keyframes commentSlideIn {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}
.comment-item:last-child { border-bottom: none; }
.comment-avatar { font-size: 1.6rem; width: 36px; text-align: center; flex-shrink: 0; line-height: 1; padding-top: 2px; }
.comment-body { flex: 1; min-width: 0; }
.comment-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.comment-nick { font-weight: 600; font-size: .85rem; color: var(--text-primary); }
.comment-time { font-size: .75rem; color: var(--text-muted); }
.comment-del-btn {
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    font-size: .78rem; padding: 0 4px; margin-left: auto; opacity: .5; transition: opacity .15s, color .15s;
}
.comment-del-btn:hover { opacity: 1; color: #dc3545; }
.comment-content { font-size: .88rem; color: var(--text-primary); line-height: 1.6; word-break: break-word; white-space: pre-wrap; }

/* ===== Game Rank Panel ===== */
.game-rank-panel {
    padding: 16px;
    background: var(--bg-result);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}
.rank-list .table { font-size: .85rem; margin-bottom: 0; }
.rank-list .table th { font-weight: 600; font-size: .78rem; color: var(--text-muted); border-bottom-width: 1px; }
.rank-list .table td { vertical-align: middle; }
.game-over-score { font-size: 1.1rem; color: var(--text-secondary); }

.game-over-bar {
    display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
    padding: 10px 16px; margin-top: 10px; border-radius: 10px;
    background: var(--bg-result); border: 1px solid var(--border-color);
}
.game-over-bar-text { font-size: .95rem; color: var(--text-primary); }

/* Password field masking without type=password (prevents browser autofill) */
.wj-pw-field { -webkit-text-security: disc; text-security: disc; }
.wj-pw-field.pw-visible { -webkit-text-security: none; text-security: none; }

/* ===== About Modal – Feature Cards ===== */
.about-feat-card {
    position: relative;
    padding: 12px 12px 12px 16px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,.06);
    border-left: 3px solid var(--afc-accent, #6366f1);
    background: linear-gradient(135deg, var(--afc-bg-from, rgba(99,102,241,.06)) 0%, var(--afc-bg-to, rgba(99,102,241,.02)) 100%);
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.about-feat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px var(--afc-shadow, rgba(99,102,241,.12));
    border-left-color: var(--afc-accent, #6366f1);
}
.about-feat-card .fw-semibold { font-size: .82rem; }
.about-feat-card .text-muted  { font-size: .78rem; line-height: 1.6; }

.afc-primary   { --afc-accent:#4f6ef7; --afc-bg-from:rgba(79,110,247,.07); --afc-bg-to:rgba(79,110,247,.02); --afc-shadow:rgba(79,110,247,.13); }
.afc-info      { --afc-accent:#0dcaf0; --afc-bg-from:rgba(13,202,240,.07); --afc-bg-to:rgba(13,202,240,.02); --afc-shadow:rgba(13,202,240,.13); }
.afc-success   { --afc-accent:#198754; --afc-bg-from:rgba(25,135,84,.07);  --afc-bg-to:rgba(25,135,84,.02);  --afc-shadow:rgba(25,135,84,.13);  }
.afc-danger    { --afc-accent:#dc3545; --afc-bg-from:rgba(220,53,69,.06);  --afc-bg-to:rgba(220,53,69,.02);  --afc-shadow:rgba(220,53,69,.12);  }
.afc-warning   { --afc-accent:#e68a00; --afc-bg-from:rgba(230,138,0,.07);  --afc-bg-to:rgba(230,138,0,.02);  --afc-shadow:rgba(230,138,0,.12);  }
.afc-purple    { --afc-accent:#7c3aed; --afc-bg-from:rgba(124,58,237,.07); --afc-bg-to:rgba(124,58,237,.02); --afc-shadow:rgba(124,58,237,.12); }

/* ===== Auth Modal ===== */
.glass-modal, .auth-modal-content {
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 20px !important;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0,0,0,.15), 0 0 0 1px rgba(0,0,0,.05) !important;
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(150%) !important;
}
.auth-modal-brand {
    padding: 32px 24px 16px;
    text-align: center;
    position: relative;
    background: transparent;
    color: #212529;
}
.auth-brand-icon {
    width: 48px; height: 48px;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: #4f46e5;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 12px;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.15);
}
.auth-brand-name {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -.5px;
}
.auth-close-btn {
    position: absolute;
    top: 16px; right: 16px;
    opacity: .4;
    transition: opacity .2s, transform .2s;
}
.auth-close-btn:hover { opacity: 1; transform: scale(1.1); }

/* Tab 切换 */
.auth-tabs {
    display: flex;
    position: relative;
    margin: 0 24px 20px;
    background: #f1f3f5;
    border-radius: 12px;
    padding: 4px;
}
.auth-tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 0;
    font-size: .9rem;
    font-weight: 600;
    color: #868e96;
    border-radius: 10px;
    cursor: pointer;
    transition: color .2s;
    position: relative;
    z-index: 2;
}
.auth-tab-btn.active { color: #212529; }
.auth-tab-indicator {
    position: absolute;
    top: 4px; bottom: 4px;
    left: 4px;
    width: calc(50% - 4px);
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    z-index: 1;
}

/* 表单区 */
.auth-modal-body { padding: 0 24px 32px; }
.auth-pane { display: none; }
.auth-pane.active { display: block; animation: authFadeIn .3s ease; }
@keyframes authFadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.auth-field {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid #e9ecef;
    border-radius: 12px;
    margin-bottom: 14px;
    transition: border-color .2s, box-shadow .2s;
}
.auth-field:focus-within {
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .1);
}
.auth-field-icon {
    padding: 0 12px 0 16px;
    color: #adb5bd;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: color .2s;
}
.auth-field:focus-within .auth-field-icon { color: #4f46e5; }
.auth-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 8px 12px 0;
    font-size: .95rem;
    color: #212529;
    outline: none;
}
.auth-input::placeholder { color: #adb5bd; font-weight: 400; }
.auth-eye-btn {
    border: none;
    background: transparent;
    padding: 0 14px;
    color: #adb5bd;
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1;
    flex-shrink: 0;
    transition: color .2s;
}
.auth-eye-btn:hover { color: #495057; }

/* 错误提示 */
.auth-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: .85rem;
    color: #dc2626;
    margin-bottom: 16px;
    display: flex; align-items: center;
}
.auth-error::before {
    content: "\F33B"; /* bi-exclamation-circle */
    font-family: bootstrap-icons;
    margin-right: 8px;
    font-size: 1rem;
}

/* 提交按钮 */
.auth-submit-btn {
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
}
.auth-submit-btn:active { transform: translateY(1px); }
.auth-submit-login {
    background: #212529;
    color: #fff;
    box-shadow: 0 4px 12px rgba(33,37,41,.15);
}
.auth-submit-login:hover { background: #343a40; box-shadow: 0 6px 16px rgba(33, 37, 41, .2); }
.auth-submit-register {
    background: #4f46e5;
    color: #fff;
    box-shadow: 0 4px 12px rgba(79,70,229,.15);
}
.auth-submit-register:hover { background: #4338ca; box-shadow: 0 6px 16px rgba(79, 70, 229, .25); }

/* SSO Divider */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #adb5bd;
    font-size: .8rem;
    margin: 20px 0 16px;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e9ecef;
}
.auth-divider:not(:empty)::before { margin-right: .5em; }
.auth-divider:not(:empty)::after { margin-left: .5em; }

/* SSO Buttons */
.auth-sso-btn {
    border-radius: 12px;
    font-weight: 500;
    font-size: .9rem;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    border: none;
    cursor: pointer;
}
.auth-sso-qq { background: #f1f3f5; color: #495057; }
.auth-sso-qq:hover { background: #e9ecef; color: #212529; }
.auth-sso-wx { background: #ebfbee; color: #2b8a3e; }
.auth-sso-wx:hover { background: #d3f9d8; color: #2b8a3e; }

/* 底部切换提示 */
.auth-switch-hint {
    text-align: center;
    font-size: .85rem;
    color: #868e96;
    margin-top: 16px;
}
.auth-switch-link {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 600;
}
.auth-switch-link:hover { text-decoration: underline; color: #4338ca; }

/* ===== 金币徽章 ===== */
.nav-coins-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 200, 0, 0.18);
    border: 1px solid rgba(255, 200, 0, 0.45);
    color: #ffd700;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .02em;
    cursor: default;
    white-space: nowrap;
    transition: background .2s;
}
.nav-coins-badge i { font-size: .9rem; transition: transform .2s ease; }
.nav-coins-badge:hover { background: rgba(255, 200, 0, 0.28); }
.nav-coins-badge:hover i { transform: rotate(15deg) scale(1.15); }

/* ===== 更新记录时间线 ===== */
.changelog-timeline {
    position: relative;
    padding-left: 1.5rem;
}
.changelog-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border-color);
    border-radius: 2px;
}
.cl-item {
    position: relative;
    margin-bottom: 1.25rem;
}
.cl-item:last-child { margin-bottom: 0; }
.cl-dot {
    position: absolute;
    left: -1.5rem;
    top: 14px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bs-primary, #0d6efd);
    border: 2px solid var(--bg-body, #fff);
    box-shadow: 0 0 0 2px var(--bs-primary, #0d6efd);
    z-index: 1;
}
.cl-card {
    background: var(--bg-result, #f8f9fa);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: .85rem 1.1rem;
    transition: box-shadow .15s;
}
.cl-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.07); }
.cl-header {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .5rem;
    flex-wrap: wrap;
}
.cl-version {
    font-weight: 700;
    font-size: .95rem;
    color: var(--bs-primary, #0d6efd);
}
.cl-date {
    font-size: .8rem;
    color: var(--text-muted, #6c757d);
}
.cl-badge {
    font-size: .72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}
.badge-new    { background: #d1e7dd; color: #0a6640; }
.badge-fix    { background: #f8d7da; color: #842029; }
.badge-improve{ background: #fff3cd; color: #856404; }
.cl-list {
    margin: 0;
    padding-left: 1.2rem;
    font-size: .875rem;
    color: var(--text-primary, #212529);
    line-height: 1.7;
}
.cl-list li + li { margin-top: .15rem; }

/* ===== 通用拖拽上传区 ===== */
.drop-zone {
    border: 2px dashed rgba(67, 97, 238, 0.3);
    border-radius: 12px;
    text-align: center;
    padding: 1.5rem .75rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(67, 97, 238, 0.02);
    position: relative;
    overflow: hidden;
}
/* 空白状态下的缓慢呼吸动画 */
.drop-zone:not(.has-file) {
    animation: dropZoneBreath 3s ease-in-out infinite alternate;
}
@keyframes dropZoneBreath {
    0% { border-color: rgba(67, 97, 238, 0.2); background: rgba(67, 97, 238, 0.01); }
    100% { border-color: rgba(67, 97, 238, 0.5); background: rgba(67, 97, 238, 0.04); }
}
.drop-zone:hover {
    border-color: var(--primary);
    background: rgba(67, 97, 238, 0.08);
    transform: scale(1.01);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.1);
}
.drop-zone-active, .drop-zone.drop-zone-active {
    border-color: var(--primary) !important;
    background: rgba(67, 97, 238, 0.12) !important;
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.2);
    transform: scale(1.02);
    animation: none !important; /* 拖拽进入时停止呼吸动画 */
    border-style: solid;
}
.drop-zone-icon {
    font-size: 2rem;
    color: #adb5bd;
    display: block;
    margin-bottom: .5rem;
    transition: color .2s, transform .2s;
}
.drop-zone:hover .drop-zone-icon,
.drop-zone-active .drop-zone-icon {
    color: var(--primary);
    transform: translateY(-4px) scale(1.1);
}
.drop-zone-text {
    font-size: .9rem;
    color: #6c757d;
    font-weight: 500;
}
.drop-zone-hint {
    font-size: .78rem;
    color: #adb5bd;
    margin-top: .25rem;
}
.drop-zone-preview {
    margin-top: .75rem;
    font-size: .82rem;
    color: var(--bs-success, #198754);
    font-weight: 500;
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

