* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, sans-serif;
    background: #1a1a2e;
    color: #eee;
    height: 100vh;
    overflow: hidden;
}

/* 顶部标题栏 */
.header {
    background: linear-gradient(135deg, #16213e 0%, #1a1a2e 100%);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #333;
    height: 50px;
}

.header h1 {
    font-size: 18px;
    color: #4fc3f7;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header h1 img.logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 13px;
    color: #888;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #666;
}

.status-dot.online {
    background: #4caf50;
}

.status-dot.offline {
    background: #f44336;
}

/* 主容器 */
.main-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
    padding: 10px;
    height: calc(100vh - 50px);
}

/* 面板通用样式 */
.panel {
    background: #16213e;
    border-radius: 8px;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    background: linear-gradient(135deg, #1f4068 0%, #16213e 100%);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #333;
    min-height: 45px;
}

.panel-title {
    font-size: 14px;
    font-weight: 600;
    color: #4fc3f7;
}

.panel-content {
    flex: 1;
    padding: 10px;
    overflow: auto;
    position: relative;
}

/* 按钮样式 */
.btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-primary {
    background: #4fc3f7;
    color: #000;
}

.btn-primary:hover {
    background: #29b6f6;
}

.btn-primary:disabled {
    background: #37474f;
    color: #888;
    cursor: not-allowed;
}

.btn-secondary {
    background: #37474f;
    color: #fff;
}

.btn-secondary:hover {
    background: #455a64;
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* 3D查看器 */
#model-viewer {
    width: 100%;
    height: 100%;
    background: #0d1b2a;
    border-radius: 4px;
}

.model-info {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.7);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    color: #aaa;
}

/* 图片/PDF查看器 */
.image-viewer-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

#image-viewer {
    flex: 1;
    background: #0d1b2a;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    position: relative;
}

#image-viewer img,
#image-viewer canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.zoom-slider {
    width: 100px;
}

/* 输入区域 */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-group label {
    font-size: 12px;
    color: #888;
}

.input-textarea {
    flex: 1;
    min-height: 80px;
    background: #0d1b2a;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 10px;
    color: #eee;
    font-size: 13px;
    resize: none;
    font-family: inherit;
}

.input-textarea:focus {
    outline: none;
    border-color: #4fc3f7;
}

.dropdowns-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.dropdown-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.dropdown-group label {
    font-size: 12px;
    color: #888;
}

.dropdown {
    padding: 8px 10px;
    background: #0d1b2a;
    border: 1px solid #333;
    border-radius: 4px;
    color: #eee;
    font-size: 13px;
    cursor: pointer;
}

.dropdown:focus {
    outline: none;
    border-color: #4fc3f7;
}

.dropdown optgroup {
    background: #16213e;
    color: #4fc3f7;
    font-weight: bold;
}

.dropdown option {
    background: #0d1b2a;
    color: #eee;
    padding: 5px;
}

.input-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #888;
}

