:root {
  --clock-bg: #f5f1e8;
  --clock-card: rgba(255, 253, 248, 0.92);
  --clock-ink: #302c29;
  --clock-muted: #776f68;
  --clock-line: rgba(92, 79, 64, 0.16);
  --clock-gold: #a56f2d;
  --clock-gold-soft: #efe1c6;
  --clock-plum: #66517e;
  --clock-shadow: 0 20px 60px rgba(75, 61, 43, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--clock-bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--clock-ink);
  background:
    radial-gradient(circle at 14% 10%, rgba(245, 220, 172, 0.55), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(215, 204, 232, 0.55), transparent 26%),
    linear-gradient(180deg, #fbf8f0 0%, var(--clock-bg) 48%, #eee8dc 100%);
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.clock-header {
  width: min(1180px, calc(100% - 40px));
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
  border-bottom: 1px solid var(--clock-line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #37312e;
  font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
  font-size: 20px;
  font-weight: 700;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--clock-line);
  border-radius: 50%;
  color: var(--clock-plum);
  background: rgba(255, 255, 255, 0.72);
  font-size: 21px;
}

.clock-home-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--clock-line);
  border-radius: 999px;
  color: #60584f;
  background: rgba(255, 255, 255, 0.54);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.clock-home-link:hover,
.clock-home-link:focus-visible {
  color: var(--clock-plum);
  background: #fff;
  outline: none;
}

.clock-main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 58px 0 80px;
}

.clock-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, 0.55fr);
  align-items: end;
  gap: 36px;
}

.clock-eyebrow,
.section-heading p,
.new-task-heading p {
  margin: 0 0 10px;
  color: var(--clock-gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.clock-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
}

.clock-hero h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
  font-size: clamp(52px, 8vw, 96px);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 0.95;
}

.clock-lead {
  max-width: 680px;
  margin: 26px 0 0;
  font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
  font-size: clamp(20px, 3vw, 30px);
  line-height: 1.55;
}

.clock-description {
  max-width: 720px;
  margin: 16px 0 0;
  color: var(--clock-muted);
  font-size: 14px;
  line-height: 1.9;
}

.next-wake-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid rgba(112, 89, 132, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgba(220, 207, 239, 0.8), transparent 48%),
    rgba(255, 253, 249, 0.9);
  box-shadow: var(--clock-shadow);
}

.next-wake-card::after {
  position: absolute;
  right: -18px;
  bottom: -44px;
  color: rgba(102, 81, 126, 0.06);
  font-family: Georgia, serif;
  font-size: 150px;
  content: "◷";
}

.next-wake-icon {
  width: 52px;
  height: 52px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 18px;
  color: white;
  background: var(--clock-plum);
  font-size: 25px;
}

.next-wake-card div {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.next-wake-card span,
.next-wake-card small {
  color: var(--clock-muted);
  font-size: 11px;
}

.next-wake-card strong {
  font-family: Georgia, "Songti SC", serif;
  font-size: 20px;
  font-weight: 600;
}

.clock-boundary {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 42px 0 28px;
  padding: 16px 20px;
  border: 1px solid rgba(93, 119, 90, 0.16);
  border-radius: 18px;
  background: rgba(244, 250, 241, 0.72);
}

.clock-boundary span {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  color: #54704f;
  font-size: 12px;
  font-weight: 800;
}

.clock-boundary p {
  margin: 0;
  color: #6e7869;
  font-size: 12px;
  line-height: 1.7;
}

.clock-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.65fr);
  gap: 24px;
}

.task-section,
.new-task-panel,
.run-section {
  border: 1px solid var(--clock-line);
  background: var(--clock-card);
  box-shadow: 0 14px 42px rgba(73, 61, 47, 0.06);
}

.task-section {
  padding: 28px;
  border-radius: 28px;
}

.new-task-panel {
  align-self: start;
  padding: 26px;
  border-radius: 28px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.section-heading h2,
.new-task-heading h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
  font-size: 25px;
  font-weight: 600;
}

