/* 프리미엄 한글 폰트(Pretendard) — 없으면 시스템 폰트로 자연 폴백 */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.css");

/* ====================================================================
   수도여고 배움터 - 공용 스타일 (2026 프리미엄 리디자인)
   과목 페이지는 <body class="theme-xxx"> 로 강조색을 바꿉니다.
   ==================================================================== */
:root {
  --bg: #f7f8fc;
  --card: #ffffff;
  --primary: #4f6df5;
  --primary-dark: #3a55d9;
  --accent: #16c79a;
  --danger: #ef5b5b;
  --text: #1b2130;
  --muted: #6b7488;
  --border: #eaedf4;
  --radius: 16px;
  --shadow: 0 4px 14px rgba(28, 40, 80, 0.05), 0 1px 3px rgba(28, 40, 80, 0.04);
  --shadow-hover: 0 16px 40px rgba(28, 40, 80, 0.12), 0 4px 10px rgba(28, 40, 80, 0.06);
  --ring: 0 0 0 3px rgba(79, 109, 245, 0.14);
}
/* 과목별 테마 색상 */
.theme-english { --primary: #4f6df5; --primary-dark: #3a55d9; }
.theme-ai      { --primary: #7c5cff; --primary-dark: #6344e0; }
.theme-japanese{ --primary: #ff5b7f; --primary-dark: #e84268; }
.theme-history { --primary: #c0392b; --primary-dark: #a52f22; }
.theme-science { --primary: #0d9488; --primary-dark: #0b7c72; }
.theme-python  { --primary: #306998; --primary-dark: #245179; }
.theme-math    { --primary: #ea580c; --primary-dark: #c2410c; }

/* ---------- 다크 모드 ---------- */
html.dark {
  --bg: #12151c;
  --card: #1c2230;
  --text: #e3e8f0;
  --muted: #98a2b6;
  --border: #2b3242;
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.30), 0 1px 3px rgba(0, 0, 0, 0.28);
  --shadow-hover: 0 16px 40px rgba(0, 0, 0, 0.45), 0 4px 10px rgba(0, 0, 0, 0.30);
}
html.dark input, html.dark textarea, html.dark select { background: #222b3d; color: var(--text); }
html.dark .code-editor { background: #11151f; }
html.dark .flash-back { background: #222b3d; }
html.dark .quiz-opt.correct { background: rgba(22, 199, 154, 0.15); }
html.dark .quiz-opt.wrong { background: rgba(239, 91, 91, 0.15); }
html.dark .score-badge { background: rgba(79, 109, 245, 0.22); }
html.dark .typing-input.ok { background: rgba(22, 199, 154, 0.15); }
html.dark .typing-input.err { background: rgba(239, 91, 91, 0.15); }
html.dark .post-foot .like-btn.liked { background: rgba(239, 91, 91, 0.18); }
html.dark .speak-btn { background: rgba(79, 109, 245, 0.18); }

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Pretendard Variable', 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', '맑은 고딕', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- 상단 / 헤더 ---------- */
.topbar {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--card);
  padding: 8px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  transition: all 0.15s ease;
}
.back-link:hover { color: var(--primary); transform: translateX(-2px); }

header {
  text-align: center;
  padding: 22px 16px 12px;
}
header h1 { font-size: 1.85rem; font-weight: 800; color: var(--primary); letter-spacing: -0.8px; }
header p { color: var(--muted); font-size: 0.92rem; margin-top: 6px; }

/* ---------- 탭 내비게이션 ---------- */
nav {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 14px 12px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}
nav button {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  padding: 10px 17px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.18s cubic-bezier(.4,0,.2,1);
}
nav button:hover { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
nav button.active { background: var(--primary); color: #fff; border-color: transparent; box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 35%, transparent); }

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 16px 60px;
}
.panel { display: none; animation: fade 0.25s ease; }
.panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.section-title { font-size: 1.15rem; margin-bottom: 12px; font-weight: 700; }
.hint { color: var(--muted); font-size: 0.85rem; margin-bottom: 16px; }

/* ---------- 플래시카드 ---------- */
.flashcard { perspective: 1200px; height: 260px; margin-bottom: 18px; }
.flashcard-inner {
  position: relative; width: 100%; height: 100%;
  transition: transform 0.55s; transform-style: preserve-3d; cursor: pointer;
}
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  border-radius: 20px; background: var(--card); box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; text-align: center;
}
.flash-back { transform: rotateY(180deg); background: #eef2ff; }
.flash-word { font-size: 2rem; font-weight: 700; color: var(--primary); }
.flash-pos { color: var(--muted); font-size: 0.85rem; margin-top: 6px; }
.flash-mean { font-size: 1.6rem; font-weight: 700; }
.flash-ex { color: var(--muted); font-size: 0.95rem; margin-top: 14px; font-style: italic; }
.tap-hint { position: absolute; bottom: 12px; font-size: 0.75rem; color: var(--muted); }

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  border: none; border-radius: 13px; padding: 12px 18px;
  font-size: 0.95rem; font-weight: 700; cursor: pointer; letter-spacing: -0.01em;
  transition: all 0.18s cubic-bezier(.4,0,.2,1); flex: 1; min-width: 90px;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 30%, transparent); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 38%, transparent); }
.btn-ghost { background: var(--card); color: var(--text); box-shadow: var(--shadow); border: 1px solid var(--border); }
.btn-ghost:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(22,199,154,.3); }
.btn-accent:hover { transform: translateY(-2px); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { transform: translateY(-2px); }
.btn:active { transform: scale(0.97); }

.progress { text-align: center; color: var(--muted); font-size: 0.9rem; margin: 10px 0 14px; }

/* ---------- 퀴즈 ---------- */
.quiz-q { font-size: 1.2rem; font-weight: 700; margin-bottom: 4px; }
.quiz-sub { color: var(--muted); font-size: 0.85rem; margin-bottom: 16px; }
.quiz-options { display: grid; gap: 10px; }
.quiz-opt {
  background: var(--card); border: 2px solid var(--border);
  border-radius: 12px; padding: 14px 16px; cursor: pointer;
  font-size: 1rem; text-align: left; transition: all 0.15s ease;
}
.quiz-opt:hover { border-color: var(--primary); }
.quiz-opt.correct { border-color: var(--accent); background: #e8fbf4; }
.quiz-opt.wrong { border-color: var(--danger); background: #fdeaea; }
.quiz-opt.disabled { pointer-events: none; opacity: 0.85; }
.quiz-feedback { margin: 14px 0; font-weight: 600; min-height: 24px; }

/* ---------- 회화 / 카테고리 ---------- */
.cat-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.cat-tab {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 14px; font-size: 0.85rem;
  cursor: pointer; font-weight: 600; color: var(--muted);
}
.cat-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.phrase {
  background: var(--card); border-radius: 16px; padding: 17px 18px;
  box-shadow: var(--shadow); border: 1px solid var(--border); margin-bottom: 12px;
  transition: transform 0.18s cubic-bezier(.4,0,.2,1), box-shadow 0.18s ease, border-color 0.18s ease;
}
.phrase:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.phrase-en { font-size: 1.1rem; font-weight: 700; }
.phrase-ko { color: var(--muted); margin-top: 4px; }
.codeblock {
  background: #1e2330; color: #e6e9f0; border-radius: 10px;
  padding: 14px 16px; margin: 10px 0 4px;
  font-family: "Consolas", "D2Coding", "Courier New", monospace;
  font-size: 0.9rem; line-height: 1.55; overflow-x: auto; white-space: pre;
}

/* ---------- 코드 실행기 ---------- */
.code-editor {
  width: 100%; min-height: 220px; border: 2px solid var(--border); border-radius: 12px;
  padding: 14px 16px; tab-size: 4;
  font-family: "Consolas", "D2Coding", "Courier New", monospace;
  font-size: 0.95rem; line-height: 1.5; resize: vertical;
  background: #1e2330; color: #e6e9f0;
}
.code-editor:focus { outline: none; border-color: var(--primary); }
.run-output {
  background: #0f1320; color: #d6f5e0; border-radius: 12px; padding: 14px 16px; margin-top: 12px;
  font-family: "Consolas", "D2Coding", "Courier New", monospace;
  font-size: 0.9rem; line-height: 1.5; white-space: pre-wrap; min-height: 60px; overflow-x: auto;
}
.run-status { color: var(--muted); font-size: 0.85rem; margin-top: 10px; text-align: center; }
.example-picker {
  flex: 1; min-width: 150px; border: none; border-radius: 12px;
  padding: 12px 16px; font-size: 0.95rem; font-weight: 600; cursor: pointer;
  font-family: inherit; background: var(--card); color: var(--text); box-shadow: var(--shadow);
}
.example-picker:focus { outline: none; }
.speak-btn {
  margin-top: 10px; background: #eef2ff; border: none; color: var(--primary);
  border-radius: 10px; padding: 6px 12px; cursor: pointer; font-weight: 600; font-size: 0.85rem;
}

/* ---------- 단어장 / 노트 ---------- */
.form-grid { display: grid; gap: 10px; margin-bottom: 18px; }
.form-grid input {
  border: 2px solid var(--border); border-radius: 12px;
  padding: 12px 14px; font-size: 1rem; font-family: inherit;
}
.form-grid input:focus { outline: none; border-color: var(--primary); }
.word-item {
  background: var(--card); border-radius: 14px; padding: 14px 16px;
  box-shadow: var(--shadow); border: 1px solid var(--border); margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.word-item .w-en { font-weight: 700; }
.word-item .w-ko { color: var(--muted); font-size: 0.9rem; }
.del-btn {
  background: none; border: none; color: var(--danger); cursor: pointer;
  font-size: 1.3rem; line-height: 1; padding: 4px 8px; border-radius: 8px;
}
.del-btn:hover { background: #fdeaea; }
.empty { text-align: center; color: var(--muted); padding: 30px 0; }

/* ---------- 타자 연습 ---------- */
.typing-box { text-align: center; }
.typing-word { font-size: 2.4rem; font-weight: 800; color: var(--primary); letter-spacing: 1px; }
.typing-mean { color: var(--muted); margin: 6px 0 18px; }
.typing-input {
  width: 100%; border: 2px solid var(--border); border-radius: 12px;
  padding: 14px; font-size: 1.3rem; text-align: center; font-family: inherit;
}
.typing-input:focus { outline: none; border-color: var(--primary); }
.typing-input.ok { border-color: var(--accent); background: #e8fbf4; }
.typing-input.err { border-color: var(--danger); background: #fdeaea; }
.stats { display: flex; gap: 14px; justify-content: center; margin-top: 16px; color: var(--muted); font-size: 0.9rem; }
.stats b { color: var(--text); font-size: 1.1rem; }

.score-badge {
  display: inline-block; background: #eef2ff; color: var(--primary);
  padding: 4px 12px; border-radius: 999px; font-weight: 700; font-size: 0.85rem;
}
footer { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 20px; }

/* ====================================================================
   로그인 / 계정 UI
   ==================================================================== */
.auth-bar {
  position: fixed; top: 12px; right: 14px; z-index: 60;
  display: flex; align-items: center; gap: 8px;
}
.auth-bar .auth-name {
  background: var(--card); box-shadow: var(--shadow); border-radius: 999px;
  padding: 7px 14px; font-size: 0.82rem; font-weight: 700; color: var(--text);
}
.auth-bar button {
  border: none; border-radius: 999px; padding: 8px 14px;
  font-size: 0.82rem; font-weight: 700; cursor: pointer; box-shadow: var(--shadow);
}
.auth-bar .auth-login-btn { background: var(--primary); color: #fff; }
.auth-bar .auth-theme-btn { background: var(--card); color: var(--text); font-size: 0.95rem; padding: 8px 12px; }
.auth-menu { position: relative; }
.auth-menu-btn { background: var(--card); color: var(--text); }
.auth-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--card); border-radius: 12px; box-shadow: 0 10px 30px rgba(20, 30, 60, 0.18);
  overflow: hidden; min-width: 140px;
}
.auth-menu.open .auth-dropdown { display: block; }
.auth-dropdown button {
  display: block; width: 100%; text-align: left; border: none; background: none;
  border-radius: 0; box-shadow: none; padding: 11px 16px;
  font-size: 0.85rem; font-weight: 600; color: var(--text); cursor: pointer;
}
.auth-dropdown button:hover { background: var(--bg); }

.auth-modal-bg {
  position: fixed; inset: 0; background: rgba(20, 28, 50, 0.45);
  z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px;
}
.auth-modal {
  background: var(--card); border-radius: 18px; width: 100%; max-width: 380px;
  padding: 22px 24px; box-shadow: 0 20px 50px rgba(20, 30, 60, 0.25);
}
.auth-modal h2 { font-size: 1.2rem; }
.auth-close { float: right; background: none; border: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--muted); }
.auth-tabs { display: flex; gap: 8px; margin: 16px 0; }
.auth-tabs button {
  flex: 1; border: none; border-radius: 10px; padding: 10px; font-weight: 700;
  cursor: pointer; background: var(--bg); color: var(--muted); font-family: inherit;
}
.auth-tabs button.active { background: var(--primary); color: #fff; }
.auth-form { display: none; flex-direction: column; gap: 10px; }
.auth-form.active { display: flex; }
.auth-form input {
  border: 2px solid var(--border); border-radius: 10px; padding: 11px 13px;
  font-size: 0.95rem; font-family: inherit;
}
.auth-form input:focus { outline: none; border-color: var(--primary); }
.auth-form .auth-submit {
  background: var(--primary); color: #fff; border: none; border-radius: 10px;
  padding: 12px; font-weight: 700; cursor: pointer; margin-top: 2px;
}
.auth-form .auth-submit:disabled { opacity: 0.6; cursor: default; }
.auth-err { color: var(--danger); font-size: 0.85rem; min-height: 18px; }
.auth-ok { color: var(--accent); font-size: 0.85rem; min-height: 18px; font-weight: 600; }
.auth-hint-sm { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }
.auth-forgot-link { display: block; text-align: center; font-size: 0.8rem; color: var(--muted); cursor: pointer; text-decoration: underline; margin-top: 6px; }
.auth-form label { font-size: 0.78rem; color: var(--muted); font-weight: 700; margin-top: 4px; }
.auth-form input:disabled { background: var(--bg); color: var(--muted); }
.acct-divider { border: none; border-top: 1px solid var(--border); margin: 18px 0 14px; }
.acct-subtitle { font-size: 1rem; margin-bottom: 10px; }

/* 허브: 내 학습 현황 */
/* 허브 상단 링크(게시판·관리) — 가볍게 */
.hub-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 26px 0 18px; }
.hub-links .board-link {
  background: transparent; box-shadow: none; border: 1px solid var(--border);
  color: var(--muted); font-weight: 600; font-size: 0.82rem; padding: 7px 14px;
}
.hub-links .board-link:hover { background: var(--card); color: var(--primary); border-color: var(--primary); transform: none; }

.hub-progress {
  max-width: 880px; margin: 0 auto 6px; padding: 16px 20px;
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow); border: 1px solid var(--border);
}
.hub-progress h3 { font-size: 1.05rem; margin-bottom: 10px; }
.hp-top { font-size: 0.92rem; color: var(--muted); margin-bottom: 10px; }
.hp-top b { color: var(--text); }
.hp-review { display: inline-block; margin-top: 10px; font-size: 0.84rem; font-weight: 700; color: var(--primary); text-decoration: none; }
.hp-review:hover { text-decoration: underline; }
.hub-progress .hp-empty { color: var(--muted); font-size: 0.9rem; }
.hub-progress .hp-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.hub-progress .hp-stat { background: var(--bg); border-radius: 12px; padding: 8px 16px; text-align: center; }
.hub-progress .hp-stat b { display: block; font-size: 1.05rem; }
.hub-progress .hp-stat span { font-size: 0.74rem; color: var(--muted); }
.hub-progress .hp-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.hub-progress .hp-badge { background: #fff7e6; color: #b8860b; border-radius: 999px; padding: 4px 10px; font-size: 0.76rem; font-weight: 700; }
html.dark .hub-progress .hp-badge { background: rgba(212, 134, 11, 0.2); color: #f0b94a; }
.hub-progress .hp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.hub-progress .hp-item {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--bg); border-radius: 12px; padding: 10px 14px;
}
.hub-progress .hp-item b { font-size: 0.95rem; }
.hub-progress .hp-item span { font-size: 0.8rem; color: var(--muted); }
.hub-progress .hp-item em { font-size: 0.72rem; color: var(--muted); font-style: normal; opacity: 0.7; }

/* ====================================================================
   AI 영어 회화
   ==================================================================== */
.chat-box {
  background: var(--bg); border-radius: 14px; padding: 14px;
  min-height: 300px; max-height: 48vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
}
.chat-msg {
  max-width: 80%; padding: 9px 13px; border-radius: 14px;
  font-size: 0.95rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}
.chat-msg.me { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.ai { align-self: flex-start; background: var(--card); color: var(--text); box-shadow: var(--shadow); border-bottom-left-radius: 4px; }
.chat-msg.typing { opacity: 0.6; }
.chat-login { text-align: center; margin: auto; }
.chat-input-row { display: flex; gap: 8px; margin-top: 12px; }
.chat-input-row input {
  flex: 1; border: 2px solid var(--border); border-radius: 12px;
  padding: 11px 14px; font-size: 0.95rem; font-family: inherit;
}
.chat-input-row input:focus { outline: none; border-color: var(--primary); }

/* ====================================================================
   AI 최신 소식
   ==================================================================== */
.news-item {
  display: block; background: var(--card); border-radius: 14px; box-shadow: var(--shadow);
  padding: 15px 17px; margin-bottom: 10px; text-decoration: none; color: var(--text);
  transition: transform 0.18s cubic-bezier(.4,0,.2,1), box-shadow 0.18s ease;
  border: 1px solid var(--border); border-left: 4px solid var(--primary);
}
.news-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.news-title { font-weight: 700; font-size: 0.98rem; line-height: 1.45; }
.news-meta { color: var(--muted); font-size: 0.78rem; margin-top: 6px; }

/* ====================================================================
   기능 개선 요청 게시판
   ==================================================================== */
.board-link {
  display: inline-block; background: var(--card); box-shadow: var(--shadow);
  border-radius: 999px; padding: 10px 20px; text-decoration: none;
  color: var(--primary); font-weight: 700; font-size: 0.9rem;
}
.board-link:hover { transform: translateY(-1px); }
.board-write {
  background: var(--card); border-radius: 16px; box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 20px;
}
.board-write input, .board-write textarea {
  width: 100%; border: 2px solid var(--border); border-radius: 10px;
  padding: 11px 13px; font-size: 0.95rem; font-family: inherit; margin-bottom: 10px;
}
.board-write input:focus, .board-write textarea:focus { outline: none; border-color: var(--primary); }
.board-write textarea { min-height: 90px; resize: vertical; }
.post {
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow);
  padding: 16px 18px; margin-bottom: 12px;
}
.post-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.post-title { font-size: 1.05rem; font-weight: 700; flex: 1; word-break: break-word; }
.post-status { font-size: 0.72rem; font-weight: 700; padding: 4px 11px; border-radius: 999px; white-space: nowrap; }
.post-content { color: var(--text); font-size: 0.92rem; white-space: pre-wrap; word-break: break-word; margin-bottom: 12px; }
.post-foot { display: flex; align-items: center; gap: 10px; font-size: 0.8rem; color: var(--muted); flex-wrap: wrap; }
.post-foot .spacer { flex: 1; }
.post-foot .like-btn {
  border: 1px solid var(--border); background: var(--bg); border-radius: 999px;
  padding: 5px 12px; cursor: pointer; font-weight: 700; font-size: 0.8rem; color: var(--muted);
}
.post-foot .like-btn.liked { background: #fdeaea; color: var(--danger); border-color: var(--danger); }
.post-foot .del-btn2 { border: none; background: none; color: var(--danger); cursor: pointer; font-size: 0.8rem; }
.post-foot .status-sel { border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; font-family: inherit; font-size: 0.78rem; }

/* ====================================================================
   배움터 허브(메인 페이지) 전용
   ==================================================================== */
.hub-header {
  text-align: center;
  padding: 58px 20px 32px;
}
.hub-logo { font-size: 3rem; }
.hub-title-row { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 6px; }
.hub-logo-img { height: 60px; width: auto; display: block; }
.hub-header h1 {
  font-size: 2.6rem;
  font-weight: 800;
  margin-top: 8px;
  background: linear-gradient(135deg, #4f6df5, #7c5cff 55%, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -1.5px;
}
.hub-header p { color: var(--muted); margin-top: 12px; font-size: 1.05rem; }

/* 심플 상단 브랜드 바 */
.hub-topbar {
  display: flex; align-items: center;
  padding: 13px 22px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.hub-brand { display: flex; align-items: center; gap: 11px; }
.hub-brand-logo { height: 38px; width: auto; display: block; }
.hub-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.hub-brand-title { font-size: 1.3rem; font-weight: 800; color: #7a1f3d; letter-spacing: -0.5px; }
.hub-brand-sub { font-size: 0.78rem; color: var(--muted); }
html.dark .hub-brand-title { color: #e9b9c8; }

/* 모바일: 상단 바 브랜드와 우상단 계정 버튼이 겹치지 않도록 축소 */
@media (max-width: 480px) {
  .hub-topbar { padding: 11px 14px; }
  .hub-brand { gap: 9px; }
  .hub-brand-logo { height: 30px; }
  .hub-brand-title { font-size: 1.05rem; }
  .hub-brand-sub { font-size: 0.68rem; }
  .auth-bar { top: 10px; right: 10px; gap: 6px; }
  .auth-bar button, .auth-bar .auth-name { font-size: 0.72rem; padding: 7px 11px; }
  .auth-bar .auth-theme-btn { font-size: 0.9rem; padding: 7px 9px; }
}

.subject-grid {
  max-width: 880px;
  margin: 0 auto;
  padding: 10px 16px 60px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.subject-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 20px;
  padding: 26px 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.22s cubic-bezier(.4,0,.2,1), box-shadow 0.22s cubic-bezier(.4,0,.2,1), border-color 0.22s ease;
}
/* 상단 컬러 액센트 바 (color-mix 미지원 브라우저는 단색으로 폴백) */
.subject-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--sc, var(--primary));
  background: linear-gradient(90deg, var(--sc, var(--primary)), color-mix(in srgb, var(--sc, var(--primary)) 55%, #ffffff));
  opacity: .95;
}
/* 호버 시 은은한 광택 */
.subject-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--sc, var(--primary)) 12%, transparent), transparent 55%);
  transition: opacity 0.3s ease;
}
.subject-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: color-mix(in srgb, var(--sc, var(--primary)) 35%, var(--border));
}
.subject-card:hover::after { opacity: 1; }
.subject-card .sc-icon {
  font-size: 1.9rem; width: 54px; height: 54px; display: flex; align-items: center; justify-content: center;
  border-radius: 15px; margin-bottom: 4px;
  background: color-mix(in srgb, var(--sc, var(--primary)) 12%, var(--card));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sc, var(--primary)) 18%, transparent);
}
.subject-card .sc-name { font-size: 1.32rem; font-weight: 800; margin-top: 14px; letter-spacing: -0.5px; }
.subject-card .sc-desc { color: var(--muted); font-size: 0.9rem; margin-top: 8px; flex: 1; line-height: 1.55; }
.subject-card .sc-go {
  margin-top: 18px; font-weight: 800; font-size: 0.9rem;
  color: var(--sc, var(--primary));
  transition: gap 0.2s ease;
}
.subject-card:hover .sc-go { text-decoration: none; }
.subject-card .sc-tags { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.subject-card .sc-tag {
  font-size: 0.72rem; background: rgba(0,0,0,0.05); color: var(--muted);
  padding: 3px 9px; border-radius: 999px; font-weight: 600;
}
html.dark .subject-card .sc-tag { background: rgba(255,255,255,0.08); }
/* 준비중 카드 */
.subject-card.soon {
  cursor: default;
  opacity: 0.7;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1.5px dashed var(--border);
  background: transparent;
  box-shadow: none;
}
.subject-card.soon::before, .subject-card.soon::after { display: none; }
.subject-card.soon:hover { transform: none; box-shadow: none; border-color: var(--border); }
.subject-card.soon .sc-icon { opacity: 0.5; background: transparent; box-shadow: none; }
