
/* BASE CSS & LIGHT MODE */
:root { 
    --sidebar-w: 320px; 
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    --font-serif: "Noto Serif SC", serif; 
    --bg-c: #f8f9fa; 
    --text-c: #333; 
    --border-c: #e5e5e5; 
    --pri-c: #0A192F; 
    --hov-bg: #f1f3f5; 
    --gold: #48a6a2; 
    --gold-light: #5ec0bc; 
    --gold-glow: rgba(72,166,162,0.12);
    --card-bg: #fff;
    --sidebar-bg: #fff;
    --search-bg: #fafafa;
    --block-bg: #fff;
}



* { box-sizing: border-box; }
body { margin: 0; padding: 0; font-family: var(--font-sans); color: var(--text-c); background: var(--bg-c); display: flex; }
a { text-decoration: none; color: inherit; }

/* Sidebar */
.sidebar { width: var(--sidebar-w); height: 100vh; position: fixed; left: 0; top: 0; background: var(--sidebar-bg); border-right: 1px solid var(--border-c); overflow-y: auto; z-index: 100; transition: transform 0.3s ease; }
.sidebar-header { padding: 1.5rem; border-bottom: 2px solid var(--pri-c); text-align: center; font-family: var(--font-serif); font-size: 1.4rem; font-weight: bold; }
.logo { color: var(--pri-c); }
.sidebar-nav { padding: 1rem 0; }
.search-box { padding: 8px 12px; margin-bottom: 12px; position: relative; }
.search-box input { width: 100%; padding: 7px 10px; border: 1px solid var(--border-c); border-radius: 6px; background: var(--search-bg); font-size: 13px; outline: none; color: var(--text-c); }
.search-box input:focus { border-color: var(--gold); }
.search-results { position: absolute; top: calc(100% + 4px); left: 12px; right: 12px; background: var(--sidebar-bg); border: 1px solid var(--border-c); border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); max-height: 400px; overflow-y: auto; z-index: 999; }
.search-item { display: block; padding: 8px 10px; border-bottom: 1px solid var(--border-c); color: var(--text-c); font-size: 13px; transition: background 0.2s; }
.search-item:hover { background: var(--hov-bg); }
.search-empty { padding: 12px; text-align: center; color: var(--text-c); opacity: 0.5; font-size: 13px; }
mark { background: rgba(72,166,162,0.3); color: inherit; font-weight: bold; padding: 0 2px; border-radius: 2px; }

.nav-link { display: block; padding: 0.6rem 1.5rem; color: var(--text-c); font-size: 0.95rem; border-left: 3px solid transparent; }
.nav-link:hover { background: var(--hov-bg); color: var(--pri-c); font-weight: 600; }
.nav-link.active { background: var(--gold-glow); color: var(--pri-c); font-weight: 700; border-left-color: var(--gold); }
.nav-group-title { padding: 0.8rem 1.5rem; font-weight: 600; color: var(--pri-c); cursor: pointer; display: flex; align-items: center; }
.nav-group-title:hover { background: var(--hov-bg); }
.nav-group-items { display: none; }
.nav-group-items.open { display: block; }
.caret { display: inline-block; margin-right: 8px; width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 5px solid var(--text-c); opacity: 0.5; }
.nav-group-items.open + .nav-group-title .caret, .nav-group-title.open .caret, .caret.open { transform: rotate(90deg); border-left-color: var(--gold); opacity: 1; }
.badge { background: var(--search-bg); color: var(--text-c); border: 1px solid var(--border-c); font-size: 0.75rem; padding: 2px 6px; border-radius: 12px; margin-left: auto; }

/* Content Wrapper */
.main { margin-left: var(--sidebar-w); width: calc(100% - var(--sidebar-w)); min-height: 100vh; background: var(--bg-c); }
.main-inner, .article-wrapper { max-width: 900px; padding: 0 48px 80px; margin: 0 auto; }
.article-wrapper { padding-top: 3rem; }

