/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: #1a1a2e; background: #f8f9fa; line-height: 1.8; }
a { color: #2563eb; text-decoration: none; } a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* Layout */
.container { max-width: 800px; margin: 0 auto; padding: 0 20px; }
header { background: #1a1a2e; color: #fff; padding: 16px 0; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
header .container { display: flex; align-items: center; justify-content: space-between; }
header a { color: #fff; font-weight: 700; font-size: 1.15rem; }
header nav a { font-size: .9rem; font-weight: 400; margin-left: 18px; opacity: .85; } header nav a:hover { opacity: 1; text-decoration: none; }

/* Hero */
.hero { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); color: #fff; padding: 48px 0 40px; text-align: center; }
.hero h1 { font-size: 2rem; margin-bottom: 12px; }
.hero p { opacity: .85; font-size: 1.05rem; max-width: 600px; margin: 0 auto; }

/* Breadcrumb */
.breadcrumb { font-size: .85rem; color: #666; padding: 12px 0; }
.breadcrumb a { color: #2563eb; }

/* Calculator Card */
.calc-card { background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,.08); padding: 32px; margin: 24px 0; }
.calc-card h2 { font-size: 1.2rem; margin-bottom: 16px; color: #1a1a2e; }

/* Form Elements */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
.form-group input, .form-group select { width: 100%; padding: 12px 14px; border: 2px solid #e2e8f0; border-radius: 8px; font-size: 1rem; transition: border-color .2s; font-family: inherit; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: #2563eb; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.btn { display: inline-block; background: #2563eb; color: #fff; padding: 12px 32px; border: none; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background .2s; font-family: inherit; }
.btn:hover { background: #1d4ed8; text-decoration: none; }
.btn-block { display: block; width: 100%; text-align: center; }

/* Result */
.result-box { background: #f0f9ff; border: 2px solid #2563eb; border-radius: 10px; padding: 24px; margin-top: 20px; display: none; }
.result-box.show { display: block; animation: fadeIn .3s ease; }
.result-label { font-size: .9rem; color: #666; margin-bottom: 4px; }
.result-value { font-size: 1.6rem; font-weight: 700; color: #1a1a2e; }
.result-sub { font-size: .95rem; color: #444; margin-top: 8px; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Content Sections */
.content-section { background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,.08); padding: 32px; margin: 24px 0; }
.content-section h2 { font-size: 1.3rem; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid #e2e8f0; }
.content-section h3 { font-size: 1.1rem; margin: 16px 0 8px; }
.content-section p { margin-bottom: 12px; color: #333; }
.content-section ul, .content-section ol { margin: 8px 0 16px 24px; color: #333; }
.content-section li { margin-bottom: 6px; }
.formula { background: #f1f5f9; border-left: 4px solid #2563eb; padding: 16px; border-radius: 0 8px 8px 0; font-family: 'Courier New', monospace; margin: 12px 0; font-size: .95rem; }

/* FAQ */
.faq-item { border-bottom: 1px solid #e2e8f0; padding: 16px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-q { font-weight: 700; margin-bottom: 8px; color: #1a1a2e; }
.faq-q::before { content: 'Q. '; color: #2563eb; }
.faq-a { color: #444; padding-left: 24px; }
.faq-a::before { content: 'A. '; color: #2563eb; font-weight: 600; }

/* Tool Grid (Index) */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin: 32px 0; }
.tool-card { background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,.08); padding: 24px; transition: transform .2s, box-shadow .2s; }
.tool-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.tool-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.tool-card h3 a { color: #1a1a2e; }
.tool-card p { font-size: .9rem; color: #666; margin-bottom: 12px; }
.tool-card .tag { display: inline-block; background: #eff6ff; color: #2563eb; font-size: .75rem; padding: 4px 10px; border-radius: 20px; font-weight: 600; }

/* Internal Links */
.internal-links { background: #f8fafc; border-radius: 10px; padding: 20px; margin: 24px 0; }
.internal-links h3 { font-size: 1rem; margin-bottom: 12px; }
.internal-links ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.internal-links li a { display: inline-block; background: #fff; border: 1px solid #e2e8f0; padding: 6px 14px; border-radius: 20px; font-size: .85rem; transition: all .2s; }
.internal-links li a:hover { background: #2563eb; color: #fff; border-color: #2563eb; text-decoration: none; }

/* Ad Placeholder（旧スタイル・互換性維持） */
.ad-placeholder { background: #f1f5f9; border: 2px dashed #cbd5e1; border-radius: 8px; padding: 40px; text-align: center; color: #94a3b8; font-size: .85rem; margin: 24px 0; min-height: 100px; display: flex; align-items: center; justify-content: center; }

/* AdSense広告ユニット */
.ad-unit { margin: 24px 0; min-height: 100px; text-align: center; overflow: hidden; }
.ad-unit ins { display: block; }

/* Footer */
footer { background: #1a1a2e; color: #fff; padding: 32px 0; margin-top: 48px; text-align: center; font-size: .9rem; }
footer a { color: #93c5fd; }
footer .footer-links { margin-bottom: 12px; }
footer .footer-links a { margin: 0 12px; }

/* Utility */
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-sm { font-size: .9rem; }
