/* ==========================================================================
   浩保行项目测试平台 - 样式表
   ========================================================================== */

/* ---------- 变量定义 ---------- */
:root {
    /* 背景色 */
    --bg-base: #0a0e1a;
    --bg-sidebar: #0d1220;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --bg-input: rgba(255, 255, 255, 0.05);
    --bg-modal: #0f1525;

    /* 边框 */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-card: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(99, 102, 241, 0.3);

    /* 文字 */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* 主题色 */
    --accent-blue: #0ea5e9;
    --accent-indigo: #6366f1;
    --accent-cyan: #06b6d4;
    --accent-gradient: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);

    /* 状态色 */
    --status-done: #10b981;
    --status-done-bg: rgba(16, 185, 129, 0.12);
    --status-pending: #f59e0b;
    --status-pending-bg: rgba(245, 158, 11, 0.12);

    /* 尺寸 */
    --sidebar-w: 260px;
    --sidebar-collapsed: 0px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* 动画 */
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* 阴影 */
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--border-hover);
    --shadow-modal: 0 24px 80px rgba(0, 0, 0, 0.6);
}

/* ---------- 重置 ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* 背景装饰 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 800px 600px at 20% 0%, rgba(14, 165, 233, 0.08), transparent),
        radial-gradient(ellipse 600px 400px at 80% 100%, rgba(99, 102, 241, 0.06), transparent);
    pointer-events: none;
    z-index: 0;
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   加载动画
   ========================================================================== */
.loader-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-base);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.loader-ring {
    width: 56px;
    height: 56px;
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

/* ==========================================================================
   侧边栏
   ========================================================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-slow);
    overflow: hidden;
}

.sidebar.collapsed {
    transform: translateX(calc(-1 * var(--sidebar-w)));
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.logo-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    display: flex;
}

.sidebar-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.sidebar-toggle svg {
    width: 20px;
    height: 20px;
}

.sidebar.collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
}

/* 导航 */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 8px 12px 4px;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    text-align: left;
    font-family: inherit;
}

.nav-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(14, 165, 233, 0.1);
    color: var(--accent-blue);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    width: 3px;
    height: 20px;
    background: var(--accent-gradient);
    border-radius: 0 3px 3px 0;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-item span:nth-child(2) {
    flex: 1;
}

.nav-badge {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 24px;
    text-align: center;
}

.nav-item.active .nav-badge {
    color: var(--accent-blue);
    background: rgba(14, 165, 233, 0.15);
}

/* 侧边栏底部 */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.progress-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.progress-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.progress-value {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--accent-blue);
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-detail {
    margin-top: 8px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* 管理后台链接 */
.admin-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    margin-top: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-decoration: none;
    transition: all var(--transition);
}

.admin-link:hover {
    background: var(--bg-card-hover);
    color: var(--accent-blue);
    border-color: var(--border-hover);
}

.admin-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* 主导航标签 */
.nav-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    text-align: left;
    font-family: inherit;
    position: relative;
    font-weight: 500;
}

.nav-tab:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.nav-tab.active {
    background: rgba(14, 165, 233, 0.1);
    color: var(--accent-blue);
}

.nav-tab.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--accent-gradient);
    border-radius: 0 3px 3px 0;
}

.nav-tab svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-tab span:not(.nav-badge) {
    flex: 1;
}

.nav-badge-red {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
}

/* Bug统计卡片 */
.bug-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.bug-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: all var(--transition);
}

.bug-stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.bug-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bug-stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.bug-stat-num {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}

/* Bug工具栏 */
.bug-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.bug-filter-select {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    color: var(--text-primary);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
}

.bug-filter-select:hover {
    border-color: var(--border-hover);
}

.bug-filter-select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

/* Bug列表 */
.bug-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bug-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    transition: all var(--transition);
    animation: cardIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.bug-item:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

