/* 基础样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
    margin: 0;
    padding: 0;
}

/* 系统模式样式 */
.system-mode-banner {
    background: #f0f8ff;
    padding: 8px 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mode-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 14px;
}

.mode-indicator.host-mode {
    background-color: #e6f7ff;
    border-left: 4px solid #1890ff;
    color: #0050b3;
}

.mode-indicator.slave-mode {
    background-color: #fff7e6;
    border-left: 4px solid #fa8c16;
    color: #873800;
}

.mode-detail {
    font-size: 12px;
    opacity: 0.8;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: #2c3e50;
    color: white;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
    border-radius: 5px;
}

header h1 {
    margin: 0;
    font-size: 24px;
}

.card {
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
    padding: 20px;
}

.card h2 {
    color: #2c3e50;
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* 表格样式 */
.responsive-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.responsive-table th,
.responsive-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.responsive-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.collapsible-row {
    cursor: pointer;
}

.collapsible-row:hover {
    background-color: #f1f8ff;
}

.collapsible-row.active {
    background-color: #e6f7ff;
    border-bottom: none;
}

.detail-row td {
    background-color: #f9f9f9;
    padding: 0;
}

.detail-row .content-full {
    padding: 15px;
}

.toggle-indicator,
.toggle-sub-indicator {
    float: right;
    color: #999;
    transition: transform 0.2s;
}

.collapsible-row.active .toggle-indicator {
    transform: rotate(180deg);
}

/* 主题样式 */
.topics-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
    background: #fcfcfc;
}

.topics-list {
    display: flex;
    flex-wrap: wrap;
    padding: 10px;
}

.topic-item {
    background: #f0f7ff;
    border-radius: 4px;
    margin: 5px;
    padding: 5px 10px;
    font-size: 13px;
    display: flex;
    align-items: center;
    border: 1px solid #d6e8ff;
}

.topic-name {
    margin-right: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

/* 计数徽章 */
.count-badge {
    background: #e6f7ff;
    color: #1890ff;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: normal;
    margin-left: 5px;
}

/* 主机节点区域 */
.host-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #eee;
}

.host-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.host-section h3 {
    color: #1890ff;
    font-size: 1.1em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

/* 状态徽章 */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.online {
    background-color: #e6ffec;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.status-badge.offline {
    background-color: #fff1f0;
    color: #f5222d;
    border: 1px solid #ffa39e;
}

.status-badge.ready {
    background-color: #e6ffec;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.status-badge.not-ready {
    background-color: #fff7e6;
    color: #fa8c16;
    border: 1px solid #ffd591;
}

/* 空状态提示 */
.empty-state {
    text-align: center;
    padding: 20px;
    color: #999;
    font-style: italic;
}

/* 内部表格 */
.inner-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.inner-table th,
.inner-table td {
    padding: 8px;
    border: 1px solid #eee;
    font-size: 0.9em;
}

.inner-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.topic-row,
.action-row {
    cursor: pointer;
}

.topic-row:hover,
.action-row:hover {
    background-color: #f1f8ff;
}

.cmd-row td {
    padding: 0;
}

.cmd-block {
    background-color: #f5f5f5;
    padding: 10px 15px;
    border-radius: 3px;
    margin: 5px 0;
}

.cmd-line {
    display: flex;
    align-items: center;
    margin: 10px 0;
}

.cmd-line pre {
    flex: 1;
    background-color: #f1f1f1;
    padding: 8px;
    border-radius: 3px;
    overflow-x: auto;
    font-size: 13px;
    margin: 0;
    margin-right: 10px;
}

.copy-btn {
    background-color: #1890ff;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
}

.copy-btn:hover {
    background-color: #096dd9;
}

.copy-btn.small {
    padding: 2px 6px;
    font-size: 11px;
}

.copy-btn.copy-success {
    background-color: #52c41a;
}

.goal-tip {
    font-size: 12px;
    color: #888;
    margin: 5px 0 0 0;
    font-style: italic;
}

/* 文件路径样式 */
.file-path {
    position: relative;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-link {
    cursor: pointer;
    margin-left: 8px;
    color: #1890ff;
}

.folder-link:hover {
    color: #096dd9;
}

/* 注册表路径样式 */
.registry-info {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 0.9em;
}

.registry-path {
    margin-bottom: 10px;
}

.registry-path:last-child {
    margin-bottom: 0;
}

.path-list {
    list-style: none;
    padding-left: 10px;
    margin: 5px 0;
}

.path-list li {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

.path {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 导航标签 */
.nav-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 1px;
}

.nav-tab {
    padding: 8px 16px;
    color: #666;
    text-decoration: none;
    margin-right: 2px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    transition: all 0.2s;
}

.nav-tab:hover {
    background-color: #e9ecef;
    color: #333;
}

.nav-tab:active {
    background-color: #fff;
    border-bottom: 1px solid white;
    margin-bottom: -1px;
    color: #1890ff;
}

/* 调试按钮 */
.debug-btn {
    background-color: #e8e8e8;
    color: #666;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 5px;
    transition: background-color 0.2s;
}

.debug-btn:hover {
    background-color: #d9d9d9;
}

.debug-info {
    margin-top: 10px;
    background-color: #fafafa;
    border: 1px solid #eee;
    padding: 10px;
    border-radius: 3px;
    font-size: 12px;
    overflow: auto;
    max-height: 200px;
}

/* 返回顶部按钮 */
#back-to-top {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #1890ff;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    font-size: 20px;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: all 0.3s;
}

#back-to-top:hover {
    background-color: #096dd9;
    transform: translateY(-3px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .responsive-table {
        display: block;
        overflow-x: auto;
    }

    .card {
        padding: 15px;
    }

    .cmd-line {
        flex-direction: column;
        align-items: stretch;
    }

    .cmd-line pre {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .topics-list {
        flex-direction: column;
    }

    .topic-item {
        width: 100%;
        box-sizing: border-box;
    }

    .nav-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .nav-tab {
        flex: 0 0 auto;
    }
}