/* Memo Page Styling (V4) */
.memo-header { padding: 0 0 1.5rem 0; border-bottom: 2px solid var(--border-c); margin-bottom: 2rem; }
.memo-header h1 { font-family: var(--font-serif); font-size: 2.2rem; font-weight: 900; color: var(--pri-c); margin: 0 0 0.8rem 0; line-height: 1.3; }
.memo-header .meta { color: var(--text-c); opacity:0.8; font-size: 0.95rem; margin-bottom: 1rem; }
.memo-nav { display: flex; justify-content: space-between; align-items: center; }
.nav-btn { display: inline-block; padding: 8px 16px; background: var(--card-bg); border: 1px solid var(--border-c); border-radius: 6px; font-size: 0.9rem; color: var(--gold); transition: all 0.2s; font-weight: 600; }
.nav-btn:hover { background: var(--gold); color: #fff; border-color: var(--gold); transform: translateY(-1px); box-shadow: 0 4px 12px var(--gold-glow); }

.memo-summary { background: rgba(72,166,162,0.06); border-left: 4px solid var(--gold); padding: 1.5rem 2rem; border-radius: 0 8px 8px 0; margin-bottom: 2rem; }
.memo-summary h3 { margin: 0 0 1rem 0; font-family: var(--font-serif); color: var(--pri-c); font-size: 1.2rem; }
.memo-summary p { line-height: 1.8; margin-bottom: 0.8rem; }
.placeholder-content { border-left-color: #888; background: var(--block-bg); border: 1px dashed var(--border-c); }

.memo-article { background: var(--block-bg); padding: 2.5rem; border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,0.04); margin-bottom: 3rem; border: 1px solid var(--border-c); font-size: 1.05rem; line-height: 1.9;}
.memo-article h3 { font-family: var(--font-serif); font-size: 1.4rem; color: var(--pri-c); margin-top: 0; padding-bottom: 0.8rem; border-bottom: 1px solid var(--border-c); }
.memo-article h4 { font-family: var(--font-serif); font-size: 1.15rem; color: var(--pri-c); margin-top: 2rem; margin-bottom: 0.5rem; }
.memo-article p { margin-bottom: 1rem; }
.memo-article blockquote { font-style: italic; border-left: 3px solid var(--border-c); padding-left: 1.5rem; margin: 1.5rem 0; color: var(--text-c); opacity: 0.8; font-family: var(--font-serif); }
.term { color: var(--gold); font-family: monospace; padding: 0 4px; background: var(--gold-glow); border-radius: 4px; font-size: 0.9em; }

.memo-pdf-section h3 { font-family: var(--font-serif); font-size: 1.2rem; color: var(--pri-c); margin-bottom: 1rem; }
.pdf-container { width: 100%; height: 85vh; border: 1px solid var(--border-c); border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 8px 32px rgba(0,0,0,0.06); }

/* Dashboard Styles */
.hero-section { position: relative; padding: 72px 0 56px; text-align: center; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 0 auto 48px; }
.stat-item { text-align: center; padding: 24px 12px; position: relative; transition: all 0.3s; background: var(--card-bg); border: 1px solid var(--border-c); border-radius: 14px; display: flex; flex-direction: column; justify-content: center; }
.stat-item:hover { border-color: var(--gold-light); transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.04); }
.stat-num { font-family: var(--font-serif); font-size: 42px; font-weight: 900; color: var(--pri-c); line-height: 1; margin-bottom: 8px; letter-spacing: -1px; }
.stat-label { font-size: 13px; color: var(--text-c); opacity:0.8; font-weight: 600; letter-spacing: 0.5px; }
.hero-title { font-family: var(--font-serif); font-size: clamp(32px, 5vw, 48px); font-weight: 900; line-height: 1.25; letter-spacing: -1px; color: var(--pri-c); margin-bottom: 12px; }
.hero-title .gold { color: var(--gold); }
.hero-sub { font-size: 17px; color: var(--text-c); opacity:0.8; line-height: 1.8; margin: 0 auto; max-width: 640px; font-family: var(--font-serif); }
.nav-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 56px; }
.nav-card { padding: 28px 20px 24px; background: var(--card-bg); border: 1px solid var(--border-c); border-radius: 14px; transition: all 0.3s; display: block; }
.nav-card:hover { transform: translateY(-4px); border-color: var(--gold-light); }
.nav-card-icon { font-size: 32px; margin-bottom: 14px; display: block; }

