* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主色调 */
    --primary-color: #10b981;
    --primary-dark: #059669;
    --primary-light: #34d399;
    
    /* 背景色 - 暗色主题 */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    
    /* 文本色 */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    /* 边框色 */
    --border-primary: #334155;
    --border-secondary: #475569;
    
    /* 业务域颜色 */
    --color-fee: #eab308;        /* 电费专业 - 黄色 */
    --color-expand: #3b82f6;     /* 业扩专业 - 蓝色 */
    --color-service: #10b981;    /* 服务专业 - 绿色 */
    --color-metering: #f97316;   /* 计量专业 - 橙色 */
    --color-compliance: #ef4444; /* 合规性指标 - 红色 */
    --color-digital: #06b6d4;    /* 数智化平台 - 青色 */
    
    /* 重点指标颜色 */
    --color-five-seven: #ec4899; /* 五标七率 - 粉色 */
    --color-three-one: #14b8a6;  /* 三标一率 - 青色 */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 25%, #334155 50%, #475569 75%, #64748b 100%);
    color: var(--text-primary);
    overflow: hidden;
    line-height: 1.6;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(16, 185, 129, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 40% 20%, rgba(236, 72, 153, 0.05) 0%, transparent 60%);
    pointer-events: none;
    z-index: 1;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* 顶部导航 */
.header {
    height: 60px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: relative;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.back-btn {
    width: 40px;
    height: 40px;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(16, 185, 129, 0.3);
    border-color: rgba(16, 185, 129, 0.6);
    transform: translateX(-2px);
}

.back-btn i {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
    fill: var(--primary-color);
}

.logo {
    transition: all 0.3s ease;
    text-decoration: none;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-primary);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.logo-highlight {
    background: linear-gradient(135deg, #10b981, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
}

.nav-tabs {
    display: flex;
    background: rgba(30, 41, 59, 0.8);
    padding: 4px;
    border-radius: 8px;
    gap: 2px;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-tab:hover {
    color: var(--text-primary);
    background: rgba(71, 85, 105, 0.7);
}

.nav-tab.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.nav-tab i {
    width: 16px;
    height: 16px;
}

/* 主体内容 */
.main-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: rgba(15, 23, 42, 0.3);
}

.tab-content {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tab-content.active {
    opacity: 1;
    visibility: visible;
}

/* 指标全景图样式 */
.galaxy-container {
    display: flex;
    height: 100%;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
}

.galaxy-sidebar {
    width: 320px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(16, 185, 129, 0.2);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
}

.galaxy-title h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #10b981, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.galaxy-title p {
    color: var(--text-muted);
    font-size: 14px;
}

.domain-legend {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.legend-section {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    transition: all 0.3s ease;
}

.legend-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
}

.legend-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-color.fee { background: var(--color-fee); }
.legend-color.expand { background: var(--color-expand); }
.legend-color.service { background: var(--color-service); }
.legend-color.metering { background: var(--color-metering); }
.legend-color.compliance { background: var(--color-compliance); }
.legend-color.digital { background: var(--color-digital); }
.legend-color.five-seven { background: var(--color-five-seven); }
.legend-color.three-one { background: var(--color-three-one); }

.control-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.4) 100%);
    outline: none;
    -webkit-appearance: none;
    transition: all 0.3s ease;
}

.control-group input[type="range"]:hover {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.3) 0%, rgba(16, 185, 129, 0.6) 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.control-buttons {
    display: flex;
    gap: 8px;
}

.control-buttons button {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-buttons button:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

.stats-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.stat-item {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    border: 1px solid rgba(16, 185, 129, 0.2);
    transition: all 0.3s ease;
    transform: perspective(1000px) rotateX(0deg);
}

.stat-item:hover {
    transform: perspective(1000px) rotateX(-5deg) translateY(-3px) scale(1.05);
    box-shadow: 0 12px 25px rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.galaxy-main {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#threejs-container {
    width: 100%;
    height: 100%;
}

.indicator-details {
    position: absolute;
    top: 0;
    right: 0;
    width: 400px;
    height: 100%;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--primary-color);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.indicator-details.active {
    transform: translateX(0);
}

.close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.8);
}

.close-btn i {
    width: 16px;
    height: 16px;
    color: #ef4444;
}

.details-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.details-header {
    margin-bottom: 24px;
}

.indicator-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--primary-color);
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.indicator-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.3;
}

.indicator-id {
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'Monaco', 'Courier New', monospace;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.detail-section p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.detail-item {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid var(--border-primary);
}

.detail-item label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
    display: block;
}

