/* 全局样式 */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f0f0; /* 浅灰色背景 */
}

/* 应用容器样式 */
#appContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

/* 画布样式，对应Java中的Applet背景 */
#pdCanvas {
    background-color: black; /* 对应Java中的this.setBackground(Color.black) */
    margin-bottom: 10px;
    border: 1px solid #333;
}

/* 控制面板样式，对应Java中的Panel p */
#controlPanel {
    display: flex;
    gap: 1px; /* 减小间距 */
    padding: 5px; /* 减小内边距 */
    background-color: lightgray; /* 对应Java中的p.setBackground(Color.lightGray) */
    border-radius: 5px;
    width: 350px;
    justify-content: center;
    align-items: center; /* 垂直居中对齐 */
}

#controlPanel label {
    font-size: 12px; /* 设置label字体大小为12px */
}

/* 按钮样式 */
button {
    padding: 3px 6px; /* 减小内边距 */
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 3px;
    background-color: #f8f8f8;
    font-size: 11px; /* 减小字体大小 */
    margin: 0 2px; /* 添加水平间距 */
}

button:hover {
    background-color: #e8e8e8;
}

/* 下拉选择框样式 */
select {
    padding: 2px 4px; /* 减小内边距 */
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 11px; /* 减小字体大小 */
    height: 24px; /* 固定高度 */
    margin: 0 2px; /* 添加水平间距 */
}

/* 状态栏样式，对应Java中的showStatus */
#status-bar {
    font-size: 12px;
    color: #333;
    margin-left: 5px;
}

/* 模态对话框样式 */
.control-panel, .view-log {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-width: 500px;
    width: 90%;
}

/* 模态对话框标题样式 */
.control-panel h3, .view-log h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* 控制项样式 */
.control-item {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.control-item label {
    width: 100px;
    flex-shrink: 0;
}

.control-item input {
    flex-grow: 1;
    margin: 0 10px;
}

.control-item span {
    width: 30px;
    text-align: right;
}

/* 按钮容器样式 */
.control-buttons, .log-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* 日志内容样式 */
.log-content {
    margin: 15px 0;
    border: 1px solid #eee;
    padding: 10px;
    background-color: #f9f9f9;
}

/* 遮罩层样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* ViewLog样式，对应Java中的ViewLog类 */
.view-log-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #f0f0f0;
    border: 1px solid #333;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none; /* 默认隐藏 */
    width: 600px;
    height: 400px;
    padding: 10px;
    border-radius: 5px;
}

.view-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1px;
    padding-bottom: 3px;
    border-bottom: 1px solid #ccc;
    line-height: 1; /* 减小行高 */
}

.view-log-header h3 {
    margin: 0;
    font-size: 14px; /* 稍微缩小字体 */
    font-weight: bold;
    line-height: 1; /* 减小行高 */
}

.view-log-canvas {
    width: 100%;
    height: calc(100% - 60px);
    background-color: white;
    border: 1px solid #ccc;
}

.view-log-controls {
    display: flex;
    align-items: center;
    margin-top: 5px;
    padding: 5px;
}

.view-log-label {
    font-size: 14px;
    margin-right: 2px;
}

.view-log-select {
    padding: 2px 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
    margin-right: 10px;
}

.view-log-button {
    padding: 3px 8px;
    background-color: #f8f8f8;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    margin-left: 5px;
    font-size: 13px;
}

.view-log-close {
    font-size: 24px;
    cursor: pointer;
    color: #666;
    margin-left: auto;
}

.view-log-close:hover {
    color: #000;
}

/* 参数设置对话框样式 */
.settings-dialog-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    font-family: Arial, sans-serif;
}

.settings-dialog-header {
    background-color: #4a90e2;
    color: white;
    padding: 10px;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    position: relative;
}

.settings-dialog-header h3 {
    margin: 0;
    font-size: 18px;
}

.settings-dialog-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    cursor: pointer;
    color: white;
}

.settings-form {
    padding: 15px;
}

.settings-row {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.settings-row label {
    width: 120px;
    display: inline-block;
    font-size: 14px;
}

.settings-input {
    width: 80px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.settings-select {
    width: 250px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.settings-buttons {
    margin-top: 20px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.settings-button {
    padding: 8px 15px;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}

.settings-button:hover {
    background-color: #3a80d2;
}

/* 响应式设计 */
@media (max-width: 600px) {
    #controlPanel {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .control-item label {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .control-item input {
        width: 100%;
        margin: 5px 0;
    }
}

@media (max-width: 650px) {
    .view-log-container {
        width: 90%;
        height: 80%;
    }
    
    .view-log-controls {
        grid-template-columns: 1fr;
    }
}