.checkbox-group.highlight {
    background: rgba(255, 193, 7, 0.15);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

.checkbox-group.highlight:hover {
    background: rgba(255, 193, 7, 0.25);
}

/* 输出区域 */
.output-section {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.output-content {
    flex: 1;
    background: #0d1b2a;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 15px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.6;
}

.output-content h2 {
    color: #4fc3f7;
    font-size: 14px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #333;
}

.output-content h3 {
    color: #ffc107;
    font-size: 13px;
    margin: 15px 0 8px 0;
}

.output-content p {
    margin-bottom: 8px;
    color: #ccc;
}

.output-content ul {
    margin-left: 20px;
    margin-bottom: 10px;
}

.output-content li {
    margin-bottom: 5px;
    color: #aaa;
}

.output-content strong {
    color: #ff5252;
}

/* 加载动画 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

.loading-overlay.show {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #333;
    border-top-color: #4fc3f7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 分隔线样式 */
.separator {
    border: none;
    border-top: 1px solid #333;
    margin: 10px 0;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
    background: #37474f;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #455a64;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #555;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 13px;
}

/* 进度条 */
.progress-container {
    position: absolute;
    bottom: 15px;
    left: 15px;
    right: 15px;
    background: rgba(0,0,0,0.8);
    border-radius: 4px;
    padding: 10px;
    display: none;
    z-index: 50;
}

.progress-container.show {
    display: block;
}

.progress-text {
    font-size: 12px;
    color: #4fc3f7;
    margin-bottom: 5px;
}

.progress-bar {
    height: 4px;
    background: #333;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #4fc3f7;
    transition: width 0.3s;
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: #16213e;
    border-radius: 12px;
    border: 1px solid #333;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 16px;
    color: #4fc3f7;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #fff;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #333;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.settings-section {
    margin-bottom: 25px;
}

.settings-section h3 {
    font-size: 14px;
    color: #4fc3f7;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
}

.settings-row {
    margin-bottom: 12px;
}

.settings-row label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 5px;
}

.settings-row label input[type="checkbox"] {
    margin-right: 8px;
}

.settings-input {
    width: 100%;
    padding: 10px 12px;
    background: #0d1b2a;
    border: 1px solid #333;
    border-radius: 4px;
    color: #eee;
    font-size: 13px;
}

.settings-input:focus {
    outline: none;
    border-color: #4fc3f7;
}

.settings-textarea {
    width: 100%;
    padding: 10px 12px;
    background: #0d1b2a;
    border: 1px solid #333;
    border-radius: 4px;
    color: #eee;
    font-size: 13px;
    resize: vertical;
    font-family: inherit;
}

.settings-textarea:focus {
    outline: none;
    border-color: #4fc3f7;
}

.input-with-btn {
    display: flex;
    gap: 8px;
}

.input-with-btn .settings-input {
    flex: 1;
}

.proxy-settings-container {
    margin-left: 20px;
    padding-left: 15px;
    border-left: 2px solid #333;
}

/* 测试结果提示 */
.test-result {
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 12px;
}

.test-result.success {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid #4caf50;
    color: #4caf50;
}

.test-result.error {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid #f44336;
    color: #f44336;
}

.test-result.loading {
    background: rgba(79, 195, 247, 0.2);
    border: 1px solid #4fc3f7;
    color: #4fc3f7;
}

/* 特征信息样式 */
.feature-info {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(0,0,0,0.8);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 11px;
    color: #4caf50;
    max-width: 300px;
}

.feature-info.extracting {
    color: #ffc107;
}

.feature-info.error {
    color: #f44336;
}

/* Markdown 表格样式 */
.table-wrapper {
    overflow-x: auto;
    margin: 15px 0;
    border-radius: 6px;
    background: #0d1b2a;
}

.md-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 400px;
}

.md-table thead {
    background: linear-gradient(135deg, #1f4068 0%, #16213e 100%);
}

.md-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #4fc3f7;
    border-bottom: 2px solid #4fc3f7;
    white-space: nowrap;
}

.md-table tbody tr {
    border-bottom: 1px solid #333;
    transition: background 0.2s;
}

.md-table tbody tr:hover {
    background: rgba(79, 195, 247, 0.1);
}

.md-table tbody tr:last-child {
    border-bottom: none;
}

.md-table td {
    padding: 10px 15px;
    color: #ccc;
    vertical-align: top;
}

.md-table td strong {
    color: #ff5252;
}

.md-table td em {
    color: #ffc107;
    font-style: italic;
}

.md-table td code {
    background: #16213e;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    color: #4caf50;
}

/* 表格斑马纹效果 */
.md-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

/* 数值列右对齐样式 */
.md-table td[style*="right"] {
    font-family: 'Consolas', 'Monaco', monospace;
    color: #4caf50;
}

/* 居中列样式 */
.md-table td[style*="center"] {
    text-align: center;
}