/* 全体のスタイル */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* ナビゲーションバー */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95) !important;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.nav-link {
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: #0d6efd !important;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

/* New标签样式 */
.badge {
    font-size: 0.65rem;
    padding: 0.25em 0.5em;
}

/* 导航栏阴影 */
.shadow-sm {
    box-shadow: 0 2px 4px rgba(0,0,0,.075) !important;
}

/* メインコンテンツ */
.calculation-section {
    background: #fff;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,.05);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-control {
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 0.75rem;
}

.btn-primary {
    background: #007AFF;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
}

.result-box {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    height: 100%;
}

/* カード */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,.05);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-5px);
}

/* フッター */
footer {
    border-top: 1px solid #eee;
}

footer a {
    color: #666;
    text-decoration: none;
}

footer a:hover {
    color: #333;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .calculation-section {
        padding: 1rem;
    }
    
    .result-box {
        margin-top: 2rem;
    }
} 

/* 計算ツール */
.calculator-card {
    border: 1px solid rgba(0,0,0,.125);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.calculator-card .card-header {
    padding: 1.25rem;
    border-bottom: 1px solid rgba(0,0,0,.125);
}

.calculator-card .card-body {
    padding: 1.5rem;
}

.calculator-card .form-group {
    margin-bottom: 1.25rem;
}

.calculator-card .form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #495057;
}

.calculator-card .input-group {
    position: relative;
}

/* 输入框悬停效果 */
.calculator-card .form-control:hover {
    border-color: #80bdff;
}

/* 输入框焦点效果 */
.calculator-card .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13,110,253,.25);
}

/* 结果框样式优化 */
.result-box {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-top: 1.25rem;
    border: 1px solid #e9ecef;
}

.result-box p {
    color: #495057;
}

.result-box .h4 {
    color: #0d6efd;
    font-weight: 600;
}

/* 输入验证提示 */
.invalid-feedback {
    display: none;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* 计算按钮样式优化 */
.calculator-btn {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* 加载动画 */
.calculating {
    position: relative;
    pointer-events: none;
}

.calculating::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
    margin-left: 0.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ボタン */
.btn {
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,.2);
}

.btn-primary {
    background-color: #0d6efd;
}

.btn-success {
    background-color: #198754;
}

.btn-info {
    background-color: #0dcaf0;
}

/* 結果表示のアニメーション */
#concentration-result {
    transition: opacity 0.3s ease-in-out;
}

/* 入力フィールドのフォーカス効果 */
.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* エラー表示のスタイル */
.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 80%;
    color: #dc3545;
}

.is-invalid ~ .invalid-feedback {
    display: block;
}

/* 計算式の表示スタイル */
.formula-box {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
}

.formula-label {
    color: #495057;
    font-weight: 500;
    font-size: 0.9rem;
}

.formula {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.formula-text {
    font-size: 1rem;
    color: #212529;
}

/* 分数表示のスタイル */
.fraction {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 0 0.25rem;
}

.numerator, .denominator {
    padding: 0.25rem 0.5rem;
    min-width: 100px;
}

.fraction-line {
    width: 100%;
    height: 1px;
    background-color: #212529;
    margin: 0.25rem 0;
}

/* 計算過程の表示 */
.calculation-process {
    font-size: 0.9rem;
    color: #6c757d;
    padding-top: 1rem;
    border-top: 1px dashed #dee2e6;
}

.process-text {
    margin: 0 0.25rem;
}

.process-result {
    margin-left: 0.5rem;
    font-weight: 500;
    color: #0d6efd;
}

/* アニメーション効果 */
.calculation-process {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease-out;
}

.calculation-process.show {
    opacity: 1;
    transform: translateY(0);
}

/* ブログ記事スタイル */
.blog-article {
    font-size: 1.1rem;
    line-height: 1.7;
}

.article-header {
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 2rem;
}

.article-meta {
    font-size: 0.9rem;
}

.table-of-contents {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #007bff;
}

.toc-list {
    margin-bottom: 0;
}

.toc-list a {
    text-decoration: none;
    color: #495057;
    transition: color 0.3s ease;
}

.toc-list a:hover {
    color: #007bff;
}

.content-section {
    scroll-margin-top: 100px;
}

.section-title {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.formula-box {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    position: relative;
}

.formula-box::before {
    content: "公式";
    position: absolute;
    top: -12px;
    left: 20px;
    background: white;
    padding: 0 10px;
    font-size: 0.8rem;
    font-weight: bold;
    color: #6c757d;
}

.formula-display {
    font-size: 1.2rem;
    font-weight: 500;
}

.fraction {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    margin: 0 5px;
    vertical-align: middle;
}

.numerator, .denominator {
    padding: 2px 8px;
}

.fraction-line {
    width: 100%;
    height: 2px;
    background-color: #333;
    margin: 2px 0;
}

.example-box {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-left: 4px solid #28a745;
}

.verification {
    border-left: 4px solid #28a745;
}

.procedure {
    border-left: 4px solid #ffc107;
}

.note {
    border-left: 4px solid #17a2b8;
}

.highlight-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
}

.tip-box {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
}

.summary-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f4f8 100%);
    border: 2px solid #007bff;
}

.tools-cta {
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.related-articles .card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-articles .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.external-links {
    border-left: 4px solid #6c757d;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .blog-article {
        font-size: 1rem;
    }

    .formula-display {
        font-size: 1rem;
    }

    .fraction {
        margin: 0 2px;
    }

    .table-responsive {
        font-size: 0.9rem;
    }
}