/* ==================== */
/* 全域設定 */
/* ==================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, "Noto Sans TC", sans-serif;
  background: #f7f7f7;
  color: #111;
  min-height: 100vh;
  padding: 16px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  max-width: 1440px;
  min-height: calc(100vh - 32px);
  margin: 0 auto;
  background: #fff;
  border: 1px solid #aaa;
  border-radius: 6px;
  padding: 64px 56px;
}

.hidden {
  display: none;
}

/* ==================== */
/* 首頁 */
/* ==================== */

.home-header {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 28px;
}

.home-header h1 {
  font-size: 48px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-align: center;
}

.menu-btn,
.setting-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: #111;
  font-size: 30px;
  line-height: 1;
}

.menu-btn {
  display: none;
}

.setting-btn {
  position: absolute;
  right: 0;
  top: 2px;
}

.main-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 190px;
  margin: 0 auto;
  padding: 12px 28px;
  border: 1px solid #111;
  border-radius: 8px;
  background: #fff;
  color: #111;
  font-size: 22px;
  line-height: 1;
}

.main-btn:hover {
  background: #f6f6f6;
}

/* ==================== */
/* 首頁卡片列表 */
/* ==================== */

.notebook-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px;
  margin-top: 68px;
}

/* ==================== */
/* Notebook Card */
/* ==================== */

.notebook-card {
  position: relative;
  min-height: 420px;
  background: #fff;
  border: 1px solid #aaa;
  border-radius: 12px;
  padding: 54px 30px 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.notebook-card:hover {
  border-color: #111;
}

.notebook-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 82px;
  height: 1px;
  background: #aaa;
}

.notebook-icon {
  width: auto;
  height: auto;
  border: none;
  border-radius: 0;
  margin-bottom: 32px;
  font-size: 64px;
  line-height: 1;
  filter: grayscale(1);
}

.notebook-card h2 {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 26px;
}

.notebook-card p {
  font-size: 24px;
  color: #111;
  margin-bottom: 42px;
}

.progress-bar {
  width: 100%;
  max-width: 250px;
  height: 12px;
  background: #e5e5e5;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #111;
  border-radius: 999px;
}

