/* 材料设计工具页面样式 */
.design-tool-main {
    background: var(--bg-secondary);
    padding: 0 0 80px;
    min-height: calc(100vh - 200px);
}

/* 首页视图 */
.home-view {
    width: 100%;
}

/* 顶部背景区域 */
.header-bg {
    width: 100%;
    height: 400px;
    background: url('https://p11-flow-imagex-download-sign.byteimg.com/tos-cn-i-a9rns2rl98/ff101d73a17a4437a07ecc31267f219f.png~tplv-a9rns2rl98-24:720:720.png') center/cover no-repeat;
    background-color: #001540;
    position: relative;
}

/* 卡片容器区域 */
.card-container {
    width: 100%;
    padding: 50px 0;
    background-color: #ffffff;
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

/* 单个卡片样式 */
.card {
    width: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
}

.card:hover {
    transform: translateY(-10px);
}

.card:hover .icon-circle {
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}

.card:hover .icon-svg {
    stroke: var(--primary-color);
}

/* 圆形图标容器 */
.icon-circle {
    width: 180px;
    height: 180px;
    border: 2px solid #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
    transition: all 0.3s;
}

.icon-circle::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 1px solid #eee;
    border-radius: 50%;
}

/* 图标样式 */
.icon-svg {
    width: 80px;
    height: 80px;
    stroke: #666;
    stroke-width: 2;
    fill: none;
    transition: all 0.3s;
}

/* 文字描述 */
.card-text {
    font-size: 16px;
    color: #333;
    text-align: center;
    line-height: 1.6;
}

/* 工具视图 */
.tool-view {
    padding: 40px 0;
}

/* 返回首页按钮 */
.back-to-home {
    margin-bottom: 20px;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-primary);
}

.btn-back:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-back svg {
    width: 18px;
    height: 18px;
}

/* 响应式适配 */
@media (max-width: 1024px) {
    .card {
        width: 40%;
    }
    .icon-circle {
        width: 160px;
        height: 160px;
    }
}

@media (max-width: 768px) {
    .card {
        width: 80%;
    }
    .icon-circle {
        width: 140px;
        height: 140px;
    }
    .header-bg {
        height: 250px;
    }
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.page-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* 工具布局 */
.tool-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* 左侧面板 */
.left-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.panel-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.panel-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bg-tertiary);
}

.section-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* 上传区域 */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--bg-secondary);
    position: relative;
    z-index: 1;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.25);
}

.upload-area:active {
    transform: translateY(0);
}

.upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    color: var(--text-secondary);
}

.upload-icon svg {
    width: 100%;
    height: 100%;
}

.upload-area p {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 0.9375rem;
}

.upload-hint {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

/* 文件信息 */
.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-top: 16px;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.file-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.file-icon svg {
    width: 20px;
    height: 20px;
}

.file-text {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.btn-remove-file {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.btn-remove-file:hover {
    transform: scale(1.1);
}

/* 测试模型区域 */
.test-model-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.test-model-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-align: center;
}

.test-model-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.btn-test-model {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-primary);
}

.btn-test-model:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--bg-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-test-model svg {
    width: 18px;
    height: 18px;
}

/* 温度刻度 */
.temp-slider-container {
    padding: 20px 0;
}

.temp-slider-wrapper {
    position: relative;
    height: 40px;
    margin-bottom: 12px;
}

.temp-gradient-bar {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 8px;
    transform: translateY(-50%);
    background: linear-gradient(to right, #0000ff 0%, #007fff 25%, #ffff00 50%, #ff7f00 75%, #ff0000 100%);
    border-radius: 4px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.temp-slider {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    width: 100%;
    height: 40px;
    transform: translateY(-50%);
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    z-index: 2;
}

.temp-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--primary-color);
    cursor: grab;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
}

.temp-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.temp-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.1);
}

.temp-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--primary-color);
    cursor: grab;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
}

.temp-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.temp-slider::-moz-range-thumb:active {
    cursor: grabbing;
    transform: scale(1.1);
}

.temp-slider-thumb {
    position: absolute;
    top: 50%;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--primary-color);
    transform: translate(-50%, -50%);
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: left 0.1s ease-out;
}

.temp-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 4px;
}

.temp-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 当前温度显示 */
.current-temp {
    margin-top: 20px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    text-align: center;
}

.current-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-right: 8px;
}

.current-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-right: 4px;
}

.current-unit {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* 控制选项 */
.control-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.control-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.control-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 右侧面板 */
.right-panel {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.panel-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.view-controls {
    display: flex;
    gap: 8px;
}

.view-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.view-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--bg-tertiary);
}

.view-btn svg {
    width: 18px;
    height: 18px;
}

/* 模型容器 */
.model-container {
    flex: 1;
    position: relative;
    min-height: 500px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.model-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 4px;
}

.empty-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* 日志区 */
.log-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bg-tertiary);
}

.log-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.btn-clear-log {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-secondary);
}

.btn-clear-log:hover {
    background: var(--danger-color);
    color: white;
}

.log-content {
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 16px;
}

.log-entry {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    min-width: 80px;
}

.log-message {
    color: var(--text-primary);
    flex: 1;
}

.log-entry.info .log-message {
    color: var(--primary-color);
}

.log-entry.success .log-message {
    color: var(--success-color);
}

.log-entry.error .log-message {
    color: var(--danger-color);
}

.log-entry.warning .log-message {
    color: var(--warning-color);
}

/* 全屏模式 */
.model-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    border-radius: 0;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .tool-layout {
        grid-template-columns: 1fr;
    }

    .left-panel {
        order: 2;
    }

    .right-panel {
        order: 1;
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 1.75rem;
    }

    .model-container {
        min-height: 300px;
    }
}
