/* 经费汇总模块 CSS */
:root {
    --primary-color: #1890ff;
    --secondary-color: #f5f5f5;
    --text-color: #333;
    --border-color: #e8e8e8;
    --hover-color: #e6f7ff;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
    --header-height: 60px;
    --sidebar-width: 220px;
}

body {
    font-family: "Microsoft YaHei", -apple, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    background-color: #f0f2f5;
}

/* 布局 */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px;
}

.header {
    height: var(--header-height);
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.header-title {
    font-size: 16px;
    font-weight: 500;
    margin-right: auto;
    display: flex;
    align-items: center;
}

.header-title .back-btn {
    margin-right: 12px;
    cursor: pointer;
    color: #666;
    font-size: 20px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    border: 1px solid transparent;
}

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

.btn-primary:hover {
    background-color: #40a9ff;
    border-color: #40a9ff;
}

.btn-default {
    background-color: white;
    border-color: var(--border-color);
    color: var(--text-color);
}

.btn-default:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn i {
    margin-right: 6px;
    font-size: 14px;
}

/* 工具箱和工作场景 */
.toolbox-section, .workspace-section {
    margin-bottom: 24px;
}

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

.section-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
}

.section-title i {
    margin-right: 8px;
    color: var(--primary-color);
}

.toolbox {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px 0;
}

.tool-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    width: 100px;
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s;
    cursor: pointer;
}

.tool-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.tool-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 24px;
    color: var(--primary-color);
}

.tool-name {
    font-size: 13px;
    color: #333;
    text-align: center;
}

.tool-desc {
    font-size: 12px;
    color: #999;
    text-align: center;
    margin-top: 4px;
}

/* 工作场景 */
.tab-container {
    margin-bottom: 16px;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.tab {
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    position: relative;
}

.tab.active {
    color: var(--primary-color);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-color);
}

.workspace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.workspace-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: all 0.3s;
    height: 120px;
    cursor: pointer;
}

.workspace-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.workspace-card-content {
    padding: 16px;
}

.workspace-card-title {
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 42px;
}

.workspace-card-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
    margin-top: 24px;
}

/* 表格相关 */
.table-toolbar {
    background-color: white;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.toolbar-separator {
    width: 1px;
    height: 24px;
    background-color: var(--border-color);
    margin: 0 8px;
}

.toolbar-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
    font-size: 14px;
}

.toolbar-btn:hover {
    background-color: var(--hover-color);
    color: var(--primary-color);
}

.toolbar-btn.has-dropdown {
    min-width: 60px;
    justify-content: space-between;
    padding: 0 8px;
}

.toolbar-dropdown {
    display: flex;
}

.formula-bar {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border-bottom: 1px solid var(--border-color);
    background-color: white;
}

.cell-address {
    padding: 6px 12px;
    min-width: 100px;
    text-align: center;
    font-size: 14px;
    background-color: #f9f9f9;
    margin-right: 8px;
    border-radius: 4px;
}

.formula-input {
    flex: 1;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
}

.formula-input:focus {
    border-color: var(--primary-color);
}

.spreadsheet-container {
    overflow: auto;
    height: calc(100vh - var(--header-height) - 120px);
    position: relative;
}

.spreadsheet {
    border-collapse: collapse;
    table-layout: fixed;
}

.spreadsheet th, .spreadsheet td {
    border: 1px solid var(--border-color);
    padding: 6px;
    min-width: 100px;
    position: relative;
    height: 32px;
}

.spreadsheet th {
    background-color: #f5f5f5;
    font-weight: normal;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 5;
}

.spreadsheet tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.cell-input {
    border: none;
    width: 100%;
    height: 100%;
    background: transparent;
    outline: none;
    font-family: inherit;
    padding: 0;
}

.cell-selected {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    border: 2px solid var(--primary-color);
    z-index: 10;
}

/* 文件列表视图 */
.file-list {
    width: 100%;
    border-collapse: collapse;
}

.file-list th, .file-list td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.file-list th {
    background-color: #fafafa;
    font-weight: 500;
    color: #666;
}

.file-list tbody tr:hover {
    background-color: var(--hover-color);
}

.file-name {
    display: flex;
    align-items: center;
}

.file-icon {
    margin-right: 8px;
    color: var(--primary-color);
}

.action-icons {
    display: flex;
    gap: 8px;
}

.action-icon {
    cursor: pointer;
    color: #666;
    font-size: 16px;
}

.action-icon:hover {
    color: var(--primary-color);
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
    .toolbox {
        gap: 12px;
    }
    
    .tool-item {
        width: 80px;
        padding: 12px 8px;
    }
    
    .workspace-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    
    .table-toolbar {
        overflow-x: auto;
    }
    
    .spreadsheet-container {
        height: calc(100vh - var(--header-height) - 100px);
    }
}
