/* ========================================
   ReaxTools Web - 样式表
   ======================================== */

/* ========================================
   基础样式设置
   ======================================== */
* {
    box-sizing: border-box;
}

body {
    /* font-family: 'Microsoft YaHei', monospace; */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* ========================================
   标题样式
   ======================================== */
h2 {
    color: #2c3e50;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

h3 {
    color: #34495e;
    margin-top: 0;
    margin-bottom: 15px;
}

/* ========================================
   段落和链接样式
   ======================================== */
p {
    margin-top: 4px;
    margin-bottom: 4px;
    text-align: justify;
}

b {
    color: #ee3333;
    margin-top: 4px;
    margin-bottom: 4px;
}

a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* ========================================
   表单元素样式
   ======================================== */
input,
button {
    margin: 0px 0px 0px 0px;
    padding: 12px 15px;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
}

input:focus,
button:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

/* 输入框特殊样式 */
#argsInput {
    width: 300px;
    background-color: #fff;
}

#argsInput::placeholder {
    color: #95a5a6;
    font-style: italic;
}

/* 文件输入框样式 */
input[type="file"] {
    background-color: #fff;
    cursor: pointer;
}

input[type="file"]:hover {
    border-color: #3498db;
}

/* ========================================
   按钮样式
   ======================================== */
button {
    background-color: #3498db;
    color: white;
    cursor: pointer;
    font-weight: 500;
    border: none;
}

button:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 次要按钮样式 */
.chart-controls button {
    margin: 5px;
    padding: 8px 12px;
    font-size: 0.9rem;
    background-color: #95a5a6;
}

.chart-controls button:hover {
    background-color: #7f8c8d;
}

/* ========================================
   容器样式
   ======================================== */
/* 通用容器样式 */
.container {
    border: 1px solid #ddd;
    padding: 20px;
    margin-top: 15px;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 输入区域样式 */
#input {
    border: 2px solid #3498db;
    padding: 20px;
    margin-top: 15px;
    border-radius: 8px;
    background-color: #ecf0f1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#input h3 {
    color: #2c3e50;
    margin-top: 0;
}

/* 输出区域样式 */
#output {
    background-color: #fff;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 4px solid #27ae60;
}

/* ========================================
   日志输出区域样式
   ======================================== */
#log-container {
    border: 1px solid #ddd;
    padding: 20px;
    margin-top: 15px;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#log-output {
    background-color: #ecf0f1;
    /* color: #ecf0f1; */
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    border-radius: 6px;
    min-height: 200px;
    /* font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; */
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    border: 2px solid #3498db;
}

/* 日志滚动条样式 */
#log-output::-webkit-scrollbar {
    width: 8px;
}

#log-output::-webkit-scrollbar-track {
    background: #34495e;
    border-radius: 4px;
}

#log-output::-webkit-scrollbar-thumb {
    background: #7f8c8d;
    border-radius: 4px;
}

#log-output::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* ========================================
   图表区域样式
   ======================================== */
#charts-container {
    border: 1px solid #ddd;
    padding: 20px;
    margin-top: 15px;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-height: 200px;
}

.chart-controls {
    margin: 15px 0;
    padding: 15px;
    background-color: #ecf0f1;
    border-radius: 6px;
    border: 1px solid #bdc3c7;
}

.chart-controls button {
    margin: 5px;
    padding: 8px 12px;
    font-size: 0.9rem;
    background-color: #95a5a6;
    border: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.chart-controls button:hover {
    background-color: #7f8c8d;
    transform: translateY(-1px);
}

#charts-area {
    margin-top: 15px;
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
        max-width: 100%;
    }

    #argsInput {
        width: 100%;
        max-width: 300px;
    }

    input,
    button {
        margin: 5px 5px 5px 0;
        padding: 10px;
        font-size: 0.9rem;
    }

    .container,
    #input,
    #log-container,
    #charts-container {
        padding: 15px;
        margin-top: 10px;
    }

    #log-output {
        max-height: 200px;
        min-height: 150px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0.25rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    input,
    button {
        width: 100%;
        margin: 5px 0;
    }

    #argsInput {
        max-width: none;
    }
}

/* ========================================
   动画效果
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container,
#input,
#log-container,
#charts-container {
    animation: fadeIn 0.5s ease-out;
}

/* ========================================
   状态指示器
   ======================================== */
.processing {
    background-color: #fff3cd !important;
    border-color: #ffeaa7 !important;
    color: #856404 !important;
}

.success {
    background-color: #d4edda !important;
    border-color: #c3e6cb !important;
    color: #155724 !important;
}

.error {
    background-color: #f8d7da !important;
    border-color: #f5c6cb !important;
    color: #721c24 !important;
}

/* ========================================
   工具提示样式
   ======================================== */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #2c3e50;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8rem;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 全局字体：西文 Consolas，中文默认 */
html,
body {
    font-family: Consolas, "PingFang SC", "Microsoft YaHei", "WenQuanYi Micro Hei", "Noto Sans SC", "Source Han Sans SC", "Heiti SC", "SimHei", "STHeiti", Arial, sans-serif;
}

:lang(zh),
body:lang(zh),
*:lang(zh) {
    font-family: "PingFang SC", "Microsoft YaHei", "WenQuanYi Micro Hei", "Noto Sans SC", "Source Han Sans SC", "Heiti SC", "SimHei", "STHeiti", Arial, sans-serif;
}

/* Key molecules 表格样式 */
.key-mol-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
    background-color: white;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.key-mol-table thead tr {
    background-color: #3498db;
    color: white;
    font-weight: bold;
}

.key-mol-table th,
.key-mol-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 2px solid #2980b9;
    font-family: inherit;
}

.key-mol-table tbody tr {
    border-bottom: 1px solid #ecf0f1;
    transition: background-color 0.2s ease;
}

.key-mol-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.key-mol-table tbody tr:hover {
    background-color: #e3f2fd;
}

.key-mol-table td.molecule {
    font-weight: bold;
    color: #2c3e50;
}

.key-mol-table td.from {
    color: #2980b9;
    font-family: inherit;
}

.key-mol-table td.to {
    color: #e74c3c;
    font-family: inherit;
}

/* log-output 也用等宽字体 */
#log-output {
    font-family: Consolas, monospace;
}