:root { --primary: #2563eb; --bg: #f8fafc; --text: #1e293b; --surface: #ffffff; --border: #e2e8f0; --accent-red: #ef4444; --accent-green: #10b981; }
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background: var(--bg); color: var(--text); padding-bottom: 70px; }

header { background: var(--primary); padding: 20px; position: sticky; top: 0; z-index: 100; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
.logo { color: white; font-weight: 700; font-size: 1.4rem; margin-bottom: 16px; letter-spacing: -0.02em; }
#search-bar { width: 100%; padding: 12px 16px; border-radius: 8px; border: none; font-size: 1rem; outline: none; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }

main { padding: 20px; max-width: 800px; margin: 0 auto; }

.part-card { background: var(--surface); margin-bottom: 16px; border-radius: 12px; border: 1px solid var(--border); overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.part-title { padding: 16px; font-weight: 600; font-size: 1rem; color: var(--text); display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.part-title:hover { background: #f1f5f9; }
.part-content { padding: 0 16px 16px; display: none; }
.part-content.open { display: block; }

.topic-btn { display: block; width: 100%; text-align: left; background: none; border: none; padding: 12px 0; border-top: 1px solid var(--border); font-size: 1rem; color: var(--primary); font-weight: 500; cursor: pointer; }

/* Detail View */
.back-btn { background: none; border: none; color: var(--primary); font-weight: 600; font-size: 1rem; margin-bottom: 20px; cursor: pointer; display:flex; align-items:center; gap: 8px;}
.detail-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 24px; color: var(--text); line-height:1.4;}
.detail-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.detail-card h3 { font-size: 0.85rem; text-transform: uppercase; color: #64748b; letter-spacing: 0.05em; margin-bottom: 10px; border-bottom: 1px solid var(--border); padding-bottom: 8px;}
.kv-row { margin-bottom: 14px; }
.kv-row strong { color: var(--text); display: block; margin-bottom: 4px; font-size: 0.95rem; }
.kv-row span { color: #475569; display: block; line-height: 1.5; font-size: 0.95rem; }

.notes-container { background: #fef2f2; border-left: 4px solid var(--accent-red); padding: 16px; border-radius: 4px 8px 8px 4px; margin-top: 20px; }
.notes-container strong { color: #b91c1c; display: block; margin-bottom: 8px; font-size: 0.95rem;}
.note-item { margin-bottom: 8px; font-size: 0.9rem; color: #7f1d1d; position: relative; padding-left: 14px; line-height:1.5;}
.note-item::before { content: '•'; position: absolute; left: 0; font-weight: bold;}

/* Bottom Nav */
.bottom-nav { position: fixed; bottom: 0; width: 100%; background: white; border-top: 1px solid var(--border); display: flex; box-shadow: 0 -4px 6px -1px rgba(0,0,0,0.05); z-index: 100; }
.nav-btn { flex: 1; padding: 12px; background: none; border: none; font-size: 0.8rem; font-weight: 600; color: #64748b; cursor: pointer; }
.nav-btn.active { color: var(--primary); border-top: 3px solid var(--primary); }

/* Calculator */
.calc-box { text-align: center; padding: 40px 20px; background:white; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.05);}
.calc-box h2 { margin-bottom: 10px; color: var(--text); }
.calc-input { font-size: 1.5rem; text-align: center; width: 120px; padding: 12px; border: 2px solid var(--primary); border-radius: 8px; margin: 10px; font-weight:600;}
