/**
 * 多策略选股系统 - 样式表
 */

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

/* CSS变量 - 统一设计系统 */
:root {
    /* 品牌色 */
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --primary-light: #7f9cf5;

    /* 状态色 */
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --danger-color: #f56565;
    --info-color: #4299e1;

    /* A股红绿 */
    --stock-up: #ff4d4f;
    --stock-down: #52c41a;

    /* 中性色 */
    --gray-50: #f9fafb;
    --gray-100: #f7fafc;
    --gray-200: #edf2f7;
    --gray-300: #e2e8f0;
    --gray-400: #cbd5e0;
    --gray-500: #a0aec0;
    --gray-600: #718096;
    --gray-700: #4a5568;
    --gray-800: #2d3748;
    --gray-900: #1a202c;

    /* 渐变 */
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-gradient-success: linear-gradient(135deg, var(--success-color) 0%, #38a169 100%);
    --bg-gradient-danger: linear-gradient(135deg, var(--danger-color) 0%, #e53e3e 100%);
    --bg-gradient-warning: linear-gradient(135deg, #fa8c16 0%, #ffc53d 100%);

    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 10px 20px rgba(0, 0, 0, 0.12);

    /* 间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* 头部高度 */
    --header-height: 70px;
}

/* 基础布局 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--gray-800);
    min-height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 通用工具类 */
.hidden {
    display: none !important;
}

.block {
    display: block;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-sm {
    gap: var(--spacing-sm);
}

.gap-md {
    gap: var(--spacing-md);
}

.gap-lg {
    gap: var(--spacing-lg);
}

.w-full {
    width: 100%;
}

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

.text-right {
    text-align: right;
}

.font-bold {
    font-weight: 700;
}

.cursor-pointer {
    cursor: pointer;
}

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.overflow-hidden {
    overflow: hidden;
}

/* ========== 头部 ========== */
.header {
    background: var(--bg-gradient);
    padding: 0 40px;
    height: var(--header-height);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.25);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.header h1 {
    font-size: 26px;
    font-weight: 700;
    color: white;
    position: relative;
    z-index: 1;
    letter-spacing: -0.5px;
}

.header div {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 14px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

/* ========== 容器布局 ========== */
.container {
    display: flex;
    height: calc(100vh - var(--header-height));
    margin-top: var(--header-height);
    overflow: hidden;
}

/* ========== 侧边栏 ========== */
.sidebar {
    width: 240px;
    background: white;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.04);
    padding: 30px 0;
    position: fixed;
    left: 0;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    z-index: 100;
}

.menu-item {
    display: block;
    padding: 14px 28px;
    margin: 4px 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-700);
    position: relative;
    text-decoration: none;
}

.menu-item:hover {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
    color: var(--primary-color);
    transform: translateX(4px);
}

.menu-item.active {
    background: var(--bg-gradient);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ========== 主内容区 ========== */
.main-content {
    flex: 1;
    padding: 40px;
    margin-left: 240px;
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    overflow-x: hidden;
    background-color: transparent;
    /* Variable background handled by body */
}

/* ========== 卡片样式 ========== */
.card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(102, 126, 234, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--bg-gradient);
    border-radius: 4px;
}

/* ========== 表单样式 ========== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 14px;
}

.form-select,
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 16px;
    transition: all 0.3s;
    background: var(--gray-100);
    color: var(--gray-800);
}

/* 统一select样式，去除默认外观 */
.form-select,
select.form-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667eea' 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 12px center;
    background-size: 20px;
    padding-right: 40px;
    cursor: pointer;
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* 确保日期和文本输入框占满宽度 */
input[type="date"],
input[type="text"],
input[type="number"] {
    width: 100% !important;
    box-sizing: border-box;
    max-width: 100%;
    display: block;
}

/* 针对日期输入框的额外样式 */
input[type="date"].form-input {
    width: 100% !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* ========== 按钮样式 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    color: white;
}

/* 按钮点击波纹效果 */
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    pointer-events: none;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--gray-400);
    box-shadow: none;
    pointer-events: none;
}

/* 按钮变体 */
.btn-primary {
    background: var(--bg-gradient);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: var(--bg-gradient-success);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

.btn-danger {
    background: var(--bg-gradient-danger);
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #667eea 0%, #5a67d8 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 6px;
}

/* ========== Segment Control ========== */
.segment-control {
    display: inline-flex;
    background: #f0f0f0;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.segment-btn {
    padding: 6px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.segment-btn:hover {
    color: #333;
}

.segment-btn.active {
    background: white;
    color: #262626;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ========== 进度条 ========== */
.progress-container {
    margin: 24px 0;
}

.progress-bar {
    width: 100%;
    height: 28px;
    background: linear-gradient(135deg, var(--gray-300) 0%, var(--gray-400) 100%);
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.progress-fill {
    height: 100%;
    background: var(--bg-gradient);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 13px;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 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-info {
    margin-top: 12px;
    font-size: 14px;
    color: var(--gray-600);
    font-weight: 500;
}

/* ========== 日志窗口 ========== */
.log-container {
    background: var(--gray-900);
    color: #d4d4d4;
    border-radius: var(--radius-sm);
    padding: 15px;
    height: 400px;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.log-entry {
    margin: 3px 0;
    word-wrap: break-word;
}

.log-success {
    color: var(--stock-down);
}

/* Green for success/down in A-share context logic? No, logs usually green=success */
.log-error {
    color: var(--stock-up);
}

/* Red for error */
.log-warning {
    color: var(--warning-color);
}

.log-info {
    color: var(--info-color);
}

.log-success:has(*)::before,
.log-success {
    font-weight: 500;
}

.log-stock {
    background: rgba(82, 196, 26, 0.15);
    padding: 6px 10px;
    border-radius: 4px;
    border-left: 3px solid var(--stock-down);
    font-weight: 600;
    color: #73d13d !important;
}

/* ========== 页面显示控制 ========== */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* ========== 表格样式 ========== */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    overflow: hidden;
    table-layout: fixed;
}

.table th.col-tags,
.table td.col-tags,
.table th.col-reason,
.table td.col-reason {
    min-width: 300px;
    width: 300px;
}

.table th,
.table td {
    padding: 16px;
    text-align: inherit;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 13px;
    border-bottom: 2px solid var(--gray-300);
}

.table th:first-child {
    border-top-left-radius: var(--radius-md);
}

.table th:last-child {
    border-top-right-radius: var(--radius-md);
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ========== 股票结果卡片 ========== */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stock-result-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 20px;
    border: 2px solid transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.stock-result-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.2);
    transform: translateY(-4px);
}

.stock-code {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
    letter-spacing: -0.5px;
}

.stock-name {
    font-size: 18px;
    color: var(--gray-800);
    font-weight: 700;
}

.stock-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 4px;
}

.metric-item {
    font-size: 13px;
    padding: 8px;
    background: var(--gray-100);
    border-radius: var(--radius-md);
}

.metric-label {
    color: var(--gray-500);
    margin-right: 4px;
    font-size: 12px;
}

.metric-value {
    font-weight: 700;
    color: var(--gray-800);
    font-size: 14px;
}

.metric-value.positive {
    color: var(--success-color);
}

.metric-value.negative {
    color: var(--danger-color);
}

/* 涨跌幅通用类 */
.stock-up {
    color: var(--stock-up) !important;
}

.stock-down {
    color: var(--stock-down) !important;
}

/* ========== 加载动画 ========== */
.loading-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 4px solid rgba(102, 126, 234, 0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-600);
}

.loading-text p {
    margin-top: 16px;
    font-weight: 500;
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--gray-500);
}

.empty-state-icon {
    font-size: 72px;
    margin-bottom: 20px;
    opacity: 0.4;
    filter: grayscale(1);
}

.empty-state p {
    font-size: 16px;
    font-weight: 500;
}

/* ========== 移动端底部导航 ========== */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    padding: 8px 0;
}

.mobile-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-item {
    flex: 1;
    text-align: center;
    padding: 6px 2px;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--gray-600);
    font-size: 10px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mobile-nav-item .icon {
    font-size: 18px;
    display: block;
    margin-bottom: 3px;
}

.mobile-nav-item.active {
    color: var(--primary-color);
    font-weight: 600;
}


/* ========== 策略检测表单 ========== */
.check-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
    align-items: end;
}

