/* 分数工具页面样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'SimHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
    position: relative;
}

.back-button {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.back-button:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-50%) scale(1.05);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* 主要内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

/* 输入区域 */
.input-section {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.fraction-input {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.fraction-input label {
    font-size: 1.1em;
    font-weight: bold;
    color: #555;
}

.fraction-input input {
    width: 80px;
    height: 60px;
    font-size: 2em;
    text-align: center;
    border: 3px solid #667eea;
    border-radius: 10px;
    background: #f8f9ff;
    transition: all 0.3s ease;
}

.fraction-input input:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
}

.fraction-line {
    width: 100px;
    height: 4px;
    background: #667eea;
    border-radius: 2px;
}

.fraction-display {
    text-align: center;
}

.fraction-display #fractionText {
    font-size: 3em;
    font-weight: bold;
    color: #667eea;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.decimal-display {
    margin-top: 10px;
    font-size: 1.5em;
    color: #666;
}

.decimal-display #decimalValue {
    color: #764ba2;
    font-weight: bold;
}

/* 可视化区域 */
.visualization-section {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.circle-container {
    position: relative;
}

.circle-container svg {
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.1));
}

.info-panel {
    text-align: center;
    width: 100%;
}

.explanation {
    margin-bottom: 15px;
}

.explanation h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.explanation p {
    font-size: 1.1em;
    color: #666;
    line-height: 1.5;
}

.badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.badge.proper {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.badge.improper {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
}

.badge.whole {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
}

/* 示例按钮区域 */
.examples-section {
    background: rgba(255,255,255,0.9);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.examples-section h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.example-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.example-btn {
    padding: 12px 20px;
    font-size: 1.2em;
    font-weight: bold;
    border: none;
    border-radius: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.example-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.example-btn:active {
    transform: translateY(-1px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .back-button {
        position: relative;
        margin-bottom: 20px;
        transform: none;
    }
    
    .input-section, .visualization-section {
        padding: 20px;
    }
    
    .fraction-input input {
        width: 60px;
        height: 50px;
        font-size: 1.5em;
    }
    
    .fraction-display #fractionText {
        font-size: 2.5em;
    }
    
    .circle-container svg {
        width: 250px;
        height: 250px;
    }
    
    .example-buttons {
        gap: 10px;
    }
    
    .example-btn {
        padding: 10px 16px;
        font-size: 1em;
    }
}

/* SVG 动画效果 */
.fraction-segment {
    transition: all 0.5s ease;
}

.fraction-segment:hover {
    opacity: 0.8;
    transform-origin: 150px 150px;
    transform: scale(1.05);
} 