.enter-btn {
  position: absolute;
  right: 24px;
  bottom: 20px;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: #111;
  font-size: 48px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 新增本虛線卡片 */
.notebook-card-add {
  border: 1px dashed #999;
  justify-content: center;
  padding: 40px 30px;
}

.notebook-card-add::after {
  display: none;
}

.notebook-card-add .notebook-icon {
  display: none;
}

.notebook-add-icon {
  font-size: 72px;
  line-height: 1;
  margin-bottom: 32px;
}

.notebook-card-add h2 {
  font-size: 30px;
  font-weight: 400;
  margin-bottom: 0;
}

/* ==================== */
/* 任務頁 Header */
/* ==================== */

.task-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.back-btn,
.more-btn {
  border: none;
  background: transparent;
  color: #111;
  font-size: 22px;
  padding: 8px 0;
}

.more-btn {
  font-size: 34px;
  line-height: 1;
}

/* ==================== */
/* 任務頁主體 */
/* ==================== */

.task-main {
  max-width: 980px;
  margin: 0 auto;
  background: #fff;
  border: none;
  border-radius: 0;
  padding: 0 0 24px;
  box-shadow: none;
}

.task-title {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-bottom: 40px;
}

.task-title .notebook-icon {
  margin-bottom: 0;
  font-size: 56px;
}

.task-title h1 {
  font-size: 36px;
  font-weight: 700;
}

/* ==================== */
/* 日期區 */
/* ==================== */

.date-control {
  display: grid;
  grid-template-columns: 56px minmax(220px, 360px) 56px;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.date-control button {
  height: 52px;
  border: 1px solid #aaa;
  border-radius: 8px;
  background: #fff;
  color: #111;
  font-size: 28px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.date-display {
  min-width: 0;
  padding: 0 24px;
  font-size: 20px;
  font-weight: 500;
}

.date-hint {
  width: fit-content;
  margin: 0 auto 26px;
  padding: 10px 28px;
  border: 1px solid #aaa;
  border-radius: 8px;
  color: #111;
  background: #fff;
  font-size: 18px;
  text-align: center;
}

/* ==================== */
/* 新增任務區 */
/* ==================== */

.add-task-area {
  max-width: 620px;
  margin: 0 auto 34px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.task-input {
  width: 100%;
  border: 1px solid #aaa;
  border-radius: 8px;
  padding: 13px 16px;
  background: #fff;
  color: #111;
  font-size: 18px;
}

.task-input:focus {
  outline: none;
  border-color: #111;
}

.add-task-btn {
  margin: 0;
  min-width: 160px;
  font-size: 18px;
  padding: 13px 18px;
}

/* ==================== */
/* 任務列表 */
/* ==================== */

.task-list {
  list-style: none;
  margin: 0;
  border-top: 1px solid #aaa;
}

.task-item {
  display: grid;
  grid-template-columns: 34px 1fr 36px;
  align-items: center;
  gap: 22px;
  min-height: 74px;
  padding: 16px 8px;
  border-bottom: 1px solid #ddd;
  cursor: pointer;
}

.task-item span {
  min-width: 0;
  font-size: 20px;
  line-height: 1.5;
  word-break: break-word;
}

.task-item.completed span {
  text-decoration: line-through;
  opacity: 0.55;
}

.check-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #777;
  border-radius: 3px;
  background: #fff;
  accent-color: #555;
  cursor: pointer;
}

.delete-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: #111;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.delete-btn:hover {
  background: #f4f4f4;
}

.task-empty {
  padding: 36px 0;
  border-bottom: 1px solid #ddd;
  text-align: center;
  color: #777;
  font-size: 18px;
}

/* ==================== */
/* 平板 */
/* ==================== */

@media (max-width: 1200px) {
  .app {
    padding: 52px 40px;
  }

  .notebook-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
  }

  .notebook-card {
    min-height: 360px;
  }
}

/* ==================== */
/* 手機 */
/* ==================== */

@media (max-width: 768px) {
  body {
    padding: 0;
    background: #fff;
  }

  .app {
    min-height: 100vh;
    border: none;
    border-radius: 0;
    padding: 18px 20px 28px;
  }

  .home-header {
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    margin-bottom: 24px;
  }

  .menu-btn {
    display: flex;
    position: static;
    width: 40px;
    height: 40px;
    font-size: 24px;
    align-items: center;
    justify-content: center;
  }

  .setting-btn {
    position: static;
    width: 40px;
    height: 40px;
    font-size: 24px;
  }

  .home-header h1 {
    font-size: 24px;
    font-weight: 600;
  }

  .main-btn {
    min-width: 170px;
    padding: 11px 22px;
    font-size: 18px;
    border-radius: 8px;
  }

  .notebook-list {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 28px;
  }

  .notebook-card {
    min-height: auto;
    border-radius: 8px;
    padding: 22px 54px 22px 18px;
    display: grid;
    grid-template-columns: 58px 1fr;
    column-gap: 18px;
    align-items: center;
    text-align: left;
  }

  .notebook-card::after {
    display: none;
  }

  .notebook-icon {
    grid-row: 1 / 4;
    margin: 0;
    font-size: 44px;
  }

  .notebook-card h2 {
    font-size: 22px;
    margin-bottom: 6px;
  }

  .notebook-card p {
    font-size: 16px;
    margin-bottom: 8px;
  }

  .progress-bar {
    max-width: none;
    width: 100%;
    height: 8px;
  }

  .enter-btn {
    right: 14px;
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    font-size: 34px;
  }

  .notebook-card-add {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 72px;
    padding: 18px;
    text-align: center;
  }

  .notebook-add-icon {
    font-size: 28px;
    margin: 0 8px 0 0;
  }

  .notebook-card-add h2 {
    font-size: 18px;
  }

  .task-header {
    margin-bottom: 24px;
  }

  .back-btn {
    font-size: 17px;
  }

  .more-btn {
    font-size: 28px;
  }

  .task-main {
    max-width: none;
    padding: 0;
  }

  .task-title {
    gap: 12px;
    margin-bottom: 28px;
  }

  .task-title .notebook-icon {
    font-size: 42px;
  }

  .task-title h1 {
    font-size: 26px;
  }

  .date-control {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 10px;
    margin-bottom: 14px;
  }

  .date-control button {
    height: 42px;
    border-radius: 6px;
    font-size: 22px;
  }

  .date-display {
    font-size: 16px;
    padding: 0 10px;
  }

  .date-hint {
    font-size: 15px;
    padding: 9px 20px;
    margin-bottom: 24px;
  }

  .add-task-area {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 28px;
  }

  .task-input {
    font-size: 16px;
    padding: 12px 14px;
  }

  .add-task-btn {
    width: 100%;
    min-width: 0;
  }

  .task-item {
    grid-template-columns: 28px 1fr 32px;
    gap: 14px;
    min-height: 62px;
    padding: 14px 4px;
  }

  .task-item span {
    font-size: 16px;
  }

  .check-btn {
    width: 24px;
    height: 24px;
  }

  .delete-btn {
    width: 32px;
    height: 32px;
    font-size: 20px;
  }
}

/* ==================== */
/* 小手機 */
/* ==================== */

@media (max-width: 480px) {
  .app {
    padding: 16px 14px 24px;
  }

  .home-header h1 {
    font-size: 21px;
  }

  .notebook-card {
    padding: 18px 46px 18px 14px;
    grid-template-columns: 50px 1fr;
    column-gap: 14px;
  }

  .notebook-icon {
    font-size: 38px;
  }

  .notebook-card h2 {
    font-size: 20px;
  }

  .notebook-card p {
    font-size: 14px;
  }

  .task-title h1 {
    font-size: 24px;
  }

  .date-display {
    font-size: 14px;
  }

  .date-hint {
    width: 100%;
  }
}