.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: arc-length-calculator --- */
/* 圆弧长度计算器样式 */
.arc-calculator {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: auto;
    padding: 2rem 0;
}

.arc-calculator .card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.arc-calculator .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 2rem;
}

.arc-calculator .card-body {
    padding: 2rem;
    background: white;
}

/* 圆弧可视化 */
.arc-visual {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.arc-container {
    position: relative;
    width: 200px;
    height: 200px;
    border: 3px solid #667eea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.arc-path {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top: 4px solid #ff6b6b;
    border-right: 4px solid #ff6b6b;
    transform: rotate(-90deg);
    transition: all 0.3s ease;
    transform-origin: center;
}

.arc-path::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    width: 8px;
    height: 8px;
    background: #ff6b6b;
    border-radius: 50%;
}

.arc-path::after {
    content: '';
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 8px;
    height: 8px;
    background: #ff6b6b;
    border-radius: 50%;
}

.arc-center {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
}

.arc-radius {
    position: absolute;
    width: 2px;
    height: 80px;
    background: #667eea;
    transform-origin: bottom;
    transform: rotate(0deg);
    transition: all 0.3s ease;
}

.arc-radius::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -3px;
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
}

.arc-label {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    color: #667eea;
    font-weight: bold;
}

.arc-angle-label {
    position: absolute;
    top: -20px;
    right: -20px;
    background: #ff6b6b;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

/* 输入框样式 */
.form-control {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 12px 16px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-select {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 12px 16px;
    font-size: 16px;
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

/* 按钮样式 */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    padding: 12px 30px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-outline-secondary {
    border-radius: 12px;
    padding: 12px 30px;
    font-weight: 600;
    border: 2px solid #6c757d;
}

/* 结果显示 */
.result-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    border: 2px solid #667eea;
}

.result-value {
    font-size: 3rem;
    font-weight: bold;
    color: #667eea;
    margin: 1rem 0;
}

.formula-display {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    color: #495057;
}

.calculation-steps {
    font-size: 16px;
    color: #6c757d;
    margin-top: 1rem;
}

/* 工具区域 */
.tools-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 2rem;
    margin-top: 2rem;
}

.tool-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    margin: 0 5px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.result-card {
    animation: fadeIn 0.5s ease-out;
}

.btn-primary:active {
    animation: pulse 0.3s ease-out;
}

/* 圆弧动画 */
.arc-path {
    animation: drawArc 0.8s ease-out;
}

@keyframes drawArc {
    from { 
        border-top-color: transparent;
        border-right-color: transparent;
    }
    to { 
        border-top-color: #ff6b6b;
        border-right-color: #ff6b6b;
    }
}

/* 输入框聚焦效果 */
.form-control:focus {
    animation: inputFocus 0.3s ease-out;
}

@keyframes inputFocus {
    from { transform: scale(1); }
    to { transform: scale(1.02); }
}

/* 工具按钮悬停效果 */
.tool-btn:hover {
    animation: toolHover 0.3s ease-out;
}

@keyframes toolHover {
    from { transform: translateY(0); }
    to { transform: translateY(-2px); }
}

/* 错误提示动画 */
.alert {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateX(-100%);
    }
    to { 
        opacity: 1;
        transform: translateX(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .arc-calculator {
        padding: 1rem 0;
    }
    
    .arc-calculator .card-header,
    .arc-calculator .card-body {
        padding: 1.5rem;
    }
    
    .arc-container {
        width: 150px;
        height: 150px;
    }
    
    .arc-path {
        width: 150px;
        height: 150px;
    }
    
    .arc-radius {
        height: 60px;
    }
    
    .result-value {
        font-size: 2rem;
    }
    
    .tool-btn {
        margin: 5px 2px;
        padding: 8px 16px;
        font-size: 14px;
    }
}

@media (max-width: 576px) {
    .arc-calculator .card-header h2 {
        font-size: 1.5rem;
    }
    
    .arc-calculator .card-header p {
        font-size: 0.9rem;
    }
    
    .btn-lg {
        padding: 10px 20px;
        font-size: 16px;
    }
    
    .form-control, .form-select {
        font-size: 14px;
        padding: 10px 12px;
    }
}
