:root {
  color-scheme: light;
  --forest-950: #052e16;
  --forest-900: #14532d;
  --forest-800: #166534;
  --forest-700: #15803d;
  --emerald-600: #059669;
  --mint-100: #d1fae5;
  --mint-50: #ecfdf5;
  --paper: #ffffff;
  --ink: #16251d;
  --muted: #65756b;
  --line: #dce8df;
  --shadow: 0 24px 70px rgba(6, 78, 45, 0.13);
  font-family: Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { background: #f3faf5; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: linear-gradient(145deg, #f7fcf8 0%, #eff9f2 45%, #f7faf6 100%); }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
.hidden { display: none !important; }
.ambient { position: fixed; border-radius: 999px; filter: blur(8px); pointer-events: none; opacity: .65; }
.ambient-one { width: 340px; height: 340px; left: -130px; top: -120px; background: radial-gradient(circle, #a7f3d0, transparent 68%); }
.ambient-two { width: 420px; height: 420px; right: -190px; bottom: -200px; background: radial-gradient(circle, #bbf7d0, transparent 70%); }

.login-shell { min-height: 100svh; padding: 24px; display: grid; place-items: center; position: relative; }
.login-card { width: min(100%, 470px); padding: 44px; border: 1px solid rgba(255,255,255,.85); border-radius: 32px; background: rgba(255,255,255,.92); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.brand-mark { display: grid; place-items: center; width: 66px; height: 66px; border-radius: 22px; color: white; background: linear-gradient(145deg, var(--forest-800), var(--emerald-600)); box-shadow: 0 12px 28px rgba(5,150,105,.24); font-size: 28px; font-weight: 900; }
.brand-mark.compact { width: 46px; height: 46px; border-radius: 15px; font-size: 20px; flex: 0 0 auto; }
.eyebrow { margin: 26px 0 12px; color: var(--emerald-600); font-size: 12px; font-weight: 900; letter-spacing: .16em; }
.eyebrow.light { margin: 0 0 9px; color: #9ce8bc; }
.login-card h1 { margin: 0; font-size: clamp(38px, 10vw, 57px); line-height: 1.1; letter-spacing: -.045em; }
.login-card h1 span { color: var(--forest-700); }
.login-copy { margin: 23px 0 28px; color: var(--muted); font-size: 16px; line-height: 1.75; }
.line-login { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 56px; border-radius: 16px; color: white; background: #06c755; box-shadow: 0 14px 30px rgba(6,199,85,.2); font-weight: 900; text-decoration: none; transition: transform .2s, box-shadow .2s; }
.line-login:hover { transform: translateY(-2px); box-shadow: 0 18px 36px rgba(6,199,85,.27); }
.line-badge { display: grid; place-items: center; width: 35px; height: 27px; border: 2px solid white; border-radius: 13px; font-size: 8px; }
.privacy-note { margin: 17px 0 0; color: #88958d; text-align: center; font-size: 12px; }
.alert { margin: 0 0 18px; padding: 13px 15px; border: 1px solid #fecaca; border-radius: 13px; color: #991b1b; background: #fff1f2; font-size: 14px; }

.app-shell { width: min(1180px, 100%); margin: 0 auto; padding: 22px 24px 34px; position: relative; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 8px 2px 22px; }
.topbar-brand { display: flex; align-items: center; gap: 13px; }
.topbar-brand strong { display: block; font-size: 18px; }
.topbar-brand span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.account { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.account span { color: var(--muted); }
.account strong { display: block; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account a { margin-left: 5px; color: var(--forest-700); font-weight: 800; text-decoration: none; }
.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid white; box-shadow: 0 4px 12px rgba(0,0,0,.12); }

.hero { display: flex; align-items: flex-end; justify-content: space-between; min-height: 222px; padding: 43px 48px; border-radius: 30px 30px 0 0; color: white; background: radial-gradient(circle at 82% 8%, rgba(52,211,153,.42), transparent 30%), linear-gradient(135deg, #0b3b22, #166534 63%, #047857); overflow: hidden; position: relative; }
.hero::after { content: ""; position: absolute; width: 220px; height: 220px; right: 12%; bottom: -150px; border: 34px solid rgba(255,255,255,.06); border-radius: 50%; }
.hero h1 { margin: 0 0 10px; font-size: clamp(31px, 5vw, 52px); letter-spacing: -.04em; position: relative; z-index: 1; }
.hero p { margin: 0; color: #c8ead5; position: relative; z-index: 1; }
.today-chip { min-width: 108px; padding: 13px 16px; border: 1px solid rgba(255,255,255,.22); border-radius: 17px; background: rgba(255,255,255,.12); backdrop-filter: blur(10px); text-align: center; position: relative; z-index: 1; }
.today-chip span { display: block; color: #b8e3c8; font-size: 11px; }
.today-chip strong { display: block; margin-top: 4px; font-size: 17px; }

.schedule-panel { min-height: 560px; padding: 28px 38px 36px; border: 1px solid rgba(255,255,255,.8); border-top: 0; border-radius: 0 0 30px 30px; background: rgba(255,255,255,.92); box-shadow: var(--shadow); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.view-tabs { display: flex; padding: 4px; border-radius: 13px; background: #eef5f0; }
.tab { padding: 10px 17px; border: 0; border-radius: 10px; color: #607168; background: transparent; font-weight: 800; cursor: pointer; }
.tab.active { color: white; background: var(--forest-800); box-shadow: 0 6px 16px rgba(20,83,45,.2); }
.period-nav { display: flex; align-items: center; gap: 7px; }
.period-nav button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px; color: var(--forest-800); background: white; font-size: 22px; cursor: pointer; }
.period-nav .current-button { width: auto; padding: 0 14px; font-size: 13px; font-weight: 800; }
.period-heading { display: flex; align-items: flex-end; justify-content: space-between; margin: 32px 0 20px; }
.period-heading p { margin: 0 0 4px; color: var(--emerald-600); font-size: 12px; font-weight: 900; }
.period-heading h2 { margin: 0; font-size: clamp(24px, 4vw, 34px); letter-spacing: -.03em; }
.task-count { padding: 8px 12px; border-radius: 999px; color: var(--forest-800); background: var(--mint-50); font-size: 12px; font-weight: 800; }

.state-card { min-height: 300px; display: grid; place-items: center; align-content: center; gap: 12px; border: 1px dashed #cfe1d4; border-radius: 22px; color: var(--muted); background: #fbfefc; text-align: center; }
.state-card h3, .state-card p { margin: 0; }
.state-card.error { color: #991b1b; background: #fffafa; border-color: #fecaca; }
.state-card button { padding: 10px 16px; border: 0; border-radius: 10px; color: white; background: var(--forest-800); font-weight: 800; }
.spinner { width: 34px; height: 34px; border: 4px solid #d9efe1; border-top-color: var(--emerald-600); border-radius: 50%; animation: spin .9s linear infinite; }
.empty-icon { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; color: var(--forest-700); background: var(--mint-100); font-size: 27px; font-weight: 900; }
@keyframes spin { to { transform: rotate(360deg); } }

.week-list { display: grid; gap: 21px; }
.day-group { display: grid; grid-template-columns: 98px 1fr; gap: 20px; }
.day-label { padding-top: 12px; color: var(--muted); font-size: 13px; }
.day-label strong { display: block; margin-top: 3px; color: var(--ink); font-size: 26px; }
.day-label.today strong { color: var(--emerald-600); }
.day-tasks { display: grid; gap: 11px; }
.task-card { border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 8px 24px rgba(23,77,47,.06); overflow: hidden; }
.task-summary { width: 100%; display: grid; grid-template-columns: 92px 1fr auto; align-items: center; gap: 16px; padding: 17px 18px; border: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.task-time { color: var(--forest-800); font-size: 13px; font-weight: 900; }
.task-main strong { display: block; font-size: 16px; }
.task-main span { display: block; margin-top: 5px; color: var(--muted); font-size: 13px; }
.task-tags { max-width: 330px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.info-pill { max-width: 100%; padding: 7px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; overflow-wrap: anywhere; }
.member-pill { color: var(--forest-800); background: var(--mint-50); }
.car-pill { color: white; background: var(--emerald-600); }
.task-detail { padding: 0 18px 18px 126px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; padding: 15px; border-radius: 14px; background: #f7fbf8; }
.detail-item { min-width: 0; }
.detail-item.full { grid-column: 1 / -1; }
.detail-item span { display: block; margin-bottom: 4px; color: #7b8b81; font-size: 11px; }
.detail-item strong { display: block; overflow-wrap: anywhere; font-size: 13px; }
.notion-link { display: inline-flex; margin-top: 13px; color: var(--forest-700); font-size: 13px; font-weight: 900; text-decoration: none; }

.month-view { overflow-x: auto; }
.calendar-grid { min-width: 680px; display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.calendar-head { padding: 12px 8px; color: var(--muted); background: #f5faf7; text-align: center; font-size: 12px; font-weight: 900; }
.calendar-day { min-height: 118px; padding: 10px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); background: white; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.outside { background: #fafcfb; color: #aab5ae; }
.calendar-day.today .day-number { color: white; background: var(--emerald-600); }
.day-number { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; font-size: 12px; font-weight: 900; }
.calendar-event { display: block; margin-top: 6px; padding: 5px 6px; border-radius: 7px; color: var(--forest-900); background: var(--mint-50); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }

footer { padding: 24px 0 2px; color: #849288; text-align: center; font-size: 11px; }

@media (max-width: 700px) {
  .app-shell { padding: 0 0 28px; }
  .topbar { padding: 14px 16px; background: rgba(255,255,255,.9); }
  .topbar-brand span, .account span, .account a { display: none; }
  .account strong { max-width: 88px; }
  .hero { min-height: 206px; padding: 34px 22px; border-radius: 0; }
  .hero h1 { font-size: 29px; letter-spacing: -.045em; }
  .hero > div:first-child > p:last-child { max-width: 230px; font-size: 13px; line-height: 1.6; }
  .today-chip { min-width: 82px; padding: 10px; }
  .schedule-panel { padding: 22px 16px 28px; border-radius: 0 0 24px 24px; border-left: 0; border-right: 0; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .view-tabs { width: 100%; }
  .tab { flex: 1; }
  .period-nav { justify-content: space-between; }
  .period-nav .current-button { flex: 1; }
  .period-heading { margin-top: 26px; }
  .task-count { display: none; }
  .day-group { grid-template-columns: 1fr; gap: 8px; }
  .day-label { display: flex; align-items: baseline; gap: 8px; padding: 0 2px; }
  .day-label strong { font-size: 19px; }
  .task-summary { grid-template-columns: 70px 1fr; gap: 11px; padding: 16px 14px; }
  .task-tags { width: 100%; max-width: 100%; grid-column: 2; justify-content: flex-start; justify-self: start; }
  .task-detail { padding: 0 14px 14px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-item.full { grid-column: auto; }
  .login-card { padding: 34px 25px; border-radius: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
