/* ===== CSS Variables ===== */
:root {
  --bg: #FCFBF8;
  --text: #3A241A;
  --accent: #F7A9B8;
  --accent-light: #fde8ed;
  --accent-dark: #e8829a;
  --sub: #EDEAE6;
  --sub-dark: #d5d0c8;
  --white: #ffffff;
  --shadow: rgba(58, 36, 26, 0.08);
  --shadow-md: rgba(58, 36, 26, 0.14);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --nav-height: 0px;
  --header-height: 60px;
  --drawer-width: 280px;
  --font-heading: 'Zen Maru Gothic', 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', 'Hiragino Maru Gothic Pro', 'BIZ UDPGothic', 'Yu Gothic', sans-serif;
  --font-body: 'M PLUS Rounded 1c', 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Hiragino Maru Gothic Pro', 'BIZ UDPGothic', sans-serif;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
}

/* ===== Typography ===== */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--text);
  line-height: 1.4;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ===== App Container ===== */
#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ===== Header ===== */
.app-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--header-height);
  background: rgba(252, 251, 248, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--sub);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
}

.header-back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sub);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text);
  flex-shrink: 0;
  transition: all 0.2s;
}

.header-back:active { transform: scale(0.9); background: var(--sub-dark); }

.header-title {
  font-size: 18px;
  font-weight: 400;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-action {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sub);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

/* ===== Page Content ===== */
.page {
  display: none;
  flex: 1;
  padding-top: var(--header-height);
  padding-bottom: 24px;
  min-height: 100dvh;
  animation: fadeIn 0.22s ease;
}

.page.active { display: block; }

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

/* ===== ハンバーガーボタン ===== */
.hamburger-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--sub);
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
  padding: 0;
}
.hamburger-btn:active { background: var(--sub-dark); transform: scale(0.92); }
.hamburger-btn .bar {
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(.23,1,.32,1);
  transform-origin: center;
}
.hamburger-btn.open .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open .bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger-btn.open .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== オーバーレイ ===== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(58, 36, 26, 0.45);
  z-index: 290;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ===== ドロワー ===== */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--drawer-width);
  height: 100dvh;
  background: var(--bg);
  z-index: 300;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(.23,1,.32,1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -8px 0 32px rgba(58,36,26,0.15);
}
.drawer.open {
  transform: translateX(0);
}

/* ドロワーヘッダー */
.drawer-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--sub);
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--bg) 100%);
  flex-shrink: 0;
}
.drawer-header-title {
  font-size: 17px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 2px;
}
.drawer-header-sub {
  font-size: 11px;
  color: #8a6a60;
  line-height: 1.5;
}
.drawer-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sub);
  border: none;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text);
}
.drawer-close-btn:active { background: var(--sub-dark); transform: scale(0.92); }

/* ドロワーナビリスト */
.drawer-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  scrollbar-width: none;
}
.drawer-nav::-webkit-scrollbar { display: none; }

.drawer-nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: background 0.15s;
  position: relative;
  border-radius: 0;
}
.drawer-nav-item:active { background: var(--sub); }
.drawer-nav-item.active {
  background: var(--accent-light);
}
.drawer-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60%;
  background: var(--accent-dark);
  border-radius: 0 4px 4px 0;
}

.drawer-nav-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: var(--sub);
  transition: background 0.15s;
}
.drawer-nav-item.active .drawer-nav-icon {
  background: var(--accent);
}

.drawer-nav-text {
  flex: 1;
}
.drawer-nav-label {
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  display: block;
}
.drawer-nav-desc {
  font-size: 11px;
  color: #8a6a60;
  margin-top: 1px;
  display: block;
}
.drawer-nav-arrow {
  font-size: 14px;
  color: var(--sub-dark);
}
.drawer-nav-item.active .drawer-nav-arrow {
  color: var(--accent-dark);
}

.drawer-divider {
  height: 1px;
  background: var(--sub);
  margin: 6px 20px;
}

/* ドロワーフッター */
.drawer-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--sub);
  flex-shrink: 0;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
}
.drawer-footer-text {
  font-size: 11px;
  color: #c0a898;
  text-align: center;
  line-height: 1.6;
}

/* ===== Bottom Navigation（非表示・後方互換） ===== */
.bottom-nav { display: none; }
.nav-item { display: none; }
.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.nav-item:active { transform: scale(0.92); }

/* ===== Scroll Container ===== */
.scroll-content {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ===== Cards ===== */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 2px 12px var(--shadow);
  transition: all 0.2s;
}

.card:active { transform: scale(0.98); }

.card-sm {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: 0 2px 8px var(--shadow);
}

