/* 数值转换工具样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.header-content {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.course-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    margin-right: 20px;
    height: fit-content;
    min-height: 60px;
    justify-content: center;
}

.course-title {
    font-size: 18px;
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
    line-height: 1.1;
}

.course-subtitle {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.9;
    display: block;
    line-height: 1.1;
}

.subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 0;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-tab {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 15px 25px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.nav-tab:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.nav-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Tab Content */
.tab-content {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

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

/* Converter Section */
.converter-section h2,
.arithmetic-section h2,
.logical-section h2 {
    color: #2d3748;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.8rem;
}

.converter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.converter-group {
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 15px;
    border: 2px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

.converter-group:hover {
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.converter-group label {
    display: block;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.number-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.number-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-info {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

/* Arithmetic Section */
.arithmetic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.arithmetic-group {
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 15px;
    border: 2px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

.arithmetic-group:hover {
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.arithmetic-group label {
    display: block;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1rem;
}

.base-select,
.operator-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.base-select:focus,
.operator-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Logical Section */
.logical-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.logical-group {
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 15px;
    border: 2px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

.logical-group:hover {
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.logical-group label {
    display: block;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1rem;
}

/* Buttons */
.converter-actions,
.arithmetic-actions,
.logical-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #666;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Results */
.conversion-result,
.arithmetic-result,
.logical-result {
    background: rgba(102, 126, 234, 0.1);
    padding: 25px;
    border-radius: 15px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    margin-top: 20px;
}

.conversion-result h3,
.arithmetic-result h3,
.logical-result h3 {
    color: #2d3748;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
}

.result-grid,
.result-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.result-item {
    background: rgba(255, 255, 255, 0.8);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-label {
    font-weight: 600;
    color: #2d3748;
}

.result-value {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: #667eea;
    font-size: 1.1rem;
}

/* Logical Guide */
.logical-guide {
    background: rgba(255, 255, 255, 0.8);
    padding: 25px;
    border-radius: 15px;
    border: 2px solid rgba(102, 126, 234, 0.1);
    margin-top: 30px;
}

.logical-guide h3 {
    color: #2d3748;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.guide-item {
    background: rgba(102, 126, 234, 0.1);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    font-size: 0.95rem;
    line-height: 1.5;
}

.guide-item strong {
    color: #667eea;
    font-weight: 700;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .title {
        font-size: 2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .course-badge {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .nav-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-tab {
        width: 100%;
        max-width: 300px;
    }
    
    .converter-grid,
    .arithmetic-grid,
    .logical-grid {
        grid-template-columns: 1fr;
    }
    
    .result-grid,
    .result-display {
        grid-template-columns: 1fr;
    }
    
    .guide-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 20px;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .converter-group,
    .arithmetic-group,
    .logical-group {
        padding: 15px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* 进制选择器样式 */
.base-selector {
    background: rgba(255, 255, 255, 0.9);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.base-selector h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 600;
}

.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 12px 24px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 25px;
    transition: all 0.3s ease;
    user-select: none;
    font-weight: 500;
}

.radio-label:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #667eea;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    background: #667eea;
    border-color: #667eea;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.radio-label input[type="radio"]:checked ~ .radio-label {
    background: rgba(102, 126, 234, 0.3);
}

/* 输入区域样式 */
.converter-input-area {
    margin-bottom: 25px;
}

.converter-input-area .input-group {
    background: rgba(255, 255, 255, 0.9);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .radio-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .radio-label {
        justify-content: center;
    }
}
