/* common.css - 工具模块公共样式 */
:root {
    --primary-color: #2b3a67;
    --primary-dark: #1a2744;
    --accent-color: #f0c040;
    --bg-color: #f0f2f5;
    --text-color: #333;
    --border-color: #eef0f5;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    line-height: 1.6;
}

/* 语言切换器 */
.lang-switcher {
    position: fixed; top: 16px; right: 16px; z-index: 1000;
    display: flex; gap: 4px;
    background: rgba(255,255,255,0.95);
    border-radius: 20px; padding: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.lang-btn {
    padding: 6px 14px; border: none; border-radius: 16px;
    background: transparent; color: #666;
    font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all 0.2s ease; font-family: inherit;
}

.lang-btn:hover { background: #eef0f5; color: var(--primary-color); }
.lang-btn.active { background: var(--primary-color); color: #fff; }

/* 导航栏 */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 16px 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.navbar .nav-container {
    max-width: 1100px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
}

.navbar .logo { color: #fff; font-size: 22px; font-weight: 700; text-decoration: none; letter-spacing: 1px; }

.navbar .nav-links { display: flex; gap: 20px; flex-wrap: wrap; }

.navbar .nav-links a {
    color: rgba(255,255,255,0.85); text-decoration: none;
    font-size: 14px; transition: color 0.2s;
}

.navbar .nav-links a:hover { color: var(--accent-color); }

/* ========== Bookmark Floating Button ========== */
.bookmark-btn {
    position: fixed;
    bottom: 32px;
    right: 28px;
    z-index: 999;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f0c040 0%, #e0a800 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(240, 192, 64, 0.45);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.bookmark-btn:hover {
    transform: scale(1.12);
    box-shadow: 0 6px 22px rgba(240, 192, 64, 0.6);
}

.bookmark-btn:active {
    transform: scale(0.94);
}

/* pulse animation */
.bookmark-btn::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(240, 192, 64, 0.5);
    animation: bookmarkPulse 2s ease-in-out infinite;
}

@keyframes bookmarkPulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.25); opacity: 0; }
}

/* ========== Toast Notification ========== */
.toast {
    position: fixed;
    bottom: 100px;
    right: 28px;
    z-index: 1000;
    background: #fff;
    color: #333;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    line-height: 1.6;
    max-width: 300px;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-left: 4px solid #f0c040;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.toast .toast-title {
    font-weight: 700;
    color: #1a2744;
    margin-bottom: 6px;
    font-size: 15px;
}

.toast .kbd {
    display: inline-block;
    background: #f0f2f5;
    border: 1px solid #d0d5dd;
    border-radius: 4px;
    padding: 2px 7px;
    font-family: 'Segoe UI', monospace;
    font-size: 12px;
    font-weight: 600;
    color: #2b3a67;
    margin: 0 2px;
}

.toast .toast-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #aaa;
    line-height: 1;
}

.toast .toast-close:hover {
    color: #555;
}

/* 响应式 */
@media (max-width: 768px) {
    .navbar .nav-container { flex-direction: column; text-align: center; }
    .lang-switcher { top: 8px; right: 8px; }
}

@media (max-width: 480px) {
    .bookmark-btn {
        width: 46px;
        height: 46px;
        bottom: 20px;
        right: 16px;
        font-size: 20px;
    }
    .toast {
        bottom: 80px;
        right: 16px;
        max-width: 260px;
        font-size: 13px;
    }
}