.detail-item > div {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

/* 积木分析样式 */
.builder-container {
    display: flex;
    height: 100%;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
}

.builder-sidebar {
    width: 320px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(16, 185, 129, 0.2);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
}

.sidebar-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.sidebar-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.builder-section h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.dimension-group {
    margin-bottom: 16px;
}

.group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.group-title i {
    width: 14px;
    height: 14px;
    color: var(--primary-color);
}

.dimension-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dimension-btn {
    padding: 6px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.dimension-btn:hover,
.dimension-btn.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.indicator-search {
    margin-bottom: 12px;
}

.indicator-search input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.indicator-search input:focus {
    border-color: var(--primary-color);
}

.indicator-list {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.indicator-item {
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.indicator-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

.indicator-item.selected {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--primary-color);
}

.indicator-item-name {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 2px;
}

.indicator-item-domain {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.builder-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: radial-gradient(ellipse at top right, rgba(16, 185, 129, 0.15) 0%, transparent 50%);
}

.builder-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-primary);
}

.header-title h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.header-title p {
    color: var(--text-muted);
    font-size: 14px;
}

.builder-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-btn.primary {
    background: var(--primary-color);
    color: white;
}

.action-btn.primary:hover {
    background: var(--primary-dark);
}

.action-btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}

.action-btn.secondary:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.builder-canvas {
    flex: 1;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
}

.canvas-area {
    min-height: 400px;
    background: rgba(30, 41, 59, 0.5);
    border: 2px dashed var(--border-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.canvas-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
}

.canvas-placeholder i {
    width: 48px;
    height: 48px;
    opacity: 0.3;
}

.selected-components {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 8px;
    padding: 16px;
}

.components-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.components-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.component-tag {
    padding: 6px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.component-tag.dimension {
    border-color: #3b82f6;
    color: #3b82f6;
}

.component-tag.indicator {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.component-tag .remove {
    cursor: pointer;
    font-weight: bold;
    opacity: 0.7;
}

.component-tag .remove:hover {
    opacity: 1;
}

.chart-container {
    height: 400px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border-primary);
}

#analysisChart {
    width: 100%;
    height: 100%;
}

/* 智能知识库样式 */
.knowledge-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

.knowledge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-primary);
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online {
    background: var(--primary-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.knowledge-main {
    flex: 1;
    display: flex;
    gap: 24px;
    padding: 24px 32px;
    overflow: hidden;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.7);
    border-radius: 12px;
    border: 1px solid var(--border-primary);
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 80%;
}

.ai-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: #3b82f6;
}

.message-avatar i {
    width: 16px;
    height: 16px;
    color: white;
}

.message-content {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
}

.ai-message .message-content {
    border-top-left-radius: 0;
    border-left: 3px solid var(--primary-color);
}

.user-message .message-content {
    background: rgba(59, 130, 246, 0.2);
    border-top-right-radius: 0;
    border-right: 3px solid #3b82f6;
    color: var(--text-primary);
}

.message-content p {
    margin-bottom: 8px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul {
    margin-left: 16px;
    margin-top: 8px;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 24px 16px;
}

.quick-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.quick-btn i {
    width: 14px;
    height: 14px;
}

.chat-input {
    padding: 16px 24px;
    border-top: 1px solid var(--border-primary);
}

.input-container {
    display: flex;
    gap: 12px;
    align-items: center;
}

.input-container input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 24px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.input-container input:focus {
    border-color: var(--primary-color);
}

.input-container button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.input-container button:hover {
    background: var(--primary-dark);
}

.rules-panel {
    width: 320px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.rules-header {
    padding: 16px 20px;
    background: rgba(30, 41, 59, 0.5);
    border-bottom: 1px solid var(--border-primary);
}

.rules-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
}

.rules-content {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.rule-level {
    margin-bottom: 20px;
}

.level-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rule-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rule-item {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid var(--border-primary);
}

.rule-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.rule-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* 报表生成样式 */
.reports-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

.reports-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-primary);
}

.reports-main {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.report-templates {
    margin-bottom: 32px;
}

.templates-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.template-card {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.template-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.2);
}

.template-icon {
    width: 48px;
    height: 48px;
    background: rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.template-icon i {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

.template-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.template-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 16px;
}

.template-btn {
    width: 100%;
    padding: 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.template-btn:hover {
    background: var(--primary-dark);
}

.report-preview {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    overflow: hidden;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(30, 41, 59, 0.5);
    border-bottom: 1px solid var(--border-primary);
}

.preview-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.preview-actions {
    display: flex;
    gap: 12px;
}

.preview-content {
    padding: 24px;
    max-height: 600px;
    overflow-y: auto;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .galaxy-sidebar,
    .builder-sidebar,
    .rules-panel {
        width: 280px;
    }
    
    .templates-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    .nav-tabs {
        gap: 1px;
        padding: 2px;
    }
    
    .nav-tab {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .nav-tab span {
        display: none;
    }
    
    .galaxy-container,
    .builder-container {
        flex-direction: column;
    }
    
    .galaxy-sidebar,
    .builder-sidebar,
    .knowledge-main {
        width: 100%;
        height: auto;
    }
    
    .galaxy-main {
        height: 400px;
    }
    
    .templates-grid {
        grid-template-columns: 1fr;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}