/* 全局样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5; /* 浅灰色背景 */
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 标题栏 */
header {
    background: linear-gradient(135deg, #6dd5ed, #2193b0); /* 渐变蓝 */
    color: white;
    padding: 15px 20px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    position: relative;
    z-index: 100;
}

header h1 {
    margin: 0;
    font-size: 2.2em;
    font-weight: 600;
    letter-spacing: 1px;
}

header a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.8em;
    position: absolute;
    top: 10px;
    right: 15px;
    transition: color 0.3s ease;
}

header a:hover {
    color: #fff;
}

/* 导航栏 */
nav {
    background-color: #34495e; /* 深蓝色 */
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

nav a {
    display: block;
    color: white;
    text-align: center;
    padding: 14px 25px;
    text-decoration: none;
    font-size: 1.05em;
    transition: background-color 0.3s ease, transform 0.2s ease;
    flex-grow: 1;
    white-space: nowrap;
}

nav a:hover {
    background-color: #4a657c;
    transform: translateY(-2px);
}

nav a.active {
    background-color: #2c3e50; /* 更深的蓝 */
    font-weight: bold;
    border-bottom: 3px solid #6dd5ed;
}

/* 主内容区域 */
main {
    padding: 25px;
    max-width: 1000px;
    margin: 25px auto;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    flex-grow: 1;
}

section {
    margin-bottom: 35px;
    padding: 25px;
    background-color: #fdfdfd;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

h2 {
    color: #2193b0; /* 渐变蓝的深色 */
    border-bottom: 3px solid #6dd5ed; /* 渐变蓝的亮色 */
    padding-bottom: 12px;
    margin-top: 0;
    font-size: 1.8em;
    font-weight: 600;
}

h3 {
    color: #34495e;
    border-bottom: 1px dashed #ccc;
    padding-bottom: 8px;
    margin-top: 25px;
    font-size: 1.4em;
}

p {
    margin-bottom: 12px;
    color: #555;
}

ul, ol {
    margin-left: 25px;
    margin-bottom: 15px;
    color: #555;
}

li {
    margin-bottom: 5px;
}

b, strong {
    color: #2193b0;
    font-weight: 600;
}

/* 表单元素 */
.config-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #34495e;
}

.config-form input[type="text"],
.config-form select,
.config-form textarea {
    width: calc(100% - 24px);
    padding: 12px;
    margin-bottom: 18px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box; /* 确保内边距和边框包含在宽度内 */
}

.config-form input[type="text"]:focus,
.config-form select:focus,
.config-form textarea:focus {
    border-color: #6dd5ed;
    box-shadow: 0 0 8px rgba(109, 213, 237, 0.4);
    outline: none;
}

.config-form button {
    background-color: #2193b0;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.05em;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-right: 10px;
}

.config-form button:hover {
    background-color: #1a7a91;
    transform: translateY(-2px);
}

/* 预览区域 */
.config-preview {
    background-color: #e6f7ff; /* 浅蓝色背景 */
    border: 1px solid #99e1ff;
    padding: 20px;
    border-radius: 8px;
    margin-top: 25px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.95em;
    color: #333;
    white-space: pre-wrap; /* 保持文本格式 */
    word-break: break-all;
    position: relative;
}

.copy-button {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
    margin-top: 15px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.copy-button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* Tab内容切换 */
.tab-content {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
    }

    nav a {
        width: 100%;
        text-align: left;
        border-bottom: 1px solid #4a657c;
    }

    nav a:last-child {
        border-bottom: none;
    }

    main {
        margin: 15px;
        padding: 15px;
    }

    header h1 {
        font-size: 1.8em;
    }

    header a {
        position: static;
        display: block;
        text-align: center;
        margin-top: 10px;
    }

    .config-form input[type="text"],
    .config-form select,
    .config-form textarea {
        width: 100%;
    }
}

/* 状态栏 CSS */
.details-wrapper {
    margin-top: 20px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

details {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}

details[open] {
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    background-color: #fefefe;
}

summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #e9ecef;
    color: #343a40;
    font-weight: bold;
    cursor: pointer;
    outline: none;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.3s ease;
}

summary:hover {
    background-color: #dee2e6;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: '▶';
    font-size: 0.8em;
    transform: rotate(0deg);
    transition: transform 0.2s ease;
}

details[open] summary::after {
    content: '▼';
    transform: rotate(90deg);
}

.details-content {
    padding: 15px 20px;
    color: #495057;
    font-size: 0.95em;
    line-height: 1.8;
}

.details-content h4 {
    color: #007bff;
    margin-top: 15px;
    margin-bottom: 8px;
    border-bottom: 1px dashed #a2d2ff;
    padding-bottom: 5px;
}

.details-content ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.details-content ul li {
    margin-bottom: 5px;
    padding-left: 10px;
    position: relative;
}

.details-content ul li::before {
    content: '•';
    color: #28a745;
    position: absolute;
    left: 0;
}

.details-content table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.details-content table th,
.details-content table td {
    border: 1px solid #dee2e6;
    padding: 8px 12px;
    text-align: left;
}

.details-content table th {
    background-color: #f1f3f5;
    font-weight: bold;
    color: #343a40;
}

.details-content table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.details-content table tr:hover {
    background-color: #e9ecef;
}

/* 特殊标记颜色 */
.details-content .static-info b { color: #17a2b8; } /* 蓝色 */
.details-content .dynamic-record b { color: #ffc107; } /* 黄色 */
.details-content .scene-info b { color: #28a745; } /* 绿色 */

/* 记忆区特定样式 */
.memory-section {
    background-color: #f0f8ff; /* 淡蓝色 */
    border-color: #a2d2ff;
}

.memory-section summary {
    background-color: #cfe2f3; /* 稍深的淡蓝色 */
    color: #1e3a8a;
}

.memory-section table th {
    background-color: #dbe9f7;
}

.memory-section table tr:nth-child(even) {
    background-color: #eaf4fd;
}

.memory-section table tr:hover {
    background-color: #dbe9f7;
}

/* 行动建议特定样式 */
.action-suggestions {
    background-color: #f8fff0; /* 淡绿色 */
    border-color: #c8e6c9;
}

.action-suggestions summary {
    background-color: #d4edda; /* 稍深的淡绿色 */
    color: #19692c;
}

.action-suggestions ul li::before {
    content: '▶';
    color: #28a745;
}
.text-content {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    line-height: 1.8;
    color: #333;
}

.text-content p {
    margin-bottom: 1em;
    text-indent: 2em; /* 段落首行缩进 */
}

/* 隐藏思维链 */
.think-chain {
    display: none;
}