.card-flat {
  background: var(--sub);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.card-link { cursor: pointer; }
.card-link:active { transform: scale(0.97); box-shadow: 0 1px 6px var(--shadow); }

/* ===== Section Header ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: 15px;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-title .icon {
  font-size: 16px;
}

.section-link {
  font-size: 12px;
  color: var(--accent-dark);
  font-weight: 400;
  background: var(--accent-light);
  padding: 4px 10px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.section-link:active { transform: scale(0.95); }

/* ===== Badge ===== */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-accent { background: var(--accent-light); color: var(--accent-dark); }
.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-warning { background: #fff8e1; color: #f57f17; }
.badge-danger { background: #ffebee; color: #c62828; }
.badge-info { background: #e3f2fd; color: #1565c0; }
.badge-neutral { background: var(--sub); color: #666; }
.badge-purple { background: #f3e5f5; color: #6a1b9a; }

/* ===== Progress Bar ===== */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--sub);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-dark) 100%);
  border-radius: 4px;
  transition: width 0.6s ease;
}

.progress-fill.success { background: linear-gradient(90deg, #81c784 0%, #4caf50 100%); }
.progress-fill.warning { background: linear-gradient(90deg, #ffb74d 0%, #ff9800 100%); }

/* ===== HOME PAGE ===== */
.home-greeting {
  background: linear-gradient(135deg, var(--accent-light) 0%, #fff5f7 50%, var(--bg) 100%);
  border-radius: var(--radius-xl);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.home-greeting::before {
  content: '🌸';
  position: absolute;
  top: -10px;
  right: -5px;
  font-size: 80px;
  opacity: 0.15;
  transform: rotate(15deg);
}

.home-greeting h2 {
  font-size: 22px;
  margin-bottom: 4px;
}

.home-greeting p {
  font-size: 13px;
  color: #7a5a50;
  margin-bottom: 16px;
}

.stats-row {
  display: flex;
  gap: 10px;
}

.stat-item {
  flex: 1;
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  text-align: center;
}

.stat-value {
  font-size: 22px;
  font-weight: 400;
  color: var(--accent-dark);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 10px;
  color: #7a5a50;
  font-weight: 400;
}

/* Today tasks */
.today-task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--sub);
  cursor: pointer;
  transition: all 0.15s;
}

.today-task-item:last-child { border-bottom: none; }
.today-task-item:active { transform: translateX(4px); }

.task-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.task-info { flex: 1; min-width: 0; }
.task-name { font-size: 14px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-sub { font-size: 11px; color: #8a6a60; margin-top: 2px; }
.task-arrow { font-size: 14px; color: var(--sub-dark); }

/* Deadline */
.deadline-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--sub);
  cursor: pointer;
  transition: all 0.15s;
}

.deadline-item:last-child { border-bottom: none; }
.deadline-item:active { transform: translateX(4px); }

.deadline-days {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 400;
}

.deadline-days.urgent { background: #ffebee; color: #c62828; }
.deadline-days.soon { background: #fff8e1; color: #f57f17; }
.deadline-days.normal { background: var(--accent-light); color: var(--accent-dark); }

.deadline-days .days-num { font-size: 18px; line-height: 1; }
.deadline-days .days-label { font-size: 9px; font-weight: 400; }

.deadline-info { flex: 1; min-width: 0; }
.deadline-title { font-size: 13px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deadline-subject { font-size: 11px; color: #8a6a60; margin-top: 2px; }

/* Recent records */
.record-mini-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--sub);
}

.record-mini-item:last-child { border-bottom: none; }

.record-mini-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.record-mini-info { flex: 1; min-width: 0; }
.record-mini-subject { font-size: 13px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-mini-meta { font-size: 11px; color: #8a6a60; margin-top: 2px; }
.record-mini-time { font-size: 13px; font-weight: 400; color: var(--accent-dark); flex-shrink: 0; }

/* ===== SUBJECTS PAGE ===== */
.subject-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 10px;
  box-shadow: 0 2px 12px var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.subject-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 5px;
  height: 100%;
  border-radius: 3px 0 0 3px;
}

.subject-card:active { transform: scale(0.98); box-shadow: 0 1px 6px var(--shadow); }

.subject-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.subject-name {
  font-size: 16px;
  font-weight: 400;
  flex: 1;
  margin-right: 8px;
}

.subject-credits {
  font-size: 11px;
  font-weight: 400;
  color: var(--accent-dark);
  background: var(--accent-light);
  padding: 3px 8px;
  border-radius: 20px;
  flex-shrink: 0;
}

.subject-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.subject-progress-section { margin-bottom: 10px; }

.subject-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.subject-progress-label { font-size: 11px; color: #8a6a60; }
.subject-progress-pct { font-size: 12px; font-weight: 400; color: var(--accent-dark); }

.subject-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.subject-reports-info { font-size: 12px; color: #8a6a60; }
.subject-reports-info span { font-weight: 400; color: var(--text); }

/* Filter tabs */
.filter-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.filter-tabs::-webkit-scrollbar { display: none; }

.filter-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 20px;
  border: none;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--sub);
  color: #8a6a60;
}

.filter-tab.active {
  background: var(--accent);
  color: var(--white);
}

.filter-tab:active { transform: scale(0.95); }

/* ===== SUBJECT DETAIL PAGE ===== */
.subject-detail-hero {
  padding: 24px 20px 20px;
  border-radius: var(--radius-xl);
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}

.subject-detail-hero::after {
  content: '📚';
  position: absolute;
  bottom: -10px;
  right: 10px;
  font-size: 72px;
  opacity: 0.15;
}

.subject-detail-title {
  font-size: 22px;
  font-weight: 400;
  margin-bottom: 8px;
  line-height: 1.3;
}

.subject-detail-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.detail-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.detail-stat {
  background: rgba(255,255,255,0.8);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}

.detail-stat-value {
  font-size: 20px;
  font-weight: 400;
  color: var(--accent-dark);
  line-height: 1;
  margin-bottom: 4px;
}

.detail-stat-label { font-size: 10px; color: #8a6a60; font-weight: 400; }

/* Tabs */
.tabs {
  display: flex;
  background: var(--sub);
  border-radius: var(--radius-lg);
  padding: 4px;
  gap: 2px;
}

.tab-btn {
  flex: 1;
  padding: 10px 8px;
  border-radius: var(--radius-md);
  border: none;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s;
  background: none;
  color: #8a6a60;
}

.tab-btn.active {
  background: var(--white);
  color: var(--text);
  box-shadow: 0 2px 8px var(--shadow);
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ===== REPORTS PAGE ===== */
.report-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 2px 12px var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
}

.report-card:active { transform: scale(0.98); }

.report-card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.report-priority-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.priority-high { background: #ef5350; }
.priority-medium { background: #ffa726; }
.priority-low { background: #66bb6a; }

.report-title-section { flex: 1; min-width: 0; }
.report-title { font-size: 14px; font-weight: 400; line-height: 1.4; margin-bottom: 4px; }
.report-subject { font-size: 12px; color: #8a6a60; }

.report-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.report-deadline {
  font-size: 12px;
  font-weight: 400;
}

.report-deadline.urgent { color: #c62828; }
.report-deadline.soon { color: #f57f17; }
.report-deadline.normal { color: #8a6a60; }

.report-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.report-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--sub);
  border-radius: 3px;
  overflow: hidden;
}

.report-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-dark) 100%);
  border-radius: 3px;
}

.report-progress-pct { font-size: 11px; font-weight: 400; color: var(--accent-dark); width: 30px; text-align: right; }

/* ===== REPORT DETAIL ===== */
.report-detail-hero {
  background: linear-gradient(135deg, var(--accent-light) 0%, #fff 100%);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
}

.report-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.info-item {
  background: var(--sub);
  border-radius: var(--radius-md);
  padding: 12px;
}

.info-item-label {
  font-size: 10px;
  color: #8a6a60;
  font-weight: 400;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-item-value {
  font-size: 14px;
  font-weight: 400;
}

/* Checklist */
.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--sub);
  cursor: pointer;
  transition: all 0.15s;
}

.checklist-item:last-child { border-bottom: none; }
.checklist-item:active { transform: translateX(2px); }

.check-box {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--sub-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  font-size: 13px;
}

.check-box.done {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.checklist-text { font-size: 14px; flex: 1; }
.checklist-text.done { text-decoration: line-through; color: #aaa; }

/* ===== STUDY RECORDS PAGE ===== */
.record-form {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: 0 2px 16px var(--shadow);
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: #8a6a60;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input {
  width: 100%;
  background: var(--sub);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: all 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.form-input:focus {
  border-color: var(--accent);
  background: var(--white);
  box-shadow: 0 0 0 4px var(--accent-light);
}

.form-input::placeholder { color: #c0a898; }

.form-group { margin-bottom: 14px; }

.duration-picker {
  display: flex;
  gap: 8px;
}

.duration-btn {
  flex: 1;
  padding: 10px 8px;
  border-radius: var(--radius-md);
  border: 2px solid var(--sub);
  background: var(--sub);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s;
  color: #8a6a60;
}

.duration-btn.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-dark);
}

.duration-btn:active { transform: scale(0.95); }

.btn-primary {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: none;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: white;
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(247, 169, 184, 0.4);
  letter-spacing: 0.02em;
  font-family: var(--font-heading);
}

.btn-primary:active { transform: scale(0.97); box-shadow: 0 2px 8px rgba(247, 169, 184, 0.4); }

.btn-secondary {
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--accent);
  background: var(--white);
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:active { transform: scale(0.97); background: var(--accent-light); }

/* Calendar */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day-header {
  text-align: center;
  font-size: 11px;
  font-weight: 400;
  color: #8a6a60;
  padding: 4px 0;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  flex-direction: column;
  gap: 2px;
}

.calendar-day:active { transform: scale(0.9); }

.calendar-day.has-record {
  background: var(--accent-light);
  color: var(--accent-dark);
  font-weight: 400;
}

.calendar-day.today {
  background: var(--accent);
  color: white;
  font-weight: 400;
}

.calendar-day.other-month { color: #ccc; }

.record-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-dark);
}

.calendar-day.today .record-dot { background: white; }

/* Record list item */
.record-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--sub);
}

.record-item:last-child { border-bottom: none; }

.record-type-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.record-item-info { flex: 1; min-width: 0; }
.record-item-subject { font-size: 14px; font-weight: 400; margin-bottom: 2px; }
.record-item-meta { font-size: 12px; color: #8a6a60; }
.record-item-memo { font-size: 12px; color: #8a6a60; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.record-item-time {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.record-time-value { font-size: 16px; font-weight: 400; color: var(--accent-dark); }
.record-time-unit { font-size: 10px; color: #8a6a60; }

/* ===== ENROLLMENT PAGE ===== */
.enrollment-hero {
  background: linear-gradient(135deg, var(--accent-light) 0%, #fff 100%);
  border-radius: var(--radius-xl);
  padding: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.enrollment-hero::before {
  content: '🎓';
  position: absolute;
  top: -15px;
  right: -5px;
  font-size: 100px;
  opacity: 0.12;
}

.credit-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.credit-current {
  font-size: 56px;
  font-weight: 400;
  color: var(--accent-dark);
  line-height: 1;
}

.credit-separator { font-size: 24px; color: #c0a898; font-weight: 300; }
.credit-total { font-size: 24px; font-weight: 400; color: #c0a898; }
.credit-label { font-size: 14px; color: #8a6a60; margin-bottom: 20px; }

/* Donut chart */
.donut-container {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 16px;
}

.donut-svg { transform: rotate(-90deg); }

.donut-bg { fill: none; stroke: var(--sub); stroke-width: 16; }
.donut-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 16;
  stroke-linecap: round;
  transition: stroke-dasharray 1s ease;
}

.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.donut-pct { font-size: 28px; font-weight: 400; color: var(--accent-dark); line-height: 1; }
.donut-pct-label { font-size: 11px; color: #8a6a60; font-weight: 400; }

/* Category breakdown */
.category-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--sub);
}

.category-row:last-child { border-bottom: none; }
.category-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.category-name { font-size: 14px; font-weight: 400; flex: 1; }
.category-credits { font-size: 14px; font-weight: 400; color: var(--accent-dark); }

/* Subject enrollment card */
.enrollment-subject-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--sub);
  cursor: pointer;
}

.enrollment-subject-card:last-child { border-bottom: none; }
.enrollment-subject-card:active { transform: translateX(4px); }

.enrollment-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.enrollment-subject-name { font-size: 14px; font-weight: 400; flex: 1; }
.enrollment-subject-credits { font-size: 13px; font-weight: 400; color: var(--accent-dark); flex-shrink: 0; }

/* ===== Accordion ===== */
.accordion-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  border-bottom: 1px solid var(--sub);
  transition: all 0.15s;
}

.accordion-btn:active { color: var(--accent-dark); }

.accordion-icon {
  font-size: 12px;
  color: #c0a898;
  transition: transform 0.2s;
}

.accordion-btn.open .accordion-icon { transform: rotate(180deg); }

.accordion-content {
  display: none;
  padding: 14px 0;
}

.accordion-content.open { display: block; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 400;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s;
  white-space: nowrap;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== Floating button ===== */
.fab {
  position: fixed;
  bottom: calc(var(--nav-height) + 20px);
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: white;
  border: none;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(247, 169, 184, 0.5);
  z-index: 150;
  transition: all 0.2s;
}

.fab:active { transform: scale(0.92); }

/* ===== Empty state ===== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #c0a898;
}

.empty-state-icon { font-size: 56px; margin-bottom: 12px; display: block; }
.empty-state-text { font-size: 15px; font-weight: 400; }
.empty-state-sub { font-size: 13px; margin-top: 6px; }

/* ===== Weekly chart ===== */
.weekly-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 80px;
  padding: 0 4px;
}

.chart-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  width: 100%;
  min-height: 4px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--accent-light) 0%, var(--accent) 100%);
  transition: height 0.5s ease;
}

.chart-bar.today { background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%); }

.chart-label {
  font-size: 10px;
  font-weight: 400;
  color: #8a6a60;
}

/* ===== Loading ===== */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--sub);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Divider ===== */
.divider {
  height: 1px;
  background: var(--sub);
  margin: 8px 0;
}

/* ===== Memo area ===== */
.memo-area {
  background: #fffef5;
  border: 2px dashed var(--accent-light);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  min-height: 80px;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ===== History item ===== */
.history-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--sub);
}

.history-item:last-child { border-bottom: none; }

.history-icon {
  width: 36px;
  height: 36px;
  background: var(--sub);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.history-info { flex: 1; }
.history-title { font-size: 13px; font-weight: 400; margin-bottom: 2px; }
.history-date { font-size: 11px; color: #8a6a60; }
.history-feedback { font-size: 12px; color: #8a6a60; margin-top: 4px; line-height: 1.5; }

/* ===== Scrollbar hide ===== */
.no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 400; }
.font-black { font-weight: 400; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-muted { color: #8a6a60; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.w-full { width: 100%; }

/* ===== Safe area ===== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .page {
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
}

/* ===================================================
   PC / DESKTOP LAYOUT  (769px以上)
   左サイドバー固定 + 右コンテンツエリア 2カラム
   =================================================== */
@media (min-width: 769px) {

  /* ----- ルート変数上書き ----- */
  :root {
    --sidebar-width: 260px;
    --content-max: 820px;
    --header-height: 0px;   /* PC版はヘッダー不要 */
    --font-heading: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo', sans-serif;
    --font-body:    'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo', sans-serif;
  }

  /* ----- body/html をフル幅解放 ----- */
  html {
    background: #f0ede8;
    font-size: 16px; /* ベースはそのまま */
  }

  body {
    max-width: 100%;
    margin: 0;
    background: #f0ede8;
    display: flex;
    min-height: 100vh;
    font-family: var(--font-body);
    letter-spacing: 0.02em;
  }

  /* ----- #app をフレックスコンテナ化 ----- */
  #app {
    display: flex;
    width: 100%;
    min-height: 100vh;
  }

  /* ----- モバイルヘッダー非表示 ----- */
  .app-header { display: none !important; }

  /* ----- ハンバーガーボタン非表示 ----- */
  .hamburger-btn { display: none !important; }

  /* ===== PC サイドバー ===== */
  .pc-sidebar {
    display: flex !important;
    flex-direction: column;
    width: var(--sidebar-width);
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--bg);
    border-right: 1px solid var(--sub);
    z-index: 200;
    overflow-y: auto;
    scrollbar-width: none;
  }
  .pc-sidebar::-webkit-scrollbar { display: none; }

  .pc-sidebar-header {
    padding: 28px 20px 20px;
    border-bottom: 1px solid var(--sub);
    background: linear-gradient(160deg, var(--accent-light) 0%, var(--bg) 100%);
    flex-shrink: 0;
  }

  .pc-sidebar-logo {
    font-size: 28px;
    margin-bottom: 8px;
    display: block;
  }

  .pc-sidebar-title {
    font-family: var(--font-heading);
    font-size: 0.75rem; /* ~16px */
    font-weight: 400;
    color: var(--text);
    margin-bottom: 3px;
    line-height: 1.3;
  }

  .pc-sidebar-sub {
    font-size: 0.5rem; /* ~11px */
    color: #8a6a60;
    line-height: 1.5;
  }

  .pc-sidebar-nav {
    flex: 1;
    padding: 12px 0;
  }

  .pc-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: var(--font-body);
    font-size: 0.65rem; /* ~14px */
    font-weight: 400;
    color: var(--text);
    transition: background 0.15s;
    position: relative;
    border-radius: 0;
  }

  .pc-nav-item:hover { background: var(--sub); }

  .pc-nav-item.active {
    background: var(--accent-light);
    color: var(--text);
  }

  .pc-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--accent-dark);
    border-radius: 0 4px 4px 0;
  }

  .pc-nav-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--sub);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem; /* ~18px */
    flex-shrink: 0;
    transition: background 0.15s;
  }

  .pc-nav-item.active .pc-nav-icon { background: var(--accent); }
  .pc-nav-item:hover .pc-nav-icon  { background: var(--sub-dark); }

  .pc-nav-label { flex: 1; }
  .pc-nav-sub {
    font-size: 0.45rem; /* ~10px */
    color: #b0907a;
    font-weight: 400;
    display: block;
    margin-top: 1px;
  }

  .pc-nav-divider {
    height: 1px;
    background: var(--sub);
    margin: 6px 16px;
  }

  .pc-sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--sub);
    font-size: 0.45rem; /* ~10px */
    color: #c0a898;
    line-height: 1.6;
    text-align: center;
  }

  /* ===== PC メインコンテンツエリア ===== */
  .pc-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f0ede8;
    font-size: 1.4em; /* コンテンツ全体を1.4倍 */
  }

  /* ===== PC トップバー（ページタイトル行） ===== */
  .pc-topbar {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px 0;
    flex-shrink: 0;
  }

  .pc-topbar-title {
    font-family: var(--font-heading);
    font-size: 1rem; /* ~22px */
    font-weight: 400;
    color: var(--text);
  }

  .pc-topbar-sub {
    font-size: 0.6rem; /* ~13px */
    color: #8a6a60;
    margin-top: 2px;
  }

  /* ===== ページ本体 ===== */
  .page {
    padding-top: 0 !important;
    padding-bottom: 32px !important;
  }

  /* .scroll-content をPC向け幅・パディングに */
  .scroll-content {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 24px 32px;
    gap: 20px;
  }

  /* ===== PC カード強化 ===== */
  .card {
    border-radius: var(--radius-xl);
    padding: 24px 28px;
    box-shadow: 0 2px 16px var(--shadow);
  }

  .card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px var(--shadow-md);
  }

  .card:active { transform: translateY(0) scale(1); }

  /* ===== PC ホームグリーティング 2カラムグリッド ===== */
  .home-greeting {
    padding: 32px 36px;
  }

  .home-greeting h2 { font-size: 26px; }

  .stats-row {
    gap: 16px;
  }

  .stat-value { font-size: 28px; }

  /* ===== PC 科目カードを2列グリッド ===== */
  #subjects-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  #subjects-list .subject-card {
    margin: 0;
  }

  /* ===== PC レポートカードを2列 ===== */
  .reports-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  /* ===== PC 履修管理：サマリーグリッド拡張 ===== */
  .enrollment-summary-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* ===== PC 学習記録ページ 2カラムレイアウト ===== */
  #page-records .scroll-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
  }

  /* 「学習を記録する」カードを左列全体に */
  #page-records .record-form {
    grid-column: 1;
    grid-row: 1 / span 3;
    max-width: none;
    margin: 0;
  }

  /* 残りのカード（統計・カレンダー・記録一覧）は右列 */
  #page-records .scroll-content > .card {
    grid-column: 2;
  }

  /* ===== PC ドロワー非表示（PC専用サイドバー使用） ===== */
  .drawer-overlay { display: none !important; }
  .drawer { display: none !important; }

  /* ===== PC 参考サイトページ ===== */
  #bookmarks-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  #bookmarks-list .bookmark-card { margin-bottom: 0; }
  .bookmark-thumb { height: 200px; }
  .local-bookmarks-container {
    display: contents; /* グリッドに自然に溶け込む */
  }

  /* ===== PC お役立ち情報ページ ===== */
  .tips-tab-nav {
    flex-wrap: wrap;
    gap: 8px;
  }
  .tips-tab {
    font-size: 13px;
    padding: 9px 18px;
  }
  .tips-card {
    padding: 22px 24px;
    margin-bottom: 16px;
    border-radius: var(--radius-xl);
  }
  .tips-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px var(--shadow-md);
  }
  .book-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .schooling-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  /* ===== タイポグラフィ調整 ===== */
  .subject-name     { font-size: 15px; }
  .section-title    { font-size: 16px; }
  h2                { font-size: 20px; }
  .filter-tab       { font-size: 14px; padding: 9px 20px; }

  /* ===== PC ホームグリッド ===== */
  .home-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  /* ===== スクロールバー（PC） ===== */
  ::-webkit-scrollbar { width: 6px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--sub-dark); border-radius: 3px; }
}

