:root {
  color-scheme: light;
  --bg: #f5f7f6;
  --surface: #ffffff;
  --ink: #1f2522;
  --muted: #65716d;
  --line: #dfe6e2;
  --accent: #247a6b;
  --accent-strong: #155f54;
  --accent-soft: #e5f3ef;
  --warning: #b44934;
  --shadow: 0 18px 50px rgba(38, 52, 47, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.summary-band {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  background: #eef5f2;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.2;
}

.subtitle {
  margin-bottom: 0;
  color: var(--muted);
}

.month-tools {
  display: grid;
  gap: 8px;
  min-width: 210px;
}

.month-tools label,
.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input {
  min-height: 42px;
  padding: 8px 10px;
}

textarea {
  resize: vertical;
  padding: 10px;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(36, 122, 107, 0.14);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 18px 0;
}

.metric {
  display: grid;
  gap: 5px;
  min-height: 118px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric span,
.metric small {
  color: var(--muted);
}

.metric strong {
  color: var(--accent-strong);
  font-size: 36px;
  line-height: 1;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 18px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.entry-panel {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.time-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.inline-result {
  margin: 0;
  padding: 12px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 6px;
  font-weight: 700;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button,
.ghost-button {
  background: #eef2f0;
  color: var(--ink);
}

.secondary-button:hover,
.ghost-button:hover {
  background: #e0e8e4;
}

.danger-button {
  background: var(--warning);
  color: #fff;
}

.danger-button:hover {
  background: #933622;
}

.compact {
  min-height: 34px;
  padding: 0 12px;
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--accent-strong);
  font-size: 14px;
}

.form-message.error {
  color: var(--warning);
}

.list-panel {
  overflow: hidden;
}

.list-panel .panel-head {
  padding: 20px 22px 14px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  background: #f8faf9;
}

td {
  font-size: 14px;
}

.hours-cell {
  font-weight: 800;
  color: var(--accent-strong);
}

.row-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  min-width: 42px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  background: #eef2f0;
  color: var(--ink);
  font-weight: 700;
}

.icon-button.delete {
  color: var(--warning);
}

.empty-state {
  display: none;
  margin: 0;
  padding: 28px 22px 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.empty-state.show {
  display: block;
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(31, 37, 34, 0.44);
}

.confirm-overlay[hidden] {
  display: none;
}

.confirm-box {
  width: min(360px, 100%);
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.confirm-box h2 {
  margin-bottom: 10px;
}

.confirm-box p {
  margin-bottom: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.confirm-password {
  margin-bottom: 8px;
}

.confirm-error {
  min-height: 20px;
  margin-bottom: 14px;
  color: var(--warning);
  font-size: 14px;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 880px) {
  .summary-band,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .month-tools {
    min-width: 0;
  }

  .metrics,
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .summary-band,
  .entry-panel {
    padding: 18px;
  }

  .time-grid {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 100px;
  }
}
