/* 资产智能体页面样式：沿用 Element UI 后台的蓝色主色与浅灰底 */
[v-cloak] { display: none; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: #f0f2f5;
    color: #303133;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    font-size: 14px;
}

a {
    text-decoration: none;
}

.agent-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
    border-bottom: 1px solid #e6e8eb;
    box-shadow: 0 1px 4px rgba(0, 21, 41, .06);
}

.header-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #409EFF, #2b7cd3);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(64, 158, 255, .3);
}

.brand-title {
    font-size: 17px;
    font-weight: 600;
    color: #1f2d3d;
    line-height: 1.3;
}

.brand-sub {
    font-size: 12px;
    color: #909399;
    margin-top: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.back-link {
    margin-left: 6px;
    color: #409EFF;
    font-size: 13px;
}

.back-link:hover {
    color: #66b1ff;
}

.agent-main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 22px 24px 40px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 20px;
    align-items: start;
}

.content-col {
    min-width: 0;
}

.ask-panel,
.result-panel,
.side-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
}

.ask-panel {
    padding: 22px 24px 20px;
}

.panel-title-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.panel-title-row h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: #1f2d3d;
}

.panel-title-row p {
    margin: 6px 0 0;
    color: #909399;
    font-size: 13px;
}

.panel-tip {
    font-size: 12px;
    color: #909399;
    white-space: nowrap;
}

.mono {
    font-family: Menlo, Consolas, monospace;
    color: #606266;
}

.login-alert {
    margin-top: 16px;
}

.login-link {
    margin-left: 8px;
    color: #E6A23C;
    font-weight: 600;
}

.ask-box {
    margin-top: 18px;
}

.ask-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.ask-hint {
    font-size: 12px;
    color: #c0c4cc;
}

.example-block {
    margin-top: 18px;
    border-top: 1px dashed #ebeef5;
    padding-top: 16px;
}

.block-title {
    font-size: 13px;
    color: #606266;
    margin-bottom: 10px;
}

.example-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.example-chip {
    cursor: pointer;
    border: 1px solid #dcdfe6;
    background: #fafafa;
    color: #606266;
    border-radius: 14px;
    padding: 4px 12px;
    font-size: 12px;
    transition: all .2s;
}

.example-chip:hover {
    color: #409EFF;
    border-color: #409EFF;
    background: #ecf5ff;
}

.example-chip.more {
    background: #fff;
    border-style: dashed;
    color: #909399;
}

.result-panel {
    margin-top: 18px;
    padding: 22px 24px;
}

.loading-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #409EFF;
    font-size: 14px;
    padding: 40px;
}

.empty-panel {
    padding: 10px;
}

.result-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.result-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.result-time {
    font-size: 12px;
    color: #c0c4cc;
}

.result-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-actions .el-button + .el-button {
    margin-left: 0;
}

.answer-box {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #ecf5ff;
    border: 1px solid #d9ecff;
    border-radius: 6px;
    padding: 14px 16px;
    color: #1f2d3d;
    font-size: 15px;
    line-height: 1.7;
}

.answer-box i {
    font-size: 20px;
    color: #409EFF;
    margin-top: 2px;
}

.answer-unknown {
    background: #fdf6ec;
    border-color: #faecd8;
}

.answer-unknown i {
    color: #E6A23C;
}

.answer-error {
    background: #fef0f0;
    border-color: #fde2e2;
}

.answer-error i {
    color: #F56C6C;
}

.metric-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.metric-card {
    background: #f7f9fc;
    border: 1px solid #ebeef5;
    border-radius: 6px;
    padding: 12px 14px;
}

.metric-label {
    font-size: 12px;
    color: #909399;
}

.metric-value {
    font-size: 18px;
    font-weight: 600;
    color: #303133;
    margin-top: 4px;
}

.chart-wrap {
    margin-top: 18px;
    border: 1px solid #ebeef5;
    border-radius: 6px;
    padding: 12px 12px 4px;
}

.chart-title {
    font-size: 13px;
    color: #606266;
    margin: 0 0 6px 4px;
}

.chart {
    width: 100%;
    height: 300px;
}

.table-wrap {
    margin-top: 18px;
}

.table-title {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #606266;
    margin-bottom: 8px;
}

.row-count {
    color: #909399;
    font-size: 12px;
}

.sql-collapse {
    margin-top: 16px;
}

.sql-box {
    background: #282c34;
    color: #abb2bf;
    border-radius: 4px;
    padding: 12px;
    overflow: auto;
}

.sql-box pre {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
}

.side-col {
    position: sticky;
    top: 76px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.side-card {
    padding: 16px 18px;
}

.side-title {
    font-size: 14px;
    font-weight: 600;
    color: #303133;
    padding-bottom: 10px;
    border-bottom: 1px solid #ebeef5;
    margin-bottom: 10px;
}

.cap-item {
    padding: 6px 0;
}

.cap-name {
    font-size: 13px;
    font-weight: 500;
    color: #303133;
}

.cap-desc {
    font-size: 12px;
    color: #909399;
    margin-top: 2px;
    line-height: 1.5;
}

.tips {
    margin: 0;
    padding-left: 18px;
    color: #606266;
    font-size: 12px;
    line-height: 1.9;
}

.status-line {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 12px;
    color: #909399;
}

.status-line b {
    color: #303133;
    font-weight: 500;
}

@media (max-width: 1000px) {
    .agent-main {
        grid-template-columns: 1fr;
    }

    .side-col {
        position: static;
        order: 2;
    }
}

@media (max-width: 640px) {
    .header-inner {
        padding: 12px 14px;
    }

    .brand-title {
        font-size: 15px;
    }

    .agent-main {
        padding: 14px;
    }

    .ask-panel,
    .result-panel {
        padding: 16px;
    }

    .ask-hint {
        display: none;
    }
}

/* ===== 模板填报弹窗 ===== */
.tpl-dialog {
    max-width: 94vw;
}

.tpl-body {
    font-size: 13px;
    color: #303133;
}

.tpl-tip {
    background: #f4f8ff;
    border: 1px solid #d9ecff;
    color: #5a6b82;
    border-radius: 6px;
    padding: 10px 12px;
    line-height: 1.7;
    font-size: 12px;
}

.tpl-upload-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.tpl-hidden-input {
    display: none;
}

.tpl-file-name {
    font-size: 12px;
    color: #909399;
    word-break: break-all;
}

.tpl-alert {
    margin-top: 12px;
}

.tpl-meta {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 14px;
    font-size: 12px;
    color: #606266;
}

.tpl-meta b {
    color: #303133;
}

.tpl-columns {
    margin-top: 16px;
}

.tpl-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
    font-weight: 600;
    color: #303133;
    margin-bottom: 8px;
}

.tpl-section-tip {
    font-size: 12px;
    font-weight: 400;
    color: #909399;
}

.tpl-instruction {
    margin-top: 14px;
}

.tpl-actions {
    margin-top: 14px;
}

.tpl-result {
    margin-top: 16px;
    border-top: 1px dashed #ebeef5;
    padding-top: 14px;
}

.tpl-result-stats {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #606266;
}

.tpl-result-stats b {
    color: #303133;
}

.tpl-warn {
    margin-top: 8px;
    font-size: 12px;
    color: #E6A23C;
    line-height: 1.6;
}

.tpl-unfilled {
    margin-top: 12px;
}

.tpl-download {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.tpl-download-name {
    font-size: 12px;
    color: #909399;
}