/* タブレット中間域（769〜1024px）微調整 */
@media (min-width: 769px) and (max-width: 1024px) {
  :root { --sidebar-width: 220px; --content-max: 680px; }
  .scroll-content { padding: 20px 24px; }
  #subjects-list { grid-template-columns: 1fr; }
}

/* ===== 参考サイト（ブックマーク）ページ ===== */

.bookmark-card {
  display: block;
  background: var(--white);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  box-shadow: 0 1px 8px var(--shadow);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
  cursor: pointer;
}
.bookmark-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px var(--shadow-md);
}
.bookmark-card:active { transform: scale(0.99); }

.bookmark-thumb {
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: var(--sub);
}
.bookmark-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bookmark-body {
  padding: 14px 16px;
}

.bookmark-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.bookmark-category-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--accent-light);
  color: var(--accent-dark);
  white-space: nowrap;
}

.bookmark-domain {
  font-size: 11px;
  color: #a08070;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookmark-title {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bookmark-desc {
  font-size: 12px;
  color: #7a5a50;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}

.bookmark-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bookmark-site-name {
  font-size: 11px;
  color: #b0907a;
}

.bookmark-date {
  font-size: 10px;
  color: #c0a898;
}

/* ===== お役立ち情報ページ ===== */

/* タブナビ */
.tips-tab-nav {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 0 12px;
  scrollbar-width: none;
  margin-bottom: 4px;
}
.tips-tab-nav::-webkit-scrollbar { display: none; }

.tips-tab {
  flex-shrink: 0;
  padding: 12px 22px;
  border-radius: 28px;
  border: none;
  background: var(--sub);
  color: var(--text);
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
}
.tips-tab.active {
  background: var(--accent);
  color: #3A241A;
}
.tips-tab:hover { background: var(--accent-light); }

.tips-tab-pane { display: none; }
.tips-tab-pane.active { display: block; }

/* カード */
.tips-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 16px var(--shadow);
}