.section-heading > span {
  color: var(--clock-muted);
  font-size: 11px;
}

.task-count {
  min-width: 44px;
  padding: 8px 11px;
  border-radius: 999px;
  color: var(--clock-plum) !important;
  background: rgba(102, 81, 126, 0.09);
  font-weight: 800;
  text-align: center;
}

.task-feedback {
  min-height: 0;
  margin-bottom: 0;
  padding: 0;
  border-radius: 13px;
  color: #6a6259;
  font-size: 12px;
  line-height: 1.6;
}

.task-feedback:not(:empty) {
  min-height: auto;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: var(--clock-gold-soft);
}

.task-feedback.is-error {
  color: #92504e;
  background: #f7e5e2;
}

.task-list {
  display: grid;
  gap: 12px;
}

.task-card {
  padding: 20px;
  border: 1px solid var(--clock-line);
  border-radius: 21px;
  background: rgba(255, 255, 255, 0.7);
}

.task-card.is-paused {
  opacity: 0.72;
  background: rgba(247, 244, 239, 0.8);
}

.task-card.is-completed {
  opacity: 0.64;
}

.task-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.task-card-title {
  min-width: 0;
  display: flex;
  gap: 12px;
}

.task-status-mark {
  width: 34px;
  height: 34px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: var(--clock-gold);
  background: var(--clock-gold-soft);
}

.task-card.is-paused .task-status-mark,
.task-card.is-completed .task-status-mark {
  color: #7b7370;
  background: #ece8e2;
}

.task-card h3 {
  margin: 1px 0 5px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 18px;
  font-weight: 600;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  color: var(--clock-muted);
  font-size: 10px;
}

.task-state {
  padding: 5px 8px;
  border-radius: 999px;
  color: #6e572f;
  background: #f4e8cf;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.task-card.is-paused .task-state {
  color: #716a67;
  background: #ebe7e1;
}

.task-card.is-completed .task-state {
  color: #587156;
  background: #e5efe2;
}

.task-instruction {
  margin: 16px 0 0;
  color: #5e5650;
  font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
  font-size: 14px;
  line-height: 1.8;
}

.task-last-result {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px dashed var(--clock-line);
  color: #827970;
  font-size: 11px;
  line-height: 1.65;
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.task-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border: 1px solid var(--clock-line);
  border-radius: 999px;
  color: #5f574f;
  background: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.task-actions button:hover,
.task-actions button:focus-visible {
  color: var(--clock-plum);
  border-color: rgba(102, 81, 126, 0.3);
  outline: none;
}

.task-actions button:disabled {
  cursor: wait;
  opacity: 0.5;
}

.task-actions button[data-action="finish"] {
  margin-left: auto;
  color: #8a6663;
  border-color: rgba(138, 102, 99, 0.18);
}

.clock-loading,
.clock-empty {
  padding: 34px 18px;
  border: 1px dashed var(--clock-line);
  border-radius: 18px;
  color: var(--clock-muted);
  font-size: 13px;
  line-height: 1.8;
  text-align: center;
}

.clock-loading i {
  margin-right: 6px;
}

.new-task-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 22px;
}

.new-task-heading > span {
  width: 42px;
  height: 42px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 15px;
  color: var(--clock-gold);
  background: var(--clock-gold-soft);
  font-size: 20px;
}

.new-task-heading p {
  margin-bottom: 4px;
}

#new-task-form {
  display: grid;
  gap: 15px;
}

#new-task-form label {
  display: grid;
  gap: 7px;
  color: #6e665f;
  font-size: 11px;
  font-weight: 700;
}

#new-task-form label small {
  color: #948a80;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.5;
}

#new-task-form input,
#new-task-form select,
#new-task-form textarea {
  width: 100%;
  border: 1px solid var(--clock-line);
  border-radius: 13px;
  color: var(--clock-ink);
  background: rgba(255, 255, 255, 0.8);
  outline: none;
}

