/**
 * 百分比计算器样式 - 现代化UI优化
 */

.aiowtb-percentage-calculator {
    max-width: 800px;
    margin: 0 auto;
    color: #333;
    --primary-color: #3498db;
    --primary-hover: #2980b9;
    --accent-color: #f39c12;
    --bg-light: #f8f9fa;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 5px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --radius: 8px;
    --transition: all 0.3s ease;
}

.aiowtb-percentage-calculator .aiowtb-tool-header {
    margin-bottom: 28px;
    text-align: center;
    padding: 0 10px;
}

.aiowtb-percentage-calculator .aiowtb-tool-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #333;
    line-height: 1.3;
}

.aiowtb-percentage-calculator .aiowtb-tool-description {
    font-size: 16px;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    line-height:30px;
}

/* 计算模式选择器 */
.aiowtb-percentage-calculator .aiowtb-calculator-mode-selector {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--bg-light);
    padding: 16px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.aiowtb-percentage-calculator .aiowtb-calculator-mode-selector label {
    font-weight: 600;
    min-width: 90px;
    color: #444;
    font-size: 18px;
}

.aiowtb-percentage-calculator .aiowtb-select {
    flex-grow: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background-color: #fff;
    font-size: 15px;
    color: #333;
    max-width: 450px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    padding-right: 32px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.aiowtb-percentage-calculator .aiowtb-select:focus,
.aiowtb-percentage-calculator .aiowtb-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

/* 计算模块 */
.aiowtb-percentage-calculator .aiowtb-calculator-module {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    display: none; /* 默认隐藏所有模块 */
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.aiowtb-percentage-calculator .aiowtb-calculator-module.active {
    display: block; /* 只显示激活的模块 */
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.aiowtb-percentage-calculator .aiowtb-calculator-module h4 {
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 10px;
    color: #222;
    font-weight: 600;
    position: relative;
    padding-bottom: 10px;
}

.aiowtb-percentage-calculator .aiowtb-calculator-module h4:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--accent-color);
    border-radius: 3px;
}

.aiowtb-percentage-calculator .aiowtb-calculator-module p {
    font-size: 15px;
    color: #666;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* 表单样式 */
.aiowtb-percentage-calculator .aiowtb-form {
    margin-bottom: 24px;
    background-color: var(--bg-light);
    padding: 20px;
    border-radius: var(--radius);
}

.aiowtb-percentage-calculator .aiowtb-form-group {
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.aiowtb-percentage-calculator .aiowtb-form-group:last-child {
    margin-bottom: 0;
}

.aiowtb-percentage-calculator .aiowtb-label {
    font-weight: 600;
    min-width: 120px;
    color: #444;
    font-size: 15px;
}

.aiowtb-percentage-calculator .aiowtb-input {
    flex-grow: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    max-width: 230px;
    font-size: 15px;
    color: #333;
    transition: var(--transition);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.aiowtb-percentage-calculator .aiowtb-input::placeholder {
    color: #aaa;
    opacity: 1;
}

/* 结果区域 */
.aiowtb-percentage-calculator .aiowtb-result-container {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
}

.aiowtb-percentage-calculator .aiowtb-result-container:not(:empty) {
    animation: pulse 0.5s ease-out;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(243, 156, 18, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(243, 156, 18, 0); }
    100% { box-shadow: var(--shadow-sm); }
}

.aiowtb-percentage-calculator .aiowtb-result-header {
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    color: #444;
    font-size: 16px;
}

.aiowtb-percentage-calculator .aiowtb-result-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aiowtb-percentage-calculator .aiowtb-result {
    font-size: 22px;
    font-weight: 700;
    margin: 15px 0;
    color: var(--primary-color);
    text-align: center;
    transition: var(--transition);
    word-break: break-word;
    flex-grow: 1;
}

/* 复制按钮样式 */
.aiowtb-percentage-calculator .aiowtb-copy-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
}

.aiowtb-percentage-calculator .aiowtb-copy-btn:hover {
    background-color: var(--primary-hover);
}

.aiowtb-percentage-calculator .aiowtb-copy-btn:active {
    transform: scale(0.95);
}

.aiowtb-percentage-calculator .aiowtb-copy-btn.copied {
    background-color: #4CAF50;
}

.aiowtb-percentage-calculator .aiowtb-copy-btn svg {
    width: 16px;
    height: 16px;
    margin-right: 4px;
    fill: currentColor;
}

.aiowtb-percentage-calculator .aiowtb-steps {
    font-size: 14px;
    color: #666;
    padding: 15px;
    background: var(--bg-light);
    border-radius: var(--radius);
    margin-top: 12px;
    line-height: 1.6;
}

/* 响应式设计增强 */
@media (max-width: 768px) {
    .aiowtb-percentage-calculator .aiowtb-calculator-module {
        padding: 20px 16px;
    }
    
    .aiowtb-percentage-calculator .aiowtb-form {
        padding: 16px;
    }
    
    .aiowtb-percentage-calculator .aiowtb-result {
        font-size: 22px;
    }
}

@media (max-width: 600px) {
    .aiowtb-percentage-calculator .aiowtb-calculator-mode-selector {
        padding: 14px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .aiowtb-percentage-calculator .aiowtb-calculator-mode-selector label {
        margin-bottom: 5px;
    }
    
    .aiowtb-percentage-calculator .aiowtb-select {
        max-width: 100%;
    }
    
    .aiowtb-percentage-calculator .aiowtb-form-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .aiowtb-percentage-calculator .aiowtb-label {
        margin-bottom: 6px;
    }
    
    .aiowtb-percentage-calculator .aiowtb-input {
        max-width: 100%;
    }
    
    .aiowtb-percentage-calculator .aiowtb-tool-title {
        font-size: 22px;
    }
    
    .aiowtb-percentage-calculator .aiowtb-calculator-module h4 {
        font-size: 18px;
    }
    
    .aiowtb-percentage-calculator .aiowtb-result {
        font-size: 22px;
    }
}

/* 错误状态 */
.aiowtb-percentage-calculator .aiowtb-error {
    color: #e74c3c;
    padding: 10px 15px;
    border-left: 4px solid #e74c3c;
    background: #fdf3f2;
    border-radius: 4px;
    margin: 15px 0;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.aiowtb-percentage-calculator .aiowtb-error:before {
    content: "⚠️";
    margin-right: 8px;
    font-size: 18px;
}

/* 增强交互反馈 */
.aiowtb-percentage-calculator .aiowtb-input:hover,
.aiowtb-percentage-calculator .aiowtb-select:hover {
    border-color: #bbb;
}

/* 高亮当前活跃的输入框 */
.aiowtb-percentage-calculator .aiowtb-input:focus-within {
    border-color: var(--primary-color);
}

/* 使结果区域有内容时更醒目 */
.aiowtb-percentage-calculator .aiowtb-result:not(:empty) {
    padding: 8px 12px;
    background-color: rgba(52, 152, 219, 0.05);
    border-radius: var(--radius);
} 