.check-form-grid .btn {
    height: 44px;
    white-space: nowrap;
    padding: 0 24px;
}

/* ========== 分页组件样式 ========== */
.pagination-container {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: nowrap;
    /* PC端默认不换行 */
    justify-content: flex-start;
}



/* ========================================
   监控页面样式
   ======================================== */

/* 监控状态指示器 */
.status-running {
    color: #52c41a;
    animation: pulse 2s infinite;
}

.status-paused {
    color: #faad14;
}

.status-stopped {
    color: #8c8c8c;
}

.status-error {
    color: #ff4d4f;
}

/* 脉冲动画 */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* 监控统计卡片增强 */
#page-monitor .card>div[style*="grid-template-columns"]>div {
    transition: all 0.3s ease;
}

#page-monitor .card>div[style*="grid-template-columns"]>div:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* ========== 按钮组样式 ========== */
.btn-group {
    display: inline-flex;
    gap: 8px;
}

.btn-small {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 6px;
    background: #f0f0f0;
    color: #595959;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-small:hover {
    background: #e0e0e0;
}

.btn-small.active {
    background: var(--primary-color);
    color: white;
}

/* ========== 数据表格样式 ========== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
}

.data-table th {
    background: #fafafa;
    font-weight: 600;
    color: #262626;
    font-size: 13px;
}

.data-table tbody tr:hover {
    background: #fafafa;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* 涨跌颜色 */