#new-task-form input,
#new-task-form select {
  min-height: 43px;
  padding: 0 12px;
}

#new-task-form textarea {
  min-height: 112px;
  padding: 12px;
  line-height: 1.65;
  resize: vertical;
}

#new-task-form input:focus,
#new-task-form select:focus,
#new-task-form textarea:focus {
  border-color: rgba(165, 111, 45, 0.55);
  box-shadow: 0 0 0 4px rgba(165, 111, 45, 0.08);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.create-task-button {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 3px;
  padding: 0 16px;
  border: 0;
  border-radius: 15px;
  color: white;
  background: linear-gradient(135deg, #a87535, #8e5f28);
  box-shadow: 0 10px 24px rgba(142, 95, 40, 0.2);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.create-task-button:hover,
.create-task-button:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.create-task-button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.patrol-section,
.run-section {
  margin-top: 24px;
  padding: 28px;
  border-radius: 28px;
}

.patrol-summary {
  margin: 18px 0 8px;
  padding: 14px 16px;
  border: 1px solid rgba(98, 131, 112, 0.2);
  border-radius: 16px;
  color: #415c4a;
  background: rgba(231, 241, 232, 0.72);
  font-size: 12px;
  font-weight: 750;
}

.patrol-summary.is-running {
  color: #775d34;
  background: rgba(244, 235, 214, 0.76);
}

.patrol-summary.is-failed {
  color: #8f514d;
  background: rgba(248, 228, 225, 0.8);
}

.patrol-summary.is-empty {
  color: var(--clock-muted);
  background: rgba(255, 255, 255, 0.58);
}

.patrol-list {
  display: grid;
}

.patrol-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 13px;
  padding: 13px 0;
  border-top: 1px solid var(--clock-line);
}

.patrol-item:first-child {
  border-top: 0;
}

.patrol-mark {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #4f725d;
  background: #e3efe6;
}

.patrol-item.is-running .patrol-mark {
  color: #806538;
  background: #f1e8d7;
}

.patrol-item.is-failed .patrol-mark {
  color: #985b56;
  background: #f5e1df;
}

.patrol-copy strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.patrol-copy span {
  color: var(--clock-muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.patrol-item time {
  color: #8e857d;
  font-size: 10px;
  white-space: nowrap;
}

.run-list {
  display: grid;
  gap: 0;
}

.run-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 13px;
  padding: 15px 0;
  border-top: 1px solid var(--clock-line);
}

.run-item:first-child {
  border-top: 0;
}

.run-mark {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #587156;
  background: #e5efe2;
}

.run-item.is-skipped .run-mark {
  color: #78654d;
  background: #efe7d9;
}

.run-item.is-failed .run-mark {
  color: #9a5752;
  background: #f5e1df;
}

.run-copy strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.run-copy span {
  color: var(--clock-muted);
  font-size: 11px;
  line-height: 1.6;
}

.run-item time {
  color: #8e857d;
  font-size: 10px;
  white-space: nowrap;
}

@media (max-width: 880px) {
  .clock-hero,
  .clock-layout {
    grid-template-columns: 1fr;
  }

  .next-wake-card {
    max-width: 520px;
  }

}

@media (max-width: 620px) {
  .clock-header,
  .clock-main {
    width: min(100% - 24px, 1180px);
  }

  .clock-header {
    min-height: 70px;
  }

  .clock-home-link span {
    display: none;
  }

  .clock-main {
    padding: 40px 0 56px;
  }

  .clock-hero h1 {
    font-size: 56px;
  }

  .clock-boundary {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .task-section,
  .new-task-panel,
  .patrol-section,
  .run-section {
    padding: 20px;
    border-radius: 22px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: flex-start;
  }

  .section-heading > span:not(.task-count) {
    display: none;
  }

  .patrol-item,
  .run-item {
    grid-template-columns: 31px minmax(0, 1fr);
  }

  .patrol-item time,
  .run-item time {
    grid-column: 2;
  }
}

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