/* Sections (Widgetized for user request) */
.section { background: var(--card-bg); border: 1px solid var(--border-c); border-radius: 14px; padding: 24px 32px; margin-bottom: 32px; box-shadow: 0 4px 24px rgba(0,0,0,0.02); }
.section-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.section-line { flex: 1; height: 1px; background: var(--border-c); }
.section-title { font-family: var(--font-serif); font-size: 22px; font-weight: 700; color: var(--pri-c); margin: 0; }
.section-count { font-size: 12px; color: var(--gold); background: var(--gold-glow); padding: 3px 10px; border-radius: 12px; margin: 0; }

/* Tag Cloud */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; background: var(--bg-c); border: 1px solid var(--border-c); border-radius: 24px; font-size: 14px; font-weight: 500; transition: all 0.25s; }
.tag:hover { border-color: var(--gold); color: var(--pri-c); box-shadow: 0 4px 16px var(--gold-glow); transform: translateY(-2px); }
.tag-n { font-size: 11px; font-weight: 700; color: #fff; background: var(--gold); padding: 2px 8px; border-radius: 10px; min-width: 20px; text-align: center; }
.tag.tier-1 { font-size: 16px; padding: 10px 22px; font-weight: 700; border-color: var(--gold-light); background: linear-gradient(135deg, var(--gold-glow), var(--bg-c)); }

/* People Grid */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.person-card { display: flex; flex-direction: column; align-items: center; padding: 24px 16px 20px; border: 1px solid var(--border-c); background: var(--bg-c); border-radius: 14px; text-align: center; transition: all 0.3s; }
.person-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.06); border-color: var(--gold-light); }
.person-avatar { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, var(--pri-c), #333); display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 12px; color: var(--gold-light); font-family: var(--font-serif); font-weight: 700; }
.person-name { font-family: var(--font-serif); font-size: 15px; font-weight: 700; color: var(--pri-c); margin-bottom: 4px; }
.person-refs { font-size: 12px; color: var(--text-c); opacity:0.8; }

/* Changelog Styles */
.changelog h1 { font-family: var(--font-serif); font-size: 2.4rem; font-weight: 900; color: var(--pri-c); margin: 0 0 4px 0; }
.changelog .changelog-sub { color: var(--text-c); opacity: 0.7; margin-bottom: 40px; font-size: 15px; }
.changelog h2 { font-family: var(--font-serif); font-size: 1.35rem; font-weight: 700; color: var(--pri-c); margin: 40px 0 16px 0; padding-bottom: 10px; border-bottom: 2px solid var(--gold); }
.version { display: inline-block; background: linear-gradient(135deg, var(--gold), var(--gold-light)); color: #fff; font-size: 13px; font-weight: 700; padding: 3px 12px; border-radius: 6px; margin-right: 10px; vertical-align: middle; font-family: var(--font-sans); letter-spacing: 0.5px; }
.change-list { list-style: none; padding: 0; margin: 16px 0; }
.change-list li { padding: 10px 0 10px 32px; position: relative; border-bottom: 1px solid var(--border-c); line-height: 1.7; font-size: 0.95rem; }
.change-list li:last-child { border-bottom: none; }
.change-list li::before { content: ''; position: absolute; left: 10px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.change-type { font-size: 11px; padding: 2px 8px; border-radius: 4px; color: #fff; font-weight: 700; margin-right: 8px; text-transform: uppercase; letter-spacing: 0.5px; vertical-align: middle; }
.change-type.feat { background: #059669; }
.change-type.fix { background: #dc2626; }
.change-type.infra { background: #7c3aed; }
.change-type.data { background: #0284c7; }
.change-type.plan { background: #64748b; }
.nav-changelog { border-top: 1px solid var(--border-c); margin-top: 8px; padding-top: 8px !important; }

@media(max-width: 768px) {
    .sidebar { transform: translateX(-100%); width: 280px; }
    .main { margin-left: 0; width: 100%; }
    .main-inner, .article-wrapper { padding: 4rem 1.5rem 2rem; }
    .memo-article { padding: 1.5rem; }
    .nav-cards { grid-template-columns: 1fr 1fr; }
}