.text-rise {
    color: #f5222d;
}

.text-fall {
    color: #52c41a;
}

/* ========== Toast提示 ========== */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    animation: fadeInUp 0.3s ease;
}

.toast.error {
    background: rgba(245, 34, 45, 0.9);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ========== 自定义滚动条样式 ========== */
.sidebar::-webkit-scrollbar,
.main-content::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track,
.main-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb,
.main-content::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.main-content::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

/* 分页控件横向滚动条 - 隐藏但保留滚动功能 */
#tasks-container div[style*="overflow-x"] {
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

#tasks-container div[style*="overflow-x"]::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari/Opera */
}

/* ========== 行业涨幅榜样式 - 东方财富风格 ========== */

/* 板块排行页面顶部工具栏 - 统一间距，与其他页面一致 */
#page-industry .card[style*="padding: 0"]>div:first-child,
#page-industry .card>div[style*="padding: 28px"],
#page-industry .card>div[style*="padding: 16px"] {
    padding-top: 28px !important;
    padding-left: 28px !important;
    padding-right: 28px !important;
    padding-bottom: 15px !important;
}

/* 移除板块排行页面顶部工具栏的分割线 */
#page-industry .card>div[style*="border-bottom"] {
    border-bottom: none !important;
}

/* 顶部工具栏 */
.industry-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

/* 左右分栏容器 */
.industry-container {
    display: flex;
    height: calc(100vh - 230px);
    min-height: 400px;
    background: white;
    padding-top: 0;
    margin-top: 0;
}

/* 左侧行业列表面板 */
.industry-left-panel {
    width: 280px;
    border-right: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    padding-top: 0;
    margin-top: 0;
}

.industry-list-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-size: 13px;
    color: #495057;
    font-weight: 600;
}

.industry-list-header .col-name {
    flex: 1;
}

.industry-list-header .col-change {
    width: 70px;
    text-align: right;
}

.industry-list-body {
    flex: 1;
    overflow-y: auto;
    padding-top: 0;
    margin-top: 0;
}

.industry-list-body>.loading-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
}

/* 行业表格 sticky 表头支持 */
.industry-list-body .table,
#industry-stocks-panel .table {
    overflow: visible;
    border-radius: 0;
    border: none;
    margin-top: 0;
    margin-bottom: 0;
}

/* 确保板块排行列表表格紧贴分割线 */
.industry-list-body .table {
    border-top: none;
}

/* 移除表头的顶部间距，使表格紧贴分割线 */
.industry-list-body .table thead {
    margin-top: 0;
    padding-top: 0;
}

.industry-list-body .table thead tr {
    margin-top: 0;
    padding-top: 0;
}

.industry-list-body .table thead th {
    border-top: none !important;
    /* 恢复正常的表头高度，保持默认的 padding */
    padding-top: 16px !important;
    padding-bottom: 16px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* 移除表头第一列和最后一列的圆角 */
.industry-list-body .table th:first-child {
    border-top-left-radius: 0;
}

.industry-list-body .table th:last-child {
    border-top-right-radius: 0;
}

/* 行业列表项 */
.industry-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: all 0.15s ease;
}

