/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    width: 100%;
    min-height: 100vh;
    display: flex;
}

/* 左侧参数配置区 */
.sidebar {
    width: 20%;
    background-color: #fff;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
}

.sidebar h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group select,
.form-group textarea,
.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    height: 120px;
    resize: vertical;
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    position: relative;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-area:hover {
    border-color: #999;
}

.upload-area p {
    margin-bottom: 10px;
    color: #666;
}

.upload-area .icon {
    font-size: 24px;
    color: #999;
    margin-bottom: 10px;
}

.upload-area .thumbnail {
    max-width: 100%;
    max-height: 150px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.upload-area.has-image {
    border-style: solid;
    border-color: #4CAF50;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-align: center;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: #45a049;
}

.btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.btn-block {
    display: block;
    width: 100%;
}

/* 右侧内容区 */
.content {
    width: 80%;
    margin-left: 20%;
    padding: 20px;
    min-height: 100vh;
}

.result-container {
    display: flex;
    width: 100%;
}

.search-results,
.similar-results {
    width: 50%;
    padding: 10px;
}

.section-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 10px;
}

.section-header h3 {
    margin-right: 10px;
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
}

.tab-container {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.tab-header {
    display: flex;
    border-bottom: 1px solid #ddd;
    background-color: #f9f9f9;
    border-radius: 4px 4px 0 0;
}

.tab-item {
    padding: 10px 15px;
    cursor: pointer;
    border-right: 1px solid #ddd;
    transition: background-color 0.3s ease;
}

.tab-item:last-child {
    border-right: none;
}

.tab-item.active {
    background-color: #fff;
    border-bottom: 2px solid #4CAF50;
}

.tab-content {
    padding: 15px;
    display: none;
}

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

/* 试题篮 */
.basket-button {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.basket-button .count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: red;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.basket-panel {
    position: fixed;
    top: 0;
    right: -800px;
    width: 800px;
    height: 100vh;
    background-color: #fff;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    z-index: 999;
    padding: 20px;
    overflow-y: auto;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.basket-panel.open {
    right: 0;
}

.basket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.basket-header h2 {
    font-size: 18px;
}

.basket-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.basket-items {
    margin-bottom: 10px;
    flex-grow: 1;
    overflow-y: auto;
}

.basket-item {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.basket-item:last-child {
    border-bottom: none;
}

.basket-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.basket-item-title {
    font-weight: bold;
}

.basket-item-remove {
    background: none;
    border: none;
    color: red;
    cursor: pointer;
}

.basket-actions {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

/* 试题展示样式 */
.question {
    margin-bottom: 20px;
}

.question-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.question-id {
    font-weight: bold;
}

.question-actions button {
    margin-left: 10px;
}

.question-content {
    margin-bottom: 10px;
    min-height: auto;
    height: auto;
}

.question-footer {
    margin-top: 10px;
}

.collapsible {
    cursor: pointer;
    padding: 5px 10px;
    background-color: #f1f1f1;
    border: none;
    text-align: left;
    outline: none;
    font-size: 14px;
    margin-bottom: 5px;
}

.collapsible:after {
    content: '\02795'; /* Unicode 加号 */
    font-size: 12px;
    color: #777;
    float: right;
    margin-left: 5px;
}

.collapsible.active:after {
    content: "\2796"; /* Unicode 减号 */
}

.collapsible-content {
    padding: 0 10px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out;
    background-color: #f9f9f9;
}

/* 提示消息 */
.toast-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    z-index: 1100;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.toast-message.show {
    opacity: 1;
}

/* 加载动画 */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 2s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        margin-bottom: 20px;
    }
    
    .content {
        width: 100%;
        margin-left: 0;
    }
    
    .result-container {
        flex-direction: column;
    }
    
    .search-results,
    .similar-results {
        width: 100%;
    }
    
    .basket-panel {
        width: 100%;
        right: -100%;
    }
}
