/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 0;
    text-align: center;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* 介绍部分样式 */
.intro {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.intro h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.intro h3 {
    color: #764ba2;
    margin: 20px 0 10px 0;
    font-size: 1.4em;
}

.intro p {
    margin-bottom: 15px;
    text-align: justify;
}

.intro ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.intro li {
    margin-bottom: 8px;
}

/* 预测部分样式 */
.prediction {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.prediction h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: monospace;
    font-size: 14px;
    resize: vertical;
    min-height: 120px;
}

.form-group input[type="number"] {
    width: 200px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.upload-area {
    border: 2px dashed #667eea;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.upload-area:hover {
    background-color: #f0f4ff;
    border-color: #764ba2;
}

.upload-area input[type="file"] {
    display: none;
}

.upload-text {
    font-size: 16px;
    color: #666;
}

#pdbFileInfo {
    margin-top: 10px;
    font-size: 14px;
    color: #555;
}

/* 3D结构展示 */
#moleculeViewer {
    width: 100%;
    height: 500px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
}

/* 确保3Dmol创建的canvas元素正确显示 */
#moleculeViewer canvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

@media (max-width: 768px) {
    #moleculeViewer {
        height: 400px;
    }
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(0);
}

/* 序列显示样式 */
.sequence-display {
    margin-bottom: 30px;
}

.sequence-display h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.4em;
}

.sequence {
    font-family: monospace;
    font-size: 16px;
    line-height: 1.5;
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    white-space: pre-wrap;
    word-break: break-all;
}

.sequence span {
    padding: 2px 4px;
    margin: 0 1px;
    border-radius: 3px;
}

.sequence span.highlight {
    background-color: #ffff99;
    font-weight: bold;
}

/* 二级结构显示样式 */
.structure-visualization {
    font-family: monospace;
    font-size: 16px;
    line-height: 1.5;
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    white-space: pre-wrap;
    word-break: break-all;
    margin-bottom: 20px;
}

.structure-visualization span {
    padding: 2px 4px;
    margin: 0 1px;
    border-radius: 3px;
}

.structure-visualization span.helix {
    background-color: #ffff99;
    font-weight: bold;
}

.structure-visualization span.sheet {
    background-color: #c8a2c8;
    font-weight: bold;
}

.structure-visualization span.loop {
    background-color: #a8e6c9;
}

/* 表面特性显示样式 */
.surface-visualization {
    font-family: monospace;
    font-size: 16px;
    line-height: 1.5;
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    white-space: pre-wrap;
    word-break: break-all;
    margin-bottom: 20px;
}

.surface-visualization span {
    padding: 2px 4px;
    margin: 0 1px;
    border-radius: 3px;
}

.surface-visualization span.surface {
    background-color: #a8e6c9;
    font-weight: bold;
}

.surface-visualization span.buried {
    background-color: #c8c8c8;
}

/* 结构统计样式 */
.structure-stats {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.structure-stats h4 {
    color: #667eea;
    margin-bottom: 10px;
}

.structure-stats ul {
    margin-left: 20px;
}

.structure-stats li {
    margin-bottom: 5px;
}

/* 表面连续序列样式 */
.contiguous-sequences {
    margin-top: 20px;
}

.contiguous-sequences h4 {
    color: #667eea;
    margin-bottom: 10px;
}

/* 3D结构展示样式 */
#3dStructure {
    margin-top: 30px;
}

#3dStructure h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.4em;
}

#moleculeViewer {
    width: 100%;
    height: 500px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* 结果部分样式 */
.results {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.results h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8em;
}

#resultsTable {
    margin-bottom: 20px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
    color: #555;
}

tr:hover {
    background-color: #f5f5f5;
}

.high-risk {
    background-color: #ffebee !important;
}

.medium-risk {
    background-color: #fff3e0 !important;
}

.low-risk {
    background-color: #e8f5e8 !important;
}

#copyBtn {
    margin-top: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .intro, .prediction, .results {
        padding: 20px;
    }
}