.industry-row:hover {
    background: #f5f7fa;
}

.industry-row.active {
    background: linear-gradient(135deg, #e8f4ff 0%, #d6e8ff 100%);
    border-left: 3px solid var(--primary-color);
    padding-left: 13px;
}

.industry-row .rank {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    margin-right: 10px;
    background: #f0f0f0;
    color: #8c8c8c;
}

.industry-row:nth-child(1) .rank {
    background: #ff4d4f;
    color: white;
}

.industry-row:nth-child(2) .rank {
    background: #ff7a45;
    color: white;
}

.industry-row:nth-child(3) .rank {
    background: #ffc53d;
    color: #614700;
}

.industry-row .name {
    flex: 1;
    font-size: 14px;
    color: #262626;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.industry-row .change {
    width: 70px;
    text-align: right;
    font-size: 14px;
    font-weight: 600;
}

.industry-row .change.rise {
    color: #cf1322;
}

.industry-row .change.fall {
    color: #389e0d;
}

/* 右侧股票详情面板 */
.industry-right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#industry-stocks-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#industry-stocks-panel .loading-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.industry-stocks-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #bfbfbf;
    font-size: 14px;
}

/* 股票面板头部 */
.industry-stocks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.industry-stocks-title {
    font-size: 16px;
    font-weight: 600;
}

.industry-stocks-subtitle {
    font-size: 12px;
    opacity: 0.9;
}

/* 股票表格 - 使用标准table */
.stocks-table-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.stocks-table-container .loading-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.stocks-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.stocks-table th,
.stocks-table td {
    padding: 12px 16px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.stocks-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    font-size: 13px;
    border-bottom: 2px solid #dee2e6;
}

.stocks-table tbody tr {
    transition: all 0.2s ease;
}

.stocks-table tbody tr:hover {
    background: #f8f9fa;
}

.stocks-table tbody tr:last-child td {
    border-bottom: none;
}

.stocks-table .rank-num {
    font-weight: 500;
    color: #595959;
}

.stocks-table .stock-code {
    color: #1890ff;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-weight: 500;
}

.stocks-table .stock-name {
    color: #262626;
    font-weight: 500;
}

.stocks-table .stock-price {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.stocks-table .change-rise {
    color: #cf1322;
    font-weight: 600;
}

.stocks-table .change-fall {
    color: #389e0d;
    font-weight: 600;
}

.btn-add-watchlist {
    padding: 6px 12px;
    font-size: 13px;
    background: var(--bg-gradient);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.btn-add-watchlist:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* 行业表格行选中样式 */
.industry-table-row.active {
    background: linear-gradient(135deg, #e8f4ff 0%, #d6e8ff 100%) !important;
}

.industry-table-row:hover {
    background: #f8f9fa;
}




/* ========================================
   龙头策略页面样式
   ======================================== */

/* 龙头策略区块标题 */
.leader-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #262626;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}

/* 热点板块网格 */
.leader-boards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

/* 热点板块卡片 */
.leader-board-card {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.leader-board-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.leader-board-card .board-rank {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    margin-right: 12px;
    background: #f0f0f0;
    color: #8c8c8c;
}

.leader-board-card:nth-child(1) .board-rank {
    background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%);
    color: white;
}

.leader-board-card:nth-child(2) .board-rank {
    background: linear-gradient(135deg, #ff7a45 0%, #ffa940 100%);
    color: white;
}

.leader-board-card:nth-child(3) .board-rank {
    background: linear-gradient(135deg, #ffc53d 0%, #ffe58f 100%);
    color: #614700;
}

.leader-board-card .board-info {
    flex: 1;
    min-width: 0;
}

.leader-board-card .board-name {
    font-size: 14px;
    font-weight: 600;
    color: #262626;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leader-board-card .board-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.leader-board-card .board-type {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.leader-board-card .board-type-industry {
    background: #e6f7ff;
    color: #1890ff;
}

.leader-board-card .board-type-concept {
    background: #fff7e6;
    color: #fa8c16;
}

.leader-board-card .board-limit-up {
    font-size: 11px;
    color: #ff4d4f;
    font-weight: 500;
}

.leader-board-card .board-stats {
    text-align: right;
}

.leader-board-card .board-change {
    font-size: 15px;
    font-weight: 700;
}

.leader-board-card .board-change.up {
    color: #ff4d4f;
}

.leader-board-card .board-change.down {
    color: #52c41a;
}

.leader-board-card .board-score {
    font-size: 11px;
    color: #8c8c8c;
    margin-top: 2px;
}

/* 龙头得分样式 */
.leader-score {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
}

.leader-score.score-high {
    background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%);
    color: white;
}

.leader-score.score-medium {
    background: linear-gradient(135deg, #fa8c16 0%, #ffc53d 100%);
    color: white;
}

.leader-score.score-normal {
    background: #f0f0f0;
    color: #595959;
}

/* 龙头排名样式 */
.leader-rank {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    background: #f0f0f0;
    color: #8c8c8c;
}

.leader-rank.top-rank {
    background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%);
    color: white;
}

/* 连板标记样式 */
.consecutive-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    background: #f0f0f0;
    color: #595959;
}

.consecutive-badge.consecutive-high {
    background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%);
    color: white;
}

.consecutive-badge.consecutive-medium {
    background: linear-gradient(135deg, #fa8c16 0%, #ffc53d 100%);
    color: white;
}

/* 热点板块标签 */
.board-tag {
    display: inline-block;
    padding: 2px 8px;
    margin: 2px 4px 2px 0;
    background: #f0f5ff;
    color: #1890ff;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* 龙虎榜标记 */
.lhb-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: #fff7e6;
    border: 1px solid #ffd591;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: help;
}

/* 空提示 */
.empty-hint {
    text-align: center;
    padding: 20px;
    color: #8c8c8c;
    font-size: 14px;
}

/* Toast动画 */
@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }

    15% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    85% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
}

/* ========== 一字涨停样式 ========== */

/* 一字涨停股票列表 */
.stock-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 一字涨停股票项 */
.stock-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
    cursor: pointer;
}

