/* 工具页面专用样式 */
.tools-main {
    padding-top: 0;
}

.tools-hero {
    height: 40vh;
    position: relative;
    overflow: hidden;
    background: var(--primary-color);
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}

.tools-container {
    display: flex;
    gap: 2rem;
    max-width: 1200px;
    margin: -60px auto 0;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

/* 侧边导航 */
.tools-sidebar {
    flex: 0 0 250px;
}

.tools-nav {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 100px;
}

.nav-category {
    margin-bottom: 0.5rem;
}

.category-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    cursor: pointer;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    color: var(--text-color);
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.category-header:hover {
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--secondary-color);
}

.category-header i {
    margin-right: 0.5rem;
    transition: transform 0.3s ease;
}

.category-header.expanded i {
    transform: rotate(90deg);
}

.category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding-left: 1.5rem;
}

.category-content.expanded {
    max-height: 500px; /* 足够大的值以容纳内容 */
}

.tool-btn {
    padding: 0.8rem 1rem;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    width: 100%;
    font-size: 0.95rem;
    color: var(--text-color);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.tool-btn:hover {
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--secondary-color);
}

.tool-btn.active {
    background-color: var(--secondary-color);
    color: white;
}
.tools-content {
    flex: 1;
    display: none;
}
.tools-content.active {
    display: block;
}

/* 工具面板区域 */
.tool-form-area {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 2rem;
    display: flex;
    gap: 2rem;
}

.calculation-section {
    flex: 0 0 60%;
}

