/* 自定义样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.5;
    color: #333;
    background-color: #f5f7fa;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1, h2 {
    margin-top: 20px;
    margin-bottom: 15px;
    color: #2c3e50;
}

/* 顶部导航栏 */
header {
    margin-bottom: 30px;
}

header h1 {
    margin: 0;
    font-size: 24px;
}

/* 控制区域 */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f8fafc;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.controls-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 日期控制区 */
.date-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 用户控件 */
.user-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
}

.username {
    font-size: 14px;
    color: #4a5568;
    white-space: nowrap;
}

.btn {
    padding: 6px 12px;
    border-radius: 4px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
}

.btn-settings {
    background-color: #4299e1;
}

.btn-logout {
    background-color: #e53e3e;
}

.btn-login {
    background-color: #4299e1;
}

.btn-register {
    background-color: #38a169;
}

.btn:hover {
    opacity: 0.9;
}

/* 公司标签 */
.tracked-companies {
    background-color: #ebf8ff;
    border: 1px solid #bee3f8;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 20px;
}

.tracked-companies h3 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #2b6cb0;
    font-size: 16px;
}

.company-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.company-tag {
    background-color: #bee3f8;
    color: #2c5282;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* 概况和明细区域 */
.summary-section, .detail-section {
    margin-bottom: 30px;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.summary-section h2, .detail-section h2 {
    color: #2d3748;
    font-size: 18px;
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

/* 表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    font-size: 14px;
}

.data-table th, 
.data-table td {
    padding: 10px;
    text-align: right;
    border-bottom: 1px solid #e2e8f0;
}

.data-table th:first-child,
.data-table td:first-child,
.data-table th:nth-child(2),
.data-table td:nth-child(2) {
    text-align: left;
}

.data-table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #4a5568;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* 强调的字段 */
.emphasized {
    font-weight: 600;
    color: #000;
}

th.emphasized {
    background-color: #edf2f7;
    color: #2d3748;
}

/* 策略字段颜色 */
.strategy-add {
    color: #e53e3e !important;
    font-weight: 600;
}

.strategy-reduce {
    color: #38a169 !important;
    font-weight: 600;
}

.strategy-neutral {
    color: #3182ce !important;
    font-weight: 600;
}

/* 全部机构合计行样式 */
.total-row {
    background-color: #f0f4ff;
    font-weight: 600;
}

.total-row td {
    border-bottom: 2px solid #cbd5e0;
}

/* 公司小计行样式 */
.company-total-row {
    background-color: #f0fff4;
    font-weight: 600;
}

.company-total-row td {
    border-bottom: 2px solid #c6f6d5;
    border-top: 1px solid #c6f6d5;
}

/* 表格行交替背景色 */
.data-table tbody tr:nth-child(even):not(.total-row):not(.company-total-row) {
    background-color: #f9fafb;
}

/* 表格行悬停效果 */
.data-table tbody tr:hover:not(.total-row):not(.company-total-row) {
    background-color: #edf2f7;
    transition: background-color 0.2s;
}

/* 日期选择器 */
#date-picker {
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    background-color: white;
    min-width: 140px;
    height: 38px;
}

/* 按钮样式 */
#refresh-btn {
    padding: 8px 16px;
    background-color: #4299e1;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#refresh-btn:hover {
    background-color: #3182ce;
}

/* Flatpickr 样式覆盖 */
.flatpickr-day.selected {
    background: #4299e1;
    border-color: #4299e1;
}

.flatpickr-day.today {
    border-color: #4299e1;
}

.flatpickr-day.today.selected {
    background: #4299e1;
}

.flatpickr-day:hover {
    background: #ebf8ff;
}

.flatpickr-day.disabled {
    color: #cbd5e0;
}

/* 加载中样式 */
#loading {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    text-align: center;
    color: #4a5568;
}

.loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid #4299e1;
    width: 40px;
    height: 40px;
    margin-bottom: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 无数据提示 */
#no-data {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    text-align: center;
    color: #4a5568;
}

#no-data svg {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    color: #a0aec0;
}

/* 页脚样式 */
footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    color: #718096;
    font-size: 14px;
}

/* 响应式设计 - 移动设备 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        max-width: 100%;
    }
    
    .controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 10px;
    }
    
    .date-control {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .controls-right {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 10px;
    }
    
    #date-picker {
        width: 100%;
        max-width: 100%;
    }
    
    #refresh-btn {
        width: 100%;
    }
    
    .user-controls {
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
    }
    
    .data-table {
        font-size: 12px;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .data-table th, 
    .data-table td {
        padding: 8px 5px;
    }
    
    header h1 {
        font-size: 20px;
    }
    
    .tracked-companies {
        padding: 10px;
    }
    
    .summary-section, .detail-section {
        padding: 10px;
        margin-bottom: 20px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .control-buttons {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }
    
    .control-btn {
        flex: 1;
        margin: 0 5px;
    }
}

/* 小屏幕设备的额外优化 */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    h1 {
        font-size: 18px;
    }
    
    h2 {
        font-size: 16px;
    }
    
    .btn {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .data-table th, 
    .data-table td {
        padding: 6px 3px;
        font-size: 11px;
    }
    
    .company-tag {
        font-size: 10px;
        padding: 3px 6px;
    }
}