.stock-item:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

/* 左侧信息区域 */
.stock-item-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

/* 排名样式 */
.stock-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #f0f0f0 0%, #d9d9d9 100%);
    color: #8c8c8c;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.stock-item:nth-child(1) .stock-rank {
    background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%);
    color: white;
}

.stock-item:nth-child(2) .stock-rank {
    background: linear-gradient(135deg, #ff7a45 0%, #ffa940 100%);
    color: white;
}

.stock-item:nth-child(3) .stock-rank {
    background: linear-gradient(135deg, #ffc53d 0%, #ffe58f 100%);
    color: #614700;
}

/* 股票信息区域 */
.stock-info {
    flex: 1;
    min-width: 0;
}

.stock-name {
    font-size: 16px;
    font-weight: 600;
    color: #262626;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.stock-code {
    font-size: 13px;
    color: #8c8c8c;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

/* 右侧指标区域 */
.stock-item-right {
    flex-shrink: 0;
    margin-left: 16px;
}

/* 指标网格布局 */
.stock-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 20px;
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 80px;
}

.metric-label {
    font-size: 12px;
    color: #8c8c8c;
    margin-bottom: 4px;
    font-weight: 500;
}

.metric-value {
    font-size: 14px;
    font-weight: 600;
    color: #262626;
}

.metric-value.score-high {
    color: #ff4d4f;
    font-weight: 700;
}

.metric-value.score-medium {
    color: #fa8c16;
    font-weight: 600;
}

.metric-value.score-low {
    color: #52c41a;
    font-weight: 600;
}

/* 徽章样式 */
.badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
}

.badge-danger {
    background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%);
    color: white;
}