.tips-card-header {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 22px;
}

.tips-icon {
  font-size: 34px;
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  background: var(--accent-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tips-card-title {
  font-size: 20px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 7px;
}
.tips-card-sub {
  font-size: 15px;
  color: #8a6a60;
  line-height: 1.5;
}

/* リスト */
.tips-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}
.tips-list li {
  font-size: 16px;
  line-height: 1.9;
  color: #4a3028;
  padding-left: 24px;
  position: relative;
}
.tips-list li::before {
  content: '•';
  position: absolute;
  left: 6px;
  color: var(--accent-dark);
  font-size: 18px;
}
.tips-list.numbered {
  counter-reset: tips-counter;
}
.tips-list.numbered li {
  counter-increment: tips-counter;
  padding-left: 32px;
}
.tips-list.numbered li::before {
  content: counter(tips-counter) '.';
  font-size: 15px;
  color: var(--accent-dark);
  left: 0;
}
.tips-list.warning li::before {
  content: '⚠';
  color: #f57f17;
  font-size: 15px;
}

/* フロー */
.tips-flow {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 20px;
}
.tips-flow-step {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: var(--accent-light);
  border-radius: var(--radius-md);
  padding: 20px 22px;
}
.tips-flow-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #3A241A;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tips-flow-text {
  font-size: 16px;
  line-height: 1.9;
  color: #4a3028;
}
.tips-flow-arrow {
  text-align: center;
  color: var(--accent-dark);
  font-size: 22px;
  padding: 8px 0;
}

