/* ========================================
   现代 UI 组件样式
   包含: 返回顶部 / Toast / 面包屑 / 手风琴 / 标签页增强
   ======================================== */

/* ---- 返回顶部按钮 ---- */
.scroll-top-btn {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity var(--transition), transform var(--transition);
    z-index: 998;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-secondary);
}
.scroll-top-btn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.scroll-top-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ---- Toast 消息提示 ---- */
.toast-container {
    position: fixed;
    top: 88px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary);
    font-size: 15px;
    color: var(--text);
    min-width: 280px;
    max-width: 420px;
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease, toastSlideOut 0.3s ease 3.7s forwards;
}
.toast.success { border-left-color: var(--primary); }
.toast.error { border-left-color: var(--cta); }
.toast.info { border-left-color: var(--accent); }
.toast-icon { font-size: 20px; flex-shrink: 0; }
.toast-msg { flex: 1; line-height: 1.4; }

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toastSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100px); }
}

/* ---- 面包屑导航 ---- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 0;
    font-size: 14px;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.breadcrumb a {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep {
    color: var(--border);
    user-select: none;
}
.breadcrumb .current {
    color: var(--text);
    font-weight: 500;
}

/* ---- 手风琴/折叠面板 ---- */
.accordion {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.accordion-item { border-bottom: 1px solid var(--border); }
.accordion-item:last-child { border-bottom: none; }
.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: var(--bg);
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    transition: background var(--transition-fast);
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}
.accordion-header:hover { background: var(--bg-secondary); }
.accordion-header::after {
    content: '+';
    font-size: 20px;
    color: var(--text-muted);
    transition: transform var(--transition);
    flex-shrink: 0;
    margin-left: 16px;
}
.accordion-item.open .accordion-header::after {
    content: '\2212';
    transform: rotate(180deg);
}
.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
}
.accordion-item.open .accordion-body {
    max-height: 2000px;
}
.accordion-content {
    padding: 0 24px 24px;
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ---- 标签页/筛选按钮增强 ---- */
.tab-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    position: relative;
}
.tab-btn {
    padding: 10px 24px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    position: relative;
}
.tab-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-bg);
}
.tab-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
    transform: scale(1.02);
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 24px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    transition: transform var(--transition);
}
.tab-btn.active::after {
    transform: translateX(-50%) scaleX(1);
}

/* ---- 响应式 ---- */
/* ---- 暗色模式切换按钮 ---- */
.dark-mode-toggle {
    position: fixed;
    bottom: 148px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
    background: #fff;
    font-size: 20px;
    cursor: pointer;
    z-index: 9998;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dark-mode-toggle:hover { transform: scale(1.1); box-shadow: 0 4px 20px rgba(0,0,0,0.15); }

/* 暗色模式：统一由 animation-a11y.css 管理
   支持 @media (prefers-color-scheme: dark) + html.dark-mode 手动切换 */

@media (max-width: 768px) {
    .scroll-top-btn { bottom: 84px; right: 16px; width: 42px; height: 42px; }
    .dark-mode-toggle { bottom: 132px; right: 16px; width: 42px; height: 42px; }
    .toast-container { right: 12px; left: 12px; }
    .toast { min-width: unset; max-width: unset; }
}