.badge-warning {
    background: linear-gradient(135deg, #fa8c16 0%, #ffc53d 100%);
    color: white;
}





/* 股票操作弹出菜单 */
.stock-popup-menu {
    position: fixed;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    min-width: 140px;
    overflow: hidden;
}

.stock-popup-header {
    padding: 10px 12px;
    background: #f5f5f5;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    border-bottom: 1px solid #eee;
}

.stock-popup-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.stock-popup-item:hover {
    background: #f0f7ff;
}

.stock-popup-item span {
    font-size: 14px;
}

/* iOS 风格弹出菜单 */
.ios-popup {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 14px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    min-width: 140px;
    padding: 4px;
    animation: iosPopupIn 0.2s ease-out;
    position: fixed;
    overflow: visible;
}

.popup-arrow {
    position: absolute;
    left: 50%;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 2px;
    z-index: 1;
}

.popup-arrow-top {
    top: -6px;
    transform: translateX(-50%) rotate(45deg);
}

.popup-arrow-bottom {
    bottom: -6px;
    transform: translateX(-50%) rotate(45deg);
}

@keyframes iosPopupIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ios-popup-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.ios-popup-item:active {
    background: rgba(0, 0, 0, 0.08);
}

.ios-popup-icon {
    font-size: 18px;
    margin-right: 12px;
}

.ios-popup-text {
    font-size: 16px;
    font-weight: 500;
    color: #1c1c1e;
}

/* Toast 提示 */
.toast-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast-message.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* 可点击的股票名称 */
.stock-name-clickable {
    cursor: pointer;
}

.stock-name-clickable:hover {
    text-decoration: underline;
    color: #1890ff;
}

/* ========== 通用页面布局样式 ========== */

/* 页面卡片头部布局 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.page-header .card-title {
    margin-bottom: 0;
}

/* 通用查询表单区域 */
.query-form {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.query-form .form-select {
    flex: 1;
}

.query-form .btn {
    padding: 12px 16px;
    min-width: 88px;
}




/* ========================================
   Modal 弹窗样式
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #262626;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #8c8c8c;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #262626;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

/* ========== 移动端适配 (Unified) ========== */
@media (max-width: 768px) {

    /* 1. Global & Layout */
    body {
        overflow-y: auto;
        overflow-x: hidden;
    }

    .container {
        height: auto;
        min-height: calc(100vh - var(--header-height));
        overflow: visible;
        display: block;
    }

    .sidebar {
        display: none;
    }

    .mobile-nav {
        display: block;
    }

    .main-content {
        margin-left: 0;
        padding: 15px;
        padding-bottom: 70px;
        height: auto;
        width: 100% !important;
        max-width: 100vw !important;
        overflow: visible;
    }

    .page {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 2. Components */
    .card {
        width: calc(100vw - 30px) !important;
        max-width: calc(100vw - 30px) !important;
        overflow: hidden !important;
        padding: 15px !important;
        margin-left: 0;
        margin-right: 0;
    }

    .card-title {
        font-size: 18px !important;
        margin-bottom: 0 !important;
    }

    .header h1 {
        font-size: 20px;
    }

    /* Segment Control */
    .segment-control {
        width: 100% !important;
        display: flex !important;
        flex-wrap: nowrap !important;
    }

    .segment-btn,
    .segment-control button {
        flex: 1 !important;
        text-align: center !important;
        min-width: 0 !important;
    }

    /* Forms & Inputs */
    .form-input,
    .form-select,
    input,
    select,
    .btn,
    .check-form-grid .btn {
        width: 100% !important;
        max-width: 100% !important;
    }

    .check-form-grid,
    .query-form,
    #moneyflow-dept-filter>div,
    #monitor-status-display>div,
    #yizi-tab-results .query-form {
        display: flex;
        flex-direction: column !important;
        gap: 10px !important;
        align-items: stretch !important;
    }

    /* Specific overrides for flex grids */
    .card>div[style*="justify-content: space-between"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    /* Tables */
    .table th,
    .table td {
        padding: 12px 6px !important;
    }

    #tasks-container,
    #results-display,
    .table-container,
    .industry-container {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Fix table header height alignment in split view */
    #page-industry .table th {
        height: 50px;
        vertical-align: middle;
        white-space: nowrap;
    }

    /* 3. Page Specific: Industry */
    #page-industry .industry-container {
        flex-direction: row;
        height: calc(100vh - 230px);
        overflow-x: auto;
        overflow-y: hidden;
        margin-top: -9px;
    }

    #page-industry .card {
        padding: 0 !important;
    }

    .industry-left-panel {
        width: 70vw;
        min-width: 70vw;
    }

    .industry-right-panel {
        width: 140vw;
        min-width: 140vw;
    }

    /* 4. Page Specific: Stocks & Leader */
    .stock-item {
        flex-direction: column;
        padding: 16px;
    }

    .stock-metrics {
        grid-template-columns: 1fr 1fr;
    }

    .leader-boards-grid {
        grid-template-columns: 1fr;
    }

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

    /* 5. Modal */
    .modal-overlay {
        padding: 10px;
    }

    .modal-content {
        max-height: 90vh;
    }
}