/* 公共样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: #f5f7fa;
    color: #333;
}

/* 颜色系统 */
:root {
    --primary: #1677FF;
    --success: #52C41A;
    --success-bg: #F6FFED;
    --error: #FF4D4F;
    --error-bg: #FFF1F0;
    --warning: #FAAD14;
    --text-primary: #333;
    --text-secondary: #666;
    --border: #D9D9D9;
    --border-light: #F0F0F0;
    --bg: #f5f7fa;
    --white: #fff;
}

/* 顶部导航 */
.header {
    background: var(--white);
    height: 56px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.header-nav {
    display: flex;
    gap: 24px;
}

.header-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
}

.header-nav a.active {
    color: var(--primary);
}

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

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: #4096ff;
}

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

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

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

/* 主内容区 */
.main-container {
    padding-top: 56px;
    min-height: 100vh;
}

/* 页面容器 */
.page-container {
    padding: 24px;
}

/* 卡片 */
.card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* 列表页样式 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
}

/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
}

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

.table th {
    background: #fafafa;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
}

.table td {
    font-size: 14px;
}

.table .status-published {
    color: var(--success);
}

.table .actions {
    display: flex;
    gap: 12px;
}

.table .actions a {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
}

/* 三栏布局 */
.three-column {
    display: flex;
    height: calc(100vh - 56px);
}

/* 左侧指标树 */
.left-sidebar {
    width: 240px;
    background: var(--white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.left-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 500;
    font-size: 14px;
}

.left-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.indicator-tree {
    list-style: none;
}

.indicator-item {
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s;
}

.indicator-item:hover {
    background: #f5f7fa;
}

.indicator-item.active {
    background: #E6F7FF;
    border-left: 3px solid var(--primary);
}

.indicator-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.indicator-status.success {
    background: var(--success);
}

.indicator-status.error {
    background: var(--error);
}

.indicator-status.pending {
    background: var(--warning);
}

.indicator-name {
    font-size: 14px;
    flex: 1;
}

/* 中间文档编辑器 */
.editor-container {
    flex: 1;
    background: #e8e8e8;
    padding: 32px;
    overflow-y: auto;
}

.editor-document {
    background: var(--white);
    min-height: 800px;
    width: 800px;
    margin: 0 auto;
    padding: 64px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.doc-title {
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 32px;
}

.doc-section {
    margin-bottom: 24px;
}

.doc-section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
}

.doc-paragraph {
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 16px;
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.doc-table th,
.doc-table td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: center;
}

/* 指标高亮 */
.indicator-highlight {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
    font-family: 'DIN Alternate', 'Roboto Mono', monospace;
}

.indicator-highlight.default {
    background: rgba(22, 119, 255, 0.1);
    color: var(--primary);
}

.indicator-highlight.success {
    background: var(--success-bg);
    color: var(--success);
}

.indicator-highlight.error {
    background: var(--error-bg);
    color: var(--error);
}

/* 右侧校验面板 */
.right-panel {
    width: 320px;
    background: var(--white);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.right-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 500;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.right-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.indicator-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.indicator-card.match {
    border-color: var(--success);
    background: var(--success-bg);
}

.indicator-card.mismatch {
    border-color: var(--error);
    background: var(--error-bg);
}

.indicator-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.indicator-card-title {
    font-weight: 500;
    font-size: 14px;
}

.indicator-card-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
}

.indicator-card-status.match {
    background: var(--success);
    color: white;
}

.indicator-card-status.mismatch {
    background: var(--error);
    color: white;
}

.indicator-card-row {
    margin-bottom: 8px;
}

.indicator-card-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.indicator-card-value {
    font-size: 14px;
    font-family: 'DIN Alternate', 'Roboto Mono', monospace;
}

.indicator-card-input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
}

.indicator-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* 弹窗 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background: var(--white);
    border-radius: 8px;
    width: 500px;
    max-width: 90%;
}

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 16px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
}

/* Toast */
.toast {
    position: fixed;
    top: 80px;
    right: 24px;
    background: var(--white);
    padding: 12px 24px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2000;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--error);
}

/* 图表占位 */
.chart-placeholder {
    background: #fafafa;
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 48px;
    text-align: center;
    color: var(--text-secondary);
    margin: 16px 0;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state-text {
    margin-bottom: 24px;
}

/* 进度条 */
.progress-bar {
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.tag-blue {
    background: rgba(22, 119, 255, 0.1);
    color: var(--primary);
}
