/* static/style.css - 2025 修复完整版 */

:root {
    /* 主色调 */
    --primary: #0ea5e9;
    --primary-soft: rgba(14, 165, 233, 0.1);
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    /* 背景与文字 */
    --bg-body: #f8fafc;
    --text-main: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    /* 尺寸与圆角 */
    --nav-height: 64px;
    --content-max-width: 1200px;
    --radius-lg: 16px;
    --radius-md: 10px;
    --shadow-soft: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    padding-top: var(--nav-height);
    line-height: 1.6;
}

/* === 背景动画 === */
.bg-animation { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.5; }
.orb-1 { width: 60vh; height: 60vh; background: #e0f2fe; top: -10%; left: -10%; }
.orb-2 { width: 50vh; height: 50vh; background: #f0f9ff; bottom: -10%; right: -10%; }

.app-container { max-width: var(--content-max-width); margin: 0 auto; padding: 20px; }

/* === 导航栏 === */
.nav-container {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    height: var(--nav-height);
    display: flex; align-items: center; justify-content: center; padding: 0 20px;
}
.nav-links { display: flex; gap: 8px; overflow-x: auto; padding: 4px; scrollbar-width: none; }
.nav-item { 
    text-decoration: none; color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; 
    padding: 8px 16px; border-radius: 20px; transition: all 0.2s; white-space: nowrap;
}
.nav-item:hover { color: var(--primary); background: #f1f5f9; }
.nav-item.active { background: var(--text-main); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

/* === 通用卡片 === */
.glass-card {
    background: #fff; border-radius: var(--radius-lg);
    padding: 24px; margin-bottom: 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255,255,255,0.6);
}

/* === 首页特定样式 (已恢复) === */
.page-header { text-align: center; margin: 30px 0; }
.page-header h1 { font-size: 2rem; margin: 0 0 10px; color: var(--text-main); letter-spacing: -1px; }
.time-container { text-align: center; margin-bottom: 40px; }
.time-big { font-size: 3rem; font-weight: 800; color: var(--primary); line-height: 1; margin-bottom: 5px; font-variant-numeric: tabular-nums; }
.date-line { color: var(--text-secondary); font-size: 0.95rem; display: flex; gap: 10px; justify-content: center; }

.search-bar-wrapper { position: relative; max-width: 500px; margin: 0 auto 30px; }
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-input { padding-left: 45px !important; border-radius: 50px !important; border: 1px solid #e2e8f0; box-shadow: 0 2px 10px rgba(0,0,0,0.03); }

/* 工具网格布局 */
.category-header { font-size: 1.1rem; font-weight: 700; margin: 30px 0 15px; display: flex; align-items: center; gap: 8px; color: var(--text-main); }
.category-header i { color: var(--primary); opacity: 0.8; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }

.tool-card {
    display: flex; align-items: center; padding: 20px;
    background: #fff; border: 1px solid #f1f5f9; border-radius: var(--radius-lg);
    text-decoration: none; transition: all 0.2s ease; position: relative; overflow: hidden;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08); border-color: var(--primary-soft); }
.tool-icon {
    width: 48px; height: 48px; border-radius: 12px; background: #f0f9ff;
    color: var(--primary); display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; margin-right: 15px; flex-shrink: 0; transition: transform 0.3s;
}
.tool-card:hover .tool-icon { transform: scale(1.1) rotate(5deg); background: var(--primary); color: #fff; }
.tool-info { flex: 1; min-width: 0; }
.tool-title { font-weight: 700; color: var(--text-main); font-size: 1.05rem; margin-bottom: 4px; }
.tool-desc { font-size: 0.85rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* === 表单元素美化 === */
input, select, textarea {
    width: 100%; padding: 10px 14px; border: 1px solid #cbd5e1;
    border-radius: var(--radius-md); font-size: 0.95rem; color: var(--text-main);
    background: #fff; outline: none; transition: border 0.2s; font-family: inherit;
}
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

.select-wrapper { position: relative; }
select { appearance: none; padding-right: 35px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }

.input-group-modern { display: flex; gap: 10px; padding: 6px; background: #fff; border: 1px solid #e2e8f0; border-radius: var(--radius-lg); box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.modern-select { border: none !important; height: 42px; background: transparent !important; }
.btn-search-modern { padding: 0 28px !important; border-radius: 10px !important; }

/* === 表格系统 === */
.table-responsive { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid #f1f5f9; }
.result-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 0.9rem; }
.result-table th { background: #f8fafc; color: var(--text-secondary); font-weight: 600; padding: 12px 16px; text-align: left; white-space: nowrap; border-bottom: 1px solid #e2e8f0; }
.result-table td { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; color: var(--text-main); vertical-align: middle; }
.result-table tr:hover { background: #f8fafc; }

/* 表格列宽控制 (修复收藏列表标题过长) */
.col-title { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.col-id { font-family: 'Consolas', monospace; color: var(--text-muted); letter-spacing: 0.5px; }

/* === 统计与详情页 === */
.stats-dashboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px; margin: 20px 0; }
.stat-box { background: #fff; border: 1px solid #e2e8f0; border-radius: var(--radius-lg); padding: 20px; text-align: center; }
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--text-main); line-height: 1.2; }
.stat-label { font-size: 0.9rem; color: var(--text-muted); margin-top: 5px; }
.stat-sub { font-size: 0.8rem; background: #f1f5f9; padding: 2px 8px; border-radius: 10px; display: inline-block; margin-top: 5px; color: var(--text-secondary); }

/* 板块详情页布局 (修复样式怪异) */
.chart-table-wrapper { display: grid; grid-template-columns: 1fr 1.5fr; gap: 20px; margin-top: 20px; align-items: start; }
.detail-table-container { background: #fff; border: 1px solid #e2e8f0; border-radius: var(--radius-lg); overflow: hidden; max-height: 450px; overflow-y: auto; }
.detail-table-container h4, .detail-chart-container h4 { margin: 0 0 15px 0; padding: 15px; border-bottom: 1px solid #f1f5f9; background: #fcfcfc; font-size: 1rem; }
.detail-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.detail-table th { position: sticky; top: 0; background: #f8fafc; z-index: 10; padding: 10px 15px; text-align: left; }
.detail-table td { padding: 10px 15px; border-bottom: 1px solid #f1f5f9; }
.detail-chart-container { background: #fff; border: 1px solid #e2e8f0; border-radius: var(--radius-lg); padding-bottom: 15px; height: 450px; display: flex; flex-direction: column; }

/* 排行榜样式 */
.ranking-item { display: flex; align-items: center; padding: 15px; margin-bottom: 12px; border: 1px solid #f1f5f9; transition: transform 0.2s; }
.ranking-item:hover { transform: translateX(5px); border-color: var(--primary-soft); }

/* === 按钮 === */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; border-radius: var(--radius-md); font-weight: 600; border: none; cursor: pointer; transition: all 0.2s; font-size: 0.95rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--text-main); color: #fff; }
.btn-primary:hover { background: #334155; }
.btn-secondary { background: #fff; border: 1px solid #cbd5e1; color: var(--text-main); }
.btn-secondary:hover { background: #f8fafc; border-color: var(--text-muted); }

/* 小按钮 & 边框按钮 */
.btn-outline-xs { background: transparent; border: 1px solid #cbd5e1; color: var(--text-secondary); padding: 4px 10px; font-size: 0.8rem; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.btn-outline-xs:hover { border-color: var(--text-main); color: var(--text-main); background: #fff; }

/* 状态标签 */
.tag-success { background: rgba(16, 185, 129, 0.1); color: #059669; padding: 4px 8px; border-radius: 6px; font-size: 0.8rem; font-weight: 600; }
.tag-error { background: rgba(239, 68, 68, 0.1); color: #dc2626; padding: 4px 8px; border-radius: 6px; font-size: 0.8rem; font-weight: 600; }

/* === 移动端适配 === */
@media (max-width: 768px) {
    .nav-container { padding: 0 15px; height: 56px; justify-content: start; }
    .nav-links { width: 100%; gap: 10px; }
    .nav-item { padding: 6px 12px; font-size: 0.85rem; }
    
    .chart-table-wrapper { grid-template-columns: 1fr; }
    .detail-chart-container { height: 350px; }
    .time-big { font-size: 2.2rem; }
    
    .input-group-modern { flex-direction: column; }
    .btn-search-modern { width: 100%; }
}
/* static/style.css - 追加或修改 */

/* ... (保留原有样式) ... */

/* [新增] 日志容器样式 - 解决无限拉长问题 */
.log-box {
    height: 250px; /* 固定高度 */
    overflow-y: auto; /* 超出内容显示滚动条 */
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 12px;
    font-family: 'Consolas', monospace; /* 等宽字体更像日志 */
    font-size: 0.85rem;
    color: var(--text-secondary);
    scroll-behavior: smooth;
}

/* 按钮组样式微调 */
.action-buttons .btn {
    flex: 1; /* 按钮平分宽度 */
}