:root {
  --paper: #e7e7e7;
  --ink: #050505;
  --white: #ffffff;
  --bili: #ff6699;
  --blue: #b2f0ff;
  --yellow: #f1f700;
  --green: #7aff8a;
  --violet: #c2a3ff;
  --pink: #ff90e8;
  --gray: #b0b0b0;
  font-family: "Arial Black", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 24px;
  background: var(--paper);
  color: var(--ink);
}

button {
  font: inherit;
}

.topbar,
.tracker {
  width: min(960px, 100%);
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 24px;
}

.nav-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.tool-button,
.notify-button,
.time-pill,
.status-badge,
.history-date,
.tracker {
  border: 4px solid var(--ink);
}

.tool-button,
.notify-button {
  align-items: center;
  min-height: 42px;
  padding: 8px 14px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.tool-button {
  display: inline-flex;
  justify-content: center;
  gap: 7px;
}

.tool-icon {
  line-height: 1;
}

.tool-button:hover,
.notify-button:hover,
.avatar-link:hover {
  transform: translate(2px, 2px);
  box-shadow: 4px 4px 0 var(--ink);
}

.tool-button:active,
.notify-button:active,
.avatar-link:active {
  transform: translate(6px, 6px);
  box-shadow: 0 0 0 var(--ink);
}

.yellow {
  background: var(--yellow);
}

.green {
  background: var(--green);
}

.violet {
  background: var(--violet);
}

.pink {
  background: var(--pink);
}

.tracker {
  padding: 42px;
  background: var(--white);
  box-shadow: 8px 8px 0 var(--ink);
}

.hero {
  display: flex;
  align-items: center;
  gap: 34px;
  padding-bottom: 34px;
  border-bottom: 4px solid var(--ink);
}

.avatar-link {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 136px;
  height: 136px;
  color: inherit;
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.avatar-link img {
  display: block;
  width: 100%;
  height: 100%;
  border: 4px solid var(--ink);
  object-fit: cover;
}

.status-badge {
  position: absolute;
  right: -18px;
  bottom: -18px;
  min-width: 82px;
  padding: 7px 10px;
  background: #e0e0e0;
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.status-badge.live {
  background: #ff0000;
  color: var(--white);
  animation: live-pop 1s ease-in-out infinite alternate;
}

@keyframes live-pop {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.06);
  }
}

.hero-copy {
  display: flex;
  min-height: 136px;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(42px, 5vw, 64px);
  line-height: 0.95;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.notify-button {
  width: max-content;
  margin-top: 16px;
  background: #ff4d4d;
  color: var(--white);
}

.notify-button.enabled {
  background: var(--green);
  color: var(--ink);
}

.today-card {
  margin-top: 42px;
  padding: 24px;
  background: var(--blue);
  border: 4px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.card-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

h2 {
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1;
}

.time-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 4px 12px;
  background: var(--white);
  font-size: 14px;
  white-space: nowrap;
}

.timeline-scroll {
  width: 100%;
  overflow-x: visible;
}

.timeline-inner {
  min-width: 100%;
}

.timeline-track {
  position: relative;
  height: 32px;
  overflow: hidden;
  border: 3px solid var(--ink);
  background: var(--white);
}

.timeline-layer {
  position: absolute;
  top: 0;
  bottom: 0;
}

.bg-past-stripes {
  left: 0;
  background-color: var(--gray);
  background-image: repeating-linear-gradient(-45deg, var(--ink), var(--ink) 3px, transparent 3px, transparent 8px);
  border-right: 3px solid var(--ink);
}

.bg-bili-wave {
  background: linear-gradient(90deg, var(--bili) 0%, #ff99bb 50%, var(--bili) 100%);
  background-size: 200% 100%;
  animation: wave-slide 1s linear infinite;
  border-right: 4px solid var(--ink);
}

.bg-bili-static {
  background: var(--bili);
  border-right: 3px solid var(--ink);
  border-left: 3px solid var(--ink);
}

@keyframes wave-slide {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

.time-scale {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding: 0 2px;
  font-size: 12px;
  font-weight: 900;
}

.history-card {
  margin-top: 44px;
}

.history-card h2 {
  display: inline-block;
  margin-bottom: 22px;
  padding-bottom: 8px;
  border-bottom: 4px solid var(--ink);
}

.history-dates {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
}

.history-date {
  padding: 14px 12px;
  background: var(--white);
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 20px;
  font-weight: 900;
  text-align: center;
}

.empty {
  color: #333;
  font-size: 18px;
  font-weight: 900;
}

@media (max-width: 720px) {
  body {
    padding: 16px;
  }

  .topbar,
  .tracker {
    width: calc(100vw - 44px);
    max-width: calc(100vw - 44px);
  }

  .topbar {
    justify-content: center;
    margin-bottom: 18px;
  }

  .nav-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 10px;
  }

  .tool-button {
    width: 100%;
    min-width: 0;
    padding-right: 8px;
    padding-left: 8px;
    box-shadow: 3px 3px 0 var(--ink);
  }

  .tracker {
    padding: 18px;
    box-shadow: 4px 4px 0 var(--ink);
    overflow: hidden;
  }

  .hero {
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 28px;
  }

  .hero-copy {
    width: 100%;
  }

  .avatar-link {
    width: 128px;
    height: 128px;
  }

  .status-badge {
    right: -10px;
    bottom: -16px;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(34px, 10vw, 42px);
    line-height: 1;
    word-break: break-all;
  }

  .notify-button {
    margin-right: auto;
    margin-left: auto;
  }

  .today-card {
    margin-top: 34px;
    padding: 16px;
  }

  .card-head {
    display: grid;
    gap: 12px;
  }

  .time-pill {
    width: max-content;
    max-width: 100%;
    min-height: 30px;
    font-size: 12px;
  }

  .timeline-track {
    width: 100%;
  }

  .timeline-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .timeline-scroll::-webkit-scrollbar {
    display: none;
  }

  .timeline-inner {
    min-width: 520px;
  }

  .time-scale {
    gap: 0;
    font-size: 10px;
  }

  .history-dates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .history-date {
    padding: 12px 8px;
    font-size: 18px;
  }
}

@media (max-width: 520px) {
  .topbar,
  .tracker {
    width: min(calc(100vw - 44px), 346px);
    max-width: min(calc(100vw - 44px), 346px);
    margin-right: auto;
    margin-left: 0;
  }

  h1 {
    font-size: clamp(30px, 8vw, 38px);
  }
}