/* セクションラベル */
.tips-section-label {
  font-size: 16px;
  color: #8a6a60;
  margin: 22px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--sub);
}

/* アラート */
.tips-alert {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 16px;
  line-height: 1.8;
}
.tips-alert.info {
  background: #e3f2fd;
  border-left: 4px solid #1565c0;
  color: #1565c0;
}
.tips-alert.warning {
  background: #fff8e1;
  border-left: 4px solid #f57f17;
  color: #7a5a10;
}

/* 先輩の声 */
.tips-voice {
  display: flex;
  gap: 14px;
  background: var(--sub);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin-top: 20px;
}
.voice-icon { font-size: 24px; flex-shrink: 0; }
.voice-text {
  font-size: 16px;
  line-height: 1.9;
  color: #5a3a30;
  font-style: italic;
}

.tips-voice-block {
  background: var(--sub);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin-bottom: 16px;
}
.voice-header {
  font-size: 16px;
  color: var(--accent-dark);
  margin-bottom: 8px;
}
.voice-content {
  font-size: 16px;
  line-height: 1.9;
  color: #5a3a30;
  font-style: italic;
}

/* 難易度バッジ */
.difficulty-badge {
  display: inline-block;
  padding: 5px 16px;
  border-radius: 20px;
  font-size: 14px;
  margin-right: 10px;
  margin-bottom: 14px;
}
.difficulty-badge.high { background: #fde8ed; color: #c0392b; }
.difficulty-badge.mid  { background: #fff3e0; color: #e65100; }
.difficulty-badge.low  { background: #e8f5e9; color: #2e7d32; }

/* 数式ブロック */
.tips-formula {
  background: #f8f4f0;
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.formula-item {
  font-size: 15px;
  color: #3a241a;
  font-family: 'Courier New', monospace;
  padding: 8px 16px;
  background: white;
  border-radius: 8px;
  border-left: 3px solid var(--accent-dark);
  line-height: 1.7;
}

/* 参考書リスト */
.book-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.book-item {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 18px 20px;
  background: var(--sub);
  border-radius: var(--radius-md);
}
.book-icon { font-size: 30px; flex-shrink: 0; }
.book-info { flex: 1; min-width: 0; }
.book-title {
  font-size: 17px;
  color: #3a241a;
  margin-bottom: 6px;
  line-height: 1.5;
}
.book-author {
  font-size: 15px;
  color: #8a6a60;
  margin-bottom: 6px;
}
.book-desc {
  font-size: 15px;
  color: #7a5a50;
  line-height: 1.7;
}

/* チェックリスト */
.checklist-item-tips {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid var(--sub);
  font-size: 16px;
  line-height: 1.8;
  color: #4a3028;
}
.check-box-tips {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #e8f5e9;
  color: #2e7d32;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* スクーリンググリッド */
.schooling-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 18px 0;
}
.schooling-item {
  background: var(--accent-light);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}
.schooling-type {
  font-size: 17px;
  color: #3a241a;
  margin-bottom: 10px;
}
.schooling-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.schooling-detail span {
  font-size: 14px;
  color: #7a5a50;
  background: white;
  padding: 5px 12px;
  border-radius: 12px;
}

/* PC版のお役立ち情報ページをさらに読みやすく */
@media (min-width: 769px) {
  .tips-card {
    padding: 36px 32px;
    margin-bottom: 24px;
  }
  .tips-card-header {
    gap: 22px;
    margin-bottom: 28px;
  }
  .tips-icon {
    width: 68px;
    height: 68px;
    font-size: 38px;
  }
  .tips-card-title { font-size: 22px; }
  .tips-card-sub { font-size: 16px; }
  .tips-list li { font-size: 17px; line-height: 2.0; }
  .tips-flow-step { padding: 24px 28px; gap: 22px; }
  .tips-flow-text { font-size: 17px; line-height: 2.0; }
  .tips-flow-num { width: 44px; height: 44px; font-size: 17px; }
  .tips-section-label { font-size: 17px; margin: 26px 0 16px; }
  .tips-alert { font-size: 17px; padding: 20px 24px; }
  .tips-voice { padding: 24px 28px; }
  .voice-text { font-size: 17px; }
  .tips-voice-block { padding: 22px 26px; margin-bottom: 18px; }
  .voice-header { font-size: 17px; }
  .voice-content { font-size: 17px; }
  .book-title { font-size: 18px; }
  .book-author { font-size: 16px; }
  .book-desc { font-size: 16px; }
  .checklist-item-tips { font-size: 17px; padding: 18px 0; }
  .schooling-type { font-size: 18px; }
  .schooling-detail span { font-size: 15px; }
  .formula-item { font-size: 16px; }
}

/* ===== 参考動画ページ ===== */

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.video-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 2px 12px var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
}
.video-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--shadow);
}

.video-thumb-wrap {
  position: relative;
  display: block;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #eee;
}
.video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.video-play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.2);
  color: white;
  font-size: 32px;
  opacity: 0;
  transition: opacity 0.2s;
}
.video-thumb-wrap:hover .video-play-icon { opacity: 1; }

.video-card-body {
  padding: 12px 14px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.video-card-title {
  font-size: 14px;
  color: #3a241a;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-card-note {
  font-size: 12px;
  color: #7a5a50;
  line-height: 1.5;
}
.video-card-tag {
  display: inline-block;
  font-size: 11px;
  background: var(--accent-light);
  color: var(--accent-dark);
  padding: 3px 10px;
  border-radius: 20px;
  align-self: flex-start;
}
.video-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 13px;
  color: #c0392b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.video-card:hover .video-delete-btn { opacity: 1; }

.video-filter-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 20px;
  border: none;
  background: var(--sub);
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.2s;
}
.video-filter-btn.active {
  background: var(--accent);
  color: #3A241A;
}

/* PC版: 3列グリッド */
@media (min-width: 769px) {
  .video-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
  .video-card-title { font-size: 15px; }
  .video-card-note { font-size: 13px; }
  .video-card-tag { font-size: 12px; }
  .video-delete-btn { opacity: 0.3; }
  .video-delete-btn:hover { opacity: 1; }
}

/* スマホ: 1列 */
@media (max-width: 480px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
}
