:root {
    --bg-color: #121212;
    --surface-color: #1a1a1a;
    --primary-color: #00e5ff;
    --primary-variant: #00b8d4;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --divider: #333333;
    --accent-color: #b2ff59;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.7;
    padding: 0;
}

.guide-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
    animation: fadeIn 0.5s ease-out;
}

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

header {
    text-align: center;
    margin-bottom: 3rem;
    padding-top: 1rem;
}

header h1 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.btn-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.btn-nav:hover { opacity: 0.8; }

.guide-card {
    background: var(--surface-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--divider);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
}

h3 {
    font-size: 1.2rem;
    color: var(--accent-color);
    margin: 1.5rem 0 0.8rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

ul, ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

li { margin-bottom: 0.5rem; }

code {
    background: rgba(0,0,0,0.3);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    color: var(--primary-color);
}

.math-block {
    background: #000;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 1.5rem 0;
    border: 1px solid var(--divider);
}

/* 目次ページ用リンクカード */
.index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.index-card {
    background: var(--surface-color);
    border: 1px solid var(--divider);
    border-radius: 16px;
    padding: 1.5rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.index-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    background: rgba(0, 229, 255, 0.05);
    box-shadow: 0 10px 20px rgba(0, 229, 255, 0.1);
}

.index-card h2 {
    border: none;
    padding: 0;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.index-card p {
    font-size: 0.9rem;
    margin-bottom: 0px;
}

footer {
    text-align: center;
    margin-top: 4rem;
    padding-bottom: 2rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.app-back-float {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary-color);
    color: var(--bg-color);
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 800;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.4);
    transition: transform 0.2s;
    z-index: 100;
}

.app-back-float:hover {
    transform: scale(1.05);
}

@media (max-width: 600px) {
    .guide-wrapper { padding: 1rem; }
    header { margin-bottom: 2rem; }
    header h1 { font-size: 1.5rem; }
    .guide-card { padding: 1.2rem; }
    .index-grid { grid-template-columns: 1fr; }
}