.bug-priority-badge {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.bug-priority-badge.p0 { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.bug-priority-badge.p1 { background: rgba(249, 115, 22, 0.15); color: #f97316; }
.bug-priority-badge.p2 { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.bug-priority-badge.p3 { background: rgba(14, 165, 233, 0.15); color: #0ea5e9; }
.bug-priority-badge.p4 { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.bug-priority-badge.p5 { background: rgba(100, 116, 139, 0.15); color: #64748b; }

.bug-content {
    flex: 1;
    min-width: 0;
}

.bug-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.bug-id {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.bug-status-tag {
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.bug-status-tag.s-pending { background: rgba(100, 116, 139, 0.15); color: #94a3b8; }
.bug-status-tag.s-fixing { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.bug-status-tag.s-review { background: rgba(14, 165, 233, 0.15); color: #0ea5e9; }
.bug-status-tag.s-reopen { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.bug-status-tag.s-closed { background: rgba(16, 185, 129, 0.15); color: #10b981; }

.bug-terminal-tag {
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}

.bug-module-tag {
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-indigo);
}

.bug-desc {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bug-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.bug-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.bug-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.bug-action-btn {
    padding: 5px 12px;
    font-size: 0.72rem;
    border: 1px solid var(--border-card);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

.bug-action-btn:hover {
    border-color: var(--border-hover);
    color: var(--accent-blue);
    background: rgba(14, 165, 233, 0.08);
}

.bug-action-btn.close-btn:hover {
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--status-done);
    background: rgba(16, 185, 129, 0.08);
}

.bug-action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ==========================================================================
   主内容区
   ========================================================================== */
.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    transition: margin-left var(--transition-slow);
    position: relative;
    z-index: 1;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 0;
}

/* 顶部栏 */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(13, 18, 32, 0.8);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.menu-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.menu-btn svg {
    width: 22px;
    height: 22px;
}

.topbar-title h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.topbar-title p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.topbar-right {
    display: flex;
    gap: 12px;
}

.stat-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    min-width: 80px;
    transition: all var(--transition);
}

.stat-chip:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.stat-num {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-done .stat-num { color: var(--status-done); }
.stat-pending .stat-num { color: var(--status-pending); }
.stat-total .stat-num { color: var(--accent-blue); }

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ==========================================================================
   模块区域
   ========================================================================== */
.modules-section {
    padding: 28px 32px 40px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.view-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.view-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 5px;
    transition: all var(--transition);
    display: flex;
}

.view-btn:hover {
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--bg-card-hover);
    color: var(--accent-blue);
}

.view-btn svg {
    width: 18px;
    height: 18px;
}

/* 模块网格 */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.modules-grid.list-view {
    grid-template-columns: 1fr;
}

/* 模块卡片 */
.module-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 0;
    cursor: pointer;
    transition: all var(--transition);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    animation: cardIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.module-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.module-card:hover .module-card-icon {
    transform: scale(1.1) rotate(-5deg);
}

/* 卡片头部 */
.module-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 20px 0;
}

.module-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform var(--transition);
    position: relative;
}

.module-card-icon svg {
    width: 26px;
    height: 26px;
    color: #fff;
}

.module-card-icon.pending-icon {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
}

.module-card-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
}

.module-card-status.available {
    background: var(--status-done-bg);
    color: var(--status-done);
}

.module-card-status.pending {
    background: var(--status-pending-bg);
    color: var(--status-pending);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.module-card-status.available .status-dot {
    background: var(--status-done);
    box-shadow: 0 0 8px var(--status-done);
    animation: pulse 2s infinite;
}

.module-card-status.pending .status-dot {
    background: var(--status-pending);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 卡片内容 */
.module-card-body {
    padding: 16px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.module-card-code {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

.module-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.module-card-subtitle {
    font-size: 0.78rem;
    color: var(--accent-blue);
    margin-bottom: 10px;
}

.module-card-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.module-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.module-tag {
    font-size: 0.68rem;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    border-radius: 4px;
}

/* 卡片底部 */
.module-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
}

.module-card-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.module-card-meta svg {
    width: 13px;
    height: 13px;
}

.module-card-play {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-blue);
    transition: gap var(--transition);
}

.module-card-play svg {
    width: 16px;
    height: 16px;
    transition: transform var(--transition);
}

.module-card:hover .module-card-play {
    gap: 10px;
}

.module-card:hover .module-card-play svg {
    transform: translateX(2px);
}

.module-card.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.module-card.disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border-card);
}

.module-card.disabled .module-card-play {
    color: var(--text-muted);
}

.module-card.disabled:hover .module-card-play {
    gap: 6px;
}

.module-card.disabled:hover .module-card-play svg {
    transform: none;
}

/* 列表视图 */
.modules-grid.list-view .module-card {
    flex-direction: row;
    align-items: center;
    padding: 16px 20px;
}

.modules-grid.list-view .module-card-head {
    padding: 0;
    flex-shrink: 0;
    margin-right: 20px;
}

.modules-grid.list-view .module-card-body {
    padding: 0;
    flex: 1;
}

.modules-grid.list-view .module-card-desc {
    -webkit-line-clamp: 1;
}

.modules-grid.list-view .module-card-foot {
    border-top: none;
    padding-top: 0;
    margin-left: 20px;
    flex-shrink: 0;
}

/* ==========================================================================
   底部
   ========================================================================== */
.footer {
    padding: 24px 32px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.78rem;
    border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   视频弹窗
   ========================================================================== */
.video-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.video-modal.active {
    display: flex;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.video-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.video-modal-container {
    position: relative;
    width: 100%;
    max-width: 960px;
    max-height: 90vh;
    background: var(--bg-modal);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-modal);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.video-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.video-modal-title {
    flex: 1;
}

.video-modal-code {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--accent-blue);
    font-weight: 600;
    letter-spacing: 0.1em;
    background: rgba(14, 165, 233, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
}

.video-modal-title h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.video-modal-title p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.video-modal-close {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
    margin-left: 16px;
}

.video-modal-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.video-modal-close svg {
    width: 20px;
    height: 20px;
}

.video-modal-body {
    overflow-y: auto;
    flex: 1;
}

.video-modal-layout {
    display: flex;
    gap: 0;
    min-height: 100%;
}

.video-modal-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.video-wrapper {
    background: #000;
    width: 100%;
    aspect-ratio: 16 / 9;
    flex-shrink: 0;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    display: block;
}

.video-modal-info {
    padding: 20px 24px;
}

/* 视频播放列表 */
.video-playlist {
    width: 240px;
    flex-shrink: 0;
    border-left: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.15);
}

.playlist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.playlist-header h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.playlist-count {
    font-size: 0.72rem;
    color: var(--accent-blue);
    background: rgba(14, 165, 233, 0.1);
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.playlist-items {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 4px;
}

.playlist-item:hover {
    background: var(--bg-card-hover);
}

.playlist-item.active {
    background: rgba(14, 165, 233, 0.1);
}

.playlist-item-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 600;
    flex-shrink: 0;
}

.playlist-item.active .playlist-item-num {
    background: var(--accent-gradient);
    color: #fff;
}

.playlist-item-info {
    flex: 1;
    min-width: 0;
}

.playlist-item-name {
    font-size: 0.78rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item-meta {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.playlist-item.active .playlist-item-name {
    color: var(--accent-blue);
    font-weight: 600;
}

.video-info-item {
    margin-bottom: 16px;
}

.video-info-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
    font-weight: 600;
}

.video-info-item p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.video-info-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.video-info-meta .video-info-item {
    margin-bottom: 0;
}

.video-info-meta span:not(.video-info-label) {
    font-size: 0.82rem;
    color: var(--text-primary);
}

.video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.video-tags .module-tag {
    font-size: 0.72rem;
    padding: 4px 10px;
}

/* Bug列表中的附图指示 */
.bug-image-indicator {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(168, 85, 247, 0.12);
    color: #a855f7;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.bug-image-indicator:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.3);
}

.bug-image-indicator svg {
    width: 12px;
    height: 12px;
}

.bug-content {
    cursor: pointer;
}

/* ==========================================================================
   Bug详情弹窗
   ========================================================================== */
.bug-detail-modal {
    position: fixed;
    inset: 0;
    z-index: 210;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.bug-detail-modal.active {
    display: flex;
    animation: modalIn 0.3s ease;
}

.bug-detail-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.bug-detail-container {
    position: relative;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    background: var(--bg-modal);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-modal);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.bug-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.bug-detail-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.bug-detail-id {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-blue);
    font-family: 'SF Mono', 'Fira Code', monospace;
    background: rgba(14, 165, 233, 0.1);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.bug-detail-status {
    font-size: 0.72rem;
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: 600;
    flex-shrink: 0;
}

.bug-detail-close {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
    margin-left: 16px;
}

.bug-detail-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.bug-detail-close svg {
    width: 20px;
    height: 20px;
}

.bug-detail-body {
    overflow-y: auto;
    flex: 1;
    padding: 24px;
}

.bug-detail-desc {
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.7;
    margin-bottom: 20px;
    white-space: pre-wrap;
    word-break: break-word;
}

.bug-detail-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.bug-detail-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bug-detail-meta-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.bug-detail-meta-value {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.bug-detail-section {
    margin-top: 8px;
}

.bug-detail-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
}

.bug-detail-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.bug-detail-image {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--border-card);
    background: var(--bg-card);
    transition: all var(--transition);
    aspect-ratio: 4 / 3;
}

.bug-detail-image:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.bug-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition);
}

.bug-detail-image:hover img {
    transform: scale(1.05);
}

.bug-detail-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    font-size: 0.72rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 4px;
}

.bug-detail-image-overlay svg {
    width: 14px;
    height: 14px;
}

.bug-detail-no-image {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ==========================================================================
   图片大图预览
   ========================================================================== */
.image-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.image-preview-modal.active {
    display: flex;
    animation: modalIn 0.3s ease;
}

.image-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(4px);
}

.image-preview-modal img {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    animation: modalSlideIn 0.3s ease;
}

.image-preview-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    z-index: 2;
}

.image-preview-close:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
}

.image-preview-close svg {
    width: 24px;
    height: 24px;
}

.image-preview-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    z-index: 2;
}

.image-preview-nav:hover {
    background: rgba(14, 165, 233, 0.3);
    border-color: rgba(14, 165, 233, 0.5);
}

.image-preview-nav.prev {
    left: 20px;
}

.image-preview-nav.next {
    right: 20px;
}

.image-preview-nav svg {
    width: 28px;
    height: 28px;
}

@media (max-width: 768px) {
    .bug-detail-modal,
    .image-preview-modal {
        padding: 0;
    }

    .bug-detail-container {
        max-height: 100vh;
        border-radius: 0;
        border: none;
    }

    .bug-detail-meta {
        grid-template-columns: 1fr;
    }

    .bug-detail-gallery {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .image-preview-nav {
        width: 40px;
        height: 40px;
    }

    .image-preview-nav.prev { left: 10px; }
    .image-preview-nav.next { right: 10px; }
}

/* ==========================================================================
   Toast 提示
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--bg-modal);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    box-shadow: var(--shadow-hover);
    animation: toastIn 0.3s ease;
    max-width: 360px;
}

.toast.removing {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--status-done); }
.toast.warning .toast-icon { color: var(--status-pending); }
.toast.error .toast-icon { color: #ef4444; }
.toast.info .toast-icon { color: var(--accent-blue); }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(calc(-1 * var(--sidebar-w)));
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-btn {
        display: flex;
    }

    .sidebar-toggle {
        display: none;
    }
}

@media (max-width: 768px) {
    .topbar {
        padding: 16px 20px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .topbar-right {
        width: 100%;
        justify-content: flex-start;
    }

    .stat-chip {
        min-width: 60px;
        padding: 6px 14px;
    }

    .stat-num {
        font-size: 1.15rem;
    }

    .modules-section {
        padding: 20px;
    }

    .modules-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .video-modal {
        padding: 0;
    }

    .video-modal-container {
        max-height: 100vh;
        border-radius: 0;
        border: none;
    }

    .video-modal-layout {
        flex-direction: column;
    }

    .video-playlist {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border-subtle);
        max-height: 240px;
    }

    .video-info-meta {
        grid-template-columns: 1fr;
    }

    .footer {
        padding: 16px 20px;
    }
}

@media (max-width: 480px) {
    .topbar-title h1 {
        font-size: 1.1rem;
    }

    .module-card-head {
        padding: 16px 16px 0;
    }

    .module-card-body {
        padding: 12px 16px 16px;
    }
}