/* 确保表格在小屏幕上可以水平滚动 */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* 期货持仓数据分析系统样式 */

/* 基础样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

/* 头部样式 */
header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.controls-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

h1 {
    font-size: 1.5rem;
    margin: 0;
    color: #1a73e8;
}

/* 日期选择器样式 */
#date-picker {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    font-size: 0.9rem;
    width: 120px;
}

/* 按钮样式 */
button {
    background-color: #1a73e8;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #1557b0;
}

button:disabled {
    background-color: #a0c3ff;
    cursor: not-allowed;
}

/* 用户控制按钮 */
.user-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn {
    padding: 0.4rem 0.8rem;
    border-radius: 0.25rem;
    text-decoration: none;
    font-size: 0.85rem;
}

.btn-login, .btn-register {
    background-color: #f1f3f4;
    color: #1a73e8;
}

.btn-settings {
    background-color: #f1f3f4;
    color: #5f6368;
}

.btn-logout {
    background-color: #f1f3f4;
    color: #d93025;
}

/* 主要内容区域 */
main {
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    min-height: 500px;
}

/* 加载提示 */
#loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid #1a73e8;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 无数据提示 */
#no-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #5f6368;
    padding: 3rem 1rem;
}

#no-data svg {
    margin-bottom: 1rem;
    color: #5f6368;
}

#no-data p.text-lg {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

/* 表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.data-table th, .data-table td {
    padding: 0.75rem;
    text-align: right;
    border-bottom: 1px solid #eee;
}

.data-table th:first-child, .data-table td:first-child,
.data-table th:nth-child(2), .data-table td:nth-child(2) {
    text-align: left;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #5f6368;
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

/* 强调显示的单元格 */
.emphasized {
    font-weight: 600;
    color: #202124;
}

/* 策略颜色 */
.strategy-add {
    color: #34a853;
}

.strategy-reduce {
    color: #ea4335;
}

.strategy-neutral {
    color: #fbbc05;
}

/* 总计行样式 */
.total-row {
    background-color: #f1f8ff;
    font-weight: 600;
}

/* 跟踪公司提示 */
.tracked-companies {
    background-color: #e8f0fe;
    border-radius: 0.25rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}

.company-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.company-tag {
    background-color: #d2e3fc;
    color: #1967d2;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85rem;
}

/* 页脚 */
footer {
    text-align: center;
    padding: 1rem;
    color: #5f6368;
    font-size: 0.85rem;
    margin-top: 2rem;
}

/* 区域标题 */
section h2 {
    margin-bottom: 1rem;
    color: #202124;
    font-size: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

/* 部分之间的间距 */
.summary-section {
    margin-bottom: 2rem;
}

/* 概况和明细区域标题样式 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.section-header h2 {
    margin: 0;
    padding: 0;
    border: none;
}

/* 控制按钮样式 */
.control-buttons {
    display: flex;
    gap: 0.5rem;
}

.control-btn {
    background-color: #f1f3f4;
    color: #5f6368;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
}

.control-btn:hover {
    background-color: #e8eaed;
}

/* 公司小计行样式 */
.company-total-row {
    background-color: #f8f9fa;
    cursor: pointer;
}

.company-total-row:hover {
    background-color: #eef2fd;
}

/* 展开/收起图标 */
.expand-icon {
    display: inline-block;
    margin-right: 0.5rem;
    transition: transform 0.2s;
}

.company-total-row.expanded .expand-icon {
    transform: rotate(90deg);
}

/* 公司详细行样式 */
.company-detail-row {
    background-color: #fafbfc;
}

.company-detail-row td:first-child {
    padding-left: 2rem;
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 20px 0;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    transition: all 0.3s;
}

.sidebar .nav-link {
    font-weight: 500;
    color: #333;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    margin: 0.2rem 0.5rem;
}

.sidebar .nav-link:hover {
    background-color: #e9ecef;
}

.sidebar .nav-link.active {
    color: #fff;
    background-color: #0d6efd;
}

.sidebar .nav-link i {
    margin-right: 8px;
}

.sidebar-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 0.5rem 1rem;
    margin: 1rem 0.5rem 0.5rem;
    color: #6c757d;
}

.main-content {
    transition: all 0.3s;
}

/* 响应式设计增强 */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 56px;
        left: -250px;
        width: 250px;
        height: 100%;
        z-index: 1000;
        transition: all 0.3s;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }
    
    .sidebar-backdrop.show {
        display: block;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
}

@media (min-width: 769px) {
    .sidebar {
        width: 250px;
    }
    
    .main-content {
        margin-left: 250px;
    }
    
    .sidebar-toggle {
        display: none;
    }
} 