.tool-fullwidth {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Tool shell */
.academic-tool {
    max-width: 100%;
    margin: 0 auto;
}

.academic-tool.editor-section,
.editor-section.academic-tool {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.academic-tool .card:not(.result-card) {
    border: 1px solid var(--color-border, #e5e7eb);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.06));
    border-radius: var(--radius, 12px);
    background: var(--color-surface, #fff);
}

.academic-tool .card-body {
    padding: 1.25rem 1.35rem;
}

.academic-tool .card-title {
    color: var(--color-text, #1f2937);
    font-weight: 700;
    font-size: 1.05rem;
}

.academic-tool .form-control,
.academic-tool .form-select,
.academic-tool .select-input,
.academic-tool textarea {
    border-radius: 8px;
    border: 1px solid var(--color-border, #e5e7eb);
}

.academic-tool .form-control:focus,
.academic-tool .form-select:focus,
.academic-tool textarea:focus {
    border-color: var(--color-primary, #0d9488);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.academic-tool .btn-primary {
    background: var(--color-primary, #0d9488);
    border-color: var(--color-primary, #0d9488);
}

.academic-tool .btn-primary:hover {
    background: var(--color-primary-hover, #0f766e);
    border-color: var(--color-primary-hover, #0f766e);
}

.academic-tool .alert {
    border-radius: 10px;
}

[data-theme="dark"] .academic-tool .card:not(.result-card) {
    background: var(--color-surface, #1f2937);
    border-color: var(--color-border, #374151);
}

[data-theme="dark"] .academic-tool .card-title,
[data-theme="dark"] .academic-tool .form-label,
[data-theme="dark"] .academic-tool {
    color: var(--color-text, #f9fafb);
}

[data-theme="dark"] .academic-tool .text-muted,
[data-theme="dark"] .academic-tool .form-text {
    color: var(--color-text-secondary, #9ca3af) !important;
}

[data-theme="dark"] .academic-tool .form-control,
[data-theme="dark"] .academic-tool .form-select,
[data-theme="dark"] .academic-tool textarea {
    background: #111827;
    color: var(--color-text, #f9fafb);
    border-color: var(--color-border, #374151);
}

/* --- tool: prism-calculator --- */
/* 正棱柱计算器样式 */
.prism-calculator {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: auto;
    padding: 2rem 0;
}

.calculator-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.prism-type-selector {
    margin-bottom: 2rem;
}

.prism-type-btn {
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    border: 2px solid #dee2e6;
    color: #495057;
    transition: all 0.3s ease;
    border-radius: 12px;
    padding: 0.75rem;
    font-weight: 500;
}

.prism-type-btn:hover {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
}

.prism-type-btn.active {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    border-color: #007bff;
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
}

.calculator-section {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.calculator-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.prism-preview {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    margin-bottom: 1.5rem;
    border: 2px solid #dee2e6;
}

.prism-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    display: block;
}

.input-group-custom {
    position: relative;
    margin-bottom: 1rem;
}

.input-group-custom .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    display: block;
}

.input-group-custom .form-control {
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 0.75rem 3rem 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fff;
}

.input-group-custom .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    background: #fff;
}

.unit-label {
    position: absolute;
    right: 1rem;
    top: 2.5rem;
    color: #6c757d;
    font-weight: 500;
    font-size: 0.9rem;
}

.quick-input-btn {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.quick-input-btn:hover {
    background: linear-gradient(45deg, #218838, #1e7e34);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-calculate {
    background: linear-gradient(45deg, #007bff, #0056b3);
    border: none;
    border-radius: 10px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.btn-calculate:hover {
    background: linear-gradient(45deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
}

.result-box {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.alert-custom {
    border: none;
    border-radius: 12px;
    padding: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
}

.alert-info-custom {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.alert-success-custom {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-warning-custom {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    color: #856404;
    border-left: 4px solid #ffc107;
}

.alert-danger-custom {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.formula-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    border: 2px solid #dee2e6;
}

.formula-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #dee2e6;
    font-size: 0.95rem;
}

.formula-item:last-child {
    border-bottom: none;
}

.formula-item strong {
    color: #495057;
    font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .prism-calculator {
        padding: 1rem 0;
    }
    
    .calculator-container {
        margin: 0 1rem;
        padding: 1.5rem !important;
    }
    
    .prism-type-btn {
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
        padding: 0.6rem;
    }
    
    .prism-icon {
        font-size: 2.5rem;
    }
}

/* 动画效果 */
.calculator-section {
    transition: all 0.3s ease;
}

.btn {
    transition: all 0.3s ease;
}

.form-control {
    transition: all 0.3s ease;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
