* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    "Noto Sans TC",
    "Noto Sans JP",
    "Noto Sans KR",
    "Microsoft JhengHei",
    "Meiryo",
    "Malgun Gothic",
    Arial,
    sans-serif;
  background: #f7f8f8;
  color: #243238;
}

.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 230px;
  min-width: 230px;
  flex: 0 0 230px;
  background:#F2F8F9;
  border-right:1px solid #DCE8EA;
  padding: 26px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.logo {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 32px;
  color: #2f5f64;
}

.nav a {
  display: block;
  text-decoration: none;
  color: #36566f;
  padding: 14px 16px;
  border-radius: 999px;
  margin-bottom: 10px;
  font-weight: 700;
}

.nav a.active,
.nav a:hover {
  background: #DDEFF4;
}

.quote {
  position: absolute;
  bottom: 26px;
  left: 18px;
  right: 18px;
  background: #ffffff;
  border: 1px solid #d8e6e8;
  border-radius: 18px;
  padding: 18px;
  color: #6f858a;
  line-height: 1.8;
  font-size: 13px;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 30px 36px 46px;
}

.header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 28px;
}

h1 {
  margin: 0;
  font-size: 31px;
  color: #243238;
}

.subtitle {
  margin-top: 8px;
  color: #6f7f83;
  font-size: 14px;
}

.search {
  width: 330px;
  background: #ffffff;
  border: 1px solid #d8e6e8;
  border-radius: 999px;
  padding: 13px 20px;
  color: #6f7f83;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}

.card {
  background: #ffffff;
  border: 1px solid #dce8ea;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 8px 20px rgba(60, 90, 100, 0.04);
}

.stat-card {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 16px;
  align-items: center;
  min-height: 142px;
}

.icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.icon svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.green {
  background:#EDF8F1;
  color:#69A77B;
}

.purple {
  background:#F4EFFA;
  color:#8C73B0;
}

.blue {
  background:#EDF7FB;
  color:#5E8CA0;
}

.orange {
  background:#FCF5EC;
  color:#C69257;
}

.stat-label {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 32px;
  font-weight: 900;
}

.stat-note {
  color: #6f7f83;
  font-size: 13px;
  margin-top: 8px;
}

.layout {
  display: grid;
  grid-template-columns: 1.15fr .9fr;
  gap: 18px;
}

.stack {
  display: grid;
  gap: 18px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 20px;
  font-weight: 900;
}

.section-link {
  color: #2f5f64;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.book-row,
.recent-book {
  display: block;
  padding: 14px 0;
  border-top: 1px solid #e6eff0;
}

.book-row:first-of-type,
.recent-book:first-of-type {
  border-top: 0;
}

.review-layout {
  display: block;
}

.recent-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.book-title {
  font-size: 17px;
  font-weight: 900;
  margin-bottom: 6px;
  line-height: 1.55;
  word-break: normal;
  overflow-wrap: anywhere;
}

.meta {
  color: #6f7f83;
  font-size: 13px;
  line-height: 1.7;
  word-break: normal;
  overflow-wrap: anywhere;
}

.tag {
  display: inline-block;
  background: #e8f3f5;
  border-radius: 999px;
  padding: 6px 12px;
  color: #36566f;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  margin-top: 8px;
}

.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.day {
  background: #eef5f6;
  border-radius: 14px;
  text-align: center;
  padding: 11px 4px;
}

.day.active {
  background: #cfe3f4;
}

.day strong {
  display: block;
  font-size: 15px;
}

.day span {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: #6f7f83;
}

.log-item,
.review-item {
  border-top: 1px solid #e6eff0;
  padding: 13px 0;
}

.log-item:first-of-type,
.review-item:first-of-type {
  border-top: 0;
}

.mobile-nav {
  display: none;
}

.loading {
  padding: 40px;
  text-align: center;
  color: #6f7f83;
}

@media (max-width: 900px) {
  .app {
    display: block;
    padding-bottom: 70px;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 22px 16px;
  }

  .header {
    display: block;
  }

  .search {
    width: 100%;
    margin-top: 16px;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .days {
    grid-template-columns: repeat(4, 1fr);
  }

  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    border-top: 1px solid #d8e6e8;
    padding: 8px 4px;
    z-index: 10;
  }

  .mobile-nav a {
    text-align: center;
    text-decoration: none;
    color: #36566f;
    font-size: 12px;
    font-weight: 800;
    padding: 8px 2px;
  }
}

@media (max-width: 520px) {
  .stats {
    grid-template-columns: 1fr;
  }

  .section-title {
    align-items: flex-start;
    gap: 10px;
  }
}

.summary-line {
  display: grid;
  grid-template-columns: 5.5em 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
}

.summary-label {
  font-weight: 900;
  color: #243238;
  white-space: nowrap;
}

.summary-value {
  color: #6f7f83;
  font-size: 13px;
  min-width: 0;
}

.ellipsis {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}