:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-strong: #eef4f3;
  --text: #172326;
  --muted: #657579;
  --line: #dbe4e3;
  --primary: #14746f;
  --primary-dark: #0d5753;
  --accent: #bd5a35;
  --accent-soft: #fff1e8;
  --ok: #22784b;
  --ok-soft: #e9f7ef;
  --warn: #9b5221;
  --warn-soft: #fff5dc;
  --shadow: 0 18px 42px rgba(23, 35, 38, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  background:
    linear-gradient(180deg, #e8f0ef 0, #f5f7f8 310px),
    var(--bg);
  color: var(--text);
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 22px 0 26px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: 0;
}

.subtitle {
  max-width: 780px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.top-actions {
  display: grid;
  grid-template-columns: minmax(86px, 0.9fr) minmax(112px, 1.1fr) minmax(76px, 0.7fr);
  gap: 8px;
  align-items: end;
}

.primary-btn,
.ghost-btn {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 800;
}

.primary-btn {
  color: #fff;
  background: var(--primary);
}

.primary-btn:hover {
  background: var(--primary-dark);
}

.block-btn {
  width: 100%;
  min-height: 48px;
}

.top-btn,
.notify-btn,
.top-interval {
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 900;
}

.top-interval {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.notify-btn.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.layout {
  display: block;
}

.workspace {
  min-width: 0;
}

.panel,
.hero-panel,
.metric,
.ready-banner {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(219, 228, 227, 0.94);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.panel-head span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
  font-size: 13px;
  font-weight: 900;
}

.panel-head h2,
.section-title h2 {
  margin: 0;
  font-size: 20px;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

input,
select {
  height: 48px;
  padding: 0 12px;
  font-size: 17px;
  font-weight: 800;
}

textarea {
  min-height: 340px;
  padding: 16px;
  resize: vertical;
  line-height: 1.75;
}

.form-grid,
.mobile-record-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.start-time-field {
  margin-top: 12px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 22px;
  align-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #ffffff 0%, #edf8f5 100%);
}

.report-trigger {
  margin-top: 12px;
}

.report-trigger .ghost-btn {
  min-height: 52px;
}

.record-input-panel {
  margin-top: 12px;
}

.record-input-panel .panel-head {
  margin-bottom: 12px;
}

.record-input-panel .mobile-record-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(112px, 0.75fr);
}

.record-input-panel input {
  height: 60px;
  font-size: 24px;
  font-weight: 900;
}

.record-input-panel label {
  font-size: 16px;
}

.autosave-note {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.hero-panel h2 {
  margin-bottom: 10px;
  font-size: clamp(30px, 3.3vw, 42px);
  line-height: 1.18;
}

.hero-panel p,
.metric p,
.ready-banner p {
  color: var(--muted);
  line-height: 1.7;
}

.status-copy .subtitle-line {
  font-size: 19px;
}

.status-copy > p:not(.eyebrow) {
  font-size: 19px;
  font-weight: 600;
}

.status-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.status-tags .tag {
  min-height: 36px;
  padding: 0 13px;
  font-size: 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: #35494a;
  font-size: 13px;
  font-weight: 800;
}

.tag.ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.tag.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.tag.hot {
  background: var(--accent-soft);
  color: var(--accent);
}

.progress-dial {
  position: relative;
  width: 210px;
  height: 210px;
  justify-self: center;
}

.progress-dial svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.dial-bg,
.dial-progress {
  fill: none;
  stroke-width: 14;
}

.dial-bg {
  stroke: #dfe8e7;
}

.dial-progress {
  stroke: var(--primary);
  stroke-linecap: round;
  stroke-dasharray: 452.39;
  stroke-dashoffset: 452.39;
  transition: stroke-dashoffset 250ms ease;
}

.dial-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.dial-text strong {
  display: block;
  font-size: 34px;
}

.dial-text span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.metric {
  min-height: 138px;
  padding: 18px;
  box-shadow: none;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin: 9px 0;
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.15;
}

.metric p {
  margin-bottom: 0;
  font-size: 14px;
}

.wide {
  min-width: 0;
  box-shadow: none;
}

.record-panel {
  margin-top: 14px;
}

.report-trigger {
  margin-bottom: 0;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 500px;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #f7fafb;
  color: var(--muted);
  font-size: 13px;
}

td {
  font-size: 14px;
  line-height: 1.45;
}

.daily-off-input {
  width: 88px;
  height: 42px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.ready-banner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
  padding: 18px;
  background: var(--ok-soft);
  border-color: #bfe7ce;
}

.ready-banner h2 {
  margin-bottom: 6px;
}

.ready-banner p {
  margin-bottom: 0;
}

.hidden {
  display: none !important;
}

.empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 31, 34, 0.36);
}

.modal-panel {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(23, 35, 38, 0.18);
}

.icon-btn {
  width: auto;
  min-height: 38px;
  padding: 0 12px;
}

@media (max-width: 1120px) {
  .hero-panel {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  body {
    background: var(--bg);
  }

  .app-shell {
    padding: 10px;
  }

  .topbar,
  .ready-banner,
  .section-title {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar {
    gap: 12px;
    padding: 10px 0 12px;
  }

  h1 {
    font-size: 28px;
  }

  .subtitle {
    font-size: 14px;
    line-height: 1.55;
  }

  .top-actions {
    width: 100%;
    grid-template-columns: minmax(82px, 0.9fr) minmax(112px, 1.15fr) minmax(72px, 0.7fr);
  }

  .top-actions button {
    min-width: 0;
  }

  .panel {
    padding: 14px;
  }

  .form-grid,
  .mobile-record-grid,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .record-input-panel .mobile-record-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(108px, 0.75fr);
  }

  label {
    font-size: 15px;
    margin-bottom: 10px;
  }

  input,
  select {
    height: 50px;
    font-size: 18px;
  }

  .hero-panel {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 16px;
  }

  .hero-panel h2 {
    font-size: 30px;
  }

  .status-copy > p:not(.eyebrow) {
    font-size: 18px;
    line-height: 1.65;
  }

  .status-tags {
    margin-top: 12px;
  }

  .progress-dial {
    width: 146px;
    height: 146px;
  }

  .dial-text strong {
    font-size: 28px;
  }

  .metric-grid {
    gap: 10px;
    margin-top: 10px;
  }

  .report-trigger {
    margin-top: 10px;
  }

  .modal {
    align-items: end;
    padding: 10px;
  }

  .modal-panel {
    width: 100%;
  }

  .metric {
    min-height: 112px;
    padding: 14px;
  }

  .metric strong {
    font-size: 24px;
  }

  .record-panel {
    margin-top: 10px;
  }

  .section-title {
    gap: 8px;
    margin-bottom: 10px;
  }

  .table-wrap {
    overflow-x: visible;
  }

  table {
    min-width: 0;
  }

  th,
  td {
    padding: 10px 8px;
    font-size: 12px;
  }

  .daily-off-input {
    width: 72px;
    height: 38px;
    padding: 0 6px;
    font-size: 17px;
  }

  .tag {
    min-height: 26px;
    padding: 0 8px;
    font-size: 12px;
  }

  .status-tags .tag {
    min-height: 34px;
    padding: 0 12px;
    font-size: 15px;
  }

  textarea {
    min-height: 260px;
    font-size: 13px;
  }
}

@media (max-width: 340px) {
  .form-grid,
  .mobile-record-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }
}