.tool-image-area {
    flex: 0 0 35%;
    padding: 1rem;
    border-left: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

.tool-image-container {
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.tool-instruction {
    margin-bottom: 20px;
}

.tool-instruction h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.tool-instruction p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.tool-example {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
}

.tool-example img {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
    border: 1px solid #eee;
    border-radius: 4px;
}

.tool-example p {
    color: #555;
    font-size: 0.9em;
    margin-top: 10px;
}

.tool-image {
    width: 100%;
    border-radius: 4px;
}

.tool-image-area {
    display: flex;
    flex-direction: column;
}

.result-area {
    margin-top: auto;
    padding: 1.5rem;
    background-color: var(--light-bg);
    border-radius: 4px;
    display: none;
    border: 1px solid #eee;
    width: 100%;
}

.result-area p {
    margin-bottom: 0.8rem;
    line-height: 1.5;
    font-size: 1.1rem;
}

.result-area p strong {
    color: var(--secondary-color);
}

.tool-panel {
    display: none;
}

.tool-panel.active {
    display: block;
}

/* 单位转换样式 */
.converter-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* 阻容编码转换样式 */
.rcode-container {
    margin-top: 2rem;
    background-color: var(--light-bg);
    padding: 1.5rem;
    border-radius: 8px;
}

.code-info {
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ddd;
}

.code-input-group {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-top: 0.5rem;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.code-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.code-field label {
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: normal;
}

.code-field input {
    width: 120px;
    text-align: center;
    font-size: 1.2rem;
    padding: 0.5rem;
}

.arrow {
    color: var(--secondary-color);
    font-size: 1.5rem;
    font-weight: bold;
}

.code-result {
    display: inline-block;
    font-size: 1.2rem;
    color: var(--secondary-color);
    font-weight: 500;
    min-width: 120px;
    padding: 0.5rem;
    text-align: center;
    background: var(--light-bg);
    border-radius: 4px;
}

.code-example {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
    font-size: 0.9rem;
    color: var(--text-color);
    text-align: center;
}

.converter-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    font-size: 1.2rem;
}

.tool-panel h2 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: var(--secondary-color);
    outline: none;
}

.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.calculate-btn, .reset-btn {
    flex: 1;
    padding: 1.2rem 2.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.calculate-btn {
    background-color: var(--secondary-color);
    color: white;
}

.calculate-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.reset-btn {
    background-color: #f8f9fa;
    color: #495057;
    border: 2px solid #e9ecef;
}

.reset-btn:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 原理图转换工具样式 */
.schematic-conversion {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 2rem;
}

.format-selection {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.format-group {
    flex: 1;
}

.format-group label {
    display: block;
    margin-bottom: 0.8rem;
    color: var(--text-color);
    font-weight: 500;
}

.format-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.format-group select:focus {
    border-color: var(--secondary-color);
    outline: none;
}

.file-upload-area {
    background: var(--light-bg);
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: var(--secondary-color);
}

.upload-content i {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.tools-section .upload-instructions {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.file-hint {
    font-size: 0.9rem;
    color: #666;
}

.selected-file {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.selected-file i {
    color: var(--secondary-color);
    font-size: 1.2rem;
}

.file-name {
    flex: 1;
    font-weight: 500;
}

.file-size {
    color: #666;
}

.remove-file {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.remove-file:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

.drag-hint {
    display: none;
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-top: 1rem;
}

.file-upload-area.dragging {
    background: rgba(52, 152, 219, 0.1);
    border-color: var(--secondary-color);
}

.file-upload-area.dragging .drag-hint {
    display: block;
}

.conversion-options {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.primary-button {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.primary-button:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.primary-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: var(--secondary-color);
    width: 0;
    transition: width 0.3s ease;
}.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.calculate-btn, .reset-btn {
    flex: 1;
    padding: 1.2rem 2.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.calculate-btn {
    background-color: var(--secondary-color);
    color: white;
}

.calculate-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.reset-btn {
    background-color: #f8f9fa;
    color: #495057;
    border: 2px solid #e9ecef;
}

.reset-btn:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}


.result-area.show {
    display: block;
}



/* 响应式设计 */
@media (max-width: 1200px) {
    .tools-container {
        padding: 1.5rem;
        margin-top: -50px;
    }

    .tool-form-area {
        padding: 1.5rem;
    }
}

@media (max-width: 1024px) {
    .tools-container {
        flex-direction: column;
        gap: 1.5rem;
    }

    .tools-sidebar {
        flex: none;
        position: sticky;
        top: 0;
        z-index: 10;
        background: white;
        padding: 1rem;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    .tool-form-area {
        flex-direction: column;
        gap: 1.5rem;
    }

    .calculation-section,
    .tool-image-area {
        flex: none;
        width: 100%;
    }

    .tool-image-area {
        border-left: none;
        border-top: 1px solid #eee;
        padding-top: 1.5rem;
        margin-top: 1.5rem;
    }

    .tools-nav {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.5rem;
    }

    .tool-btn {
        width: 100%;
        text-align: center;
        white-space: nowrap;
        padding: 0.8rem;
        font-size: 0.9rem;
    }
}

/* 软件下载区域样式 */
.software-category {
    margin-bottom: 1.5rem;
}

.software-category h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--secondary-color);
}
.software-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.8rem;
    margin-top: 0.8rem;
}

.software-item {
    background: white;
    border-radius: 6px;
    padding: 0.8rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.software-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.software-info h4 {
    color: var(--text-color);
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.version {
    display: inline-block;
    background: var(--light-bg);
    color: var(--secondary-color);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.8rem;
    margin-bottom: 0.3rem;
}

.description {
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 0.6rem;
    line-height: 1.2;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--secondary-color);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 3px;
    text-decoration: none;
    font-size: 0.8rem;
    transition: background-color 0.3s ease;
}

.download-btn:hover {
    background: var(--primary-color);
}

.download-btn i {
    font-size: 1rem;
}

@media (max-width: 768px) {
    .tools-hero {
        height: 30vh;
    }

    .tools-container {
        margin-top: -40px;
        padding: 1rem;
    }

    .software-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .software-item {
        padding: 1rem;
    }

    .tools-nav {
        padding: 0.5rem;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .tool-btn {
        padding: 0.6rem;
        font-size: 0.85rem;
    }

    .tools-content,
    .tool-downloads-content {
        padding: 1rem;
    }

    .tool-panel h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .tool-form-area {
        padding: 1rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-actions {
        flex-direction: column;
        gap: 0.8rem;
    }
}

