:root {
  --ink: #172026;
  --muted: #66727d;
  --paper: #fff8ea;
  --card: rgba(255, 255, 255, 0.86);
  --line: rgba(23, 32, 38, 0.12);
  --brand: #0a716b;
  --brand-strong: #074b48;
  --hot: #ff6b35;
  --sun: #ffc857;
  --mint: #b8f2d8;
  --blue: #2d7dd2;
  --danger: #c2412d;
  --shadow: 0 22px 70px rgba(23, 32, 38, 0.14);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Aptos Display", "Microsoft YaHei UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  background:
    radial-gradient(circle at 8% 6%, rgba(255, 200, 87, 0.56), transparent 28rem),
    radial-gradient(circle at 92% 0%, rgba(184, 242, 216, 0.9), transparent 30rem),
    linear-gradient(135deg, #fff8e8 0%, #f0fbf3 48%, #eef7ff 100%);
}

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

button {
  cursor: pointer;
}

.shell {
  width: min(1480px, calc(100% - 28px));
  margin: 0 auto;
  padding: 16px 0 38px;
}

.app-header {
  display: grid;
  grid-template-columns: auto minmax(380px, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.42)),
    repeating-linear-gradient(90deg, rgba(23, 32, 38, 0.035) 0 1px, transparent 1px 36px);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 17px;
  color: #fff;
  font-size: 26px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--brand), var(--blue));
  box-shadow: 0 14px 30px rgba(10, 113, 107, 0.24);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 20px;
  letter-spacing: -0.03em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
}

.date-tools,
.header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.date-tools {
  justify-content: center;
}

.header-actions {
  justify-content: flex-end;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  outline: none;
}

input,
select {
  height: 42px;
  padding: 0 13px;
}

textarea {
  min-height: 120px;
  padding: 14px;
  line-height: 1.7;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(10, 113, 107, 0.65);
  box-shadow: 0 0 0 4px rgba(184, 242, 216, 0.56);
}

#reportDate {
  width: 180px;
  font-weight: 800;
}

.ghost-button,
.soft-button,
.primary-button,
.export-button,
.icon-button,
.mode-button,
.range-button {
  border: 0;
  border-radius: 999px;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.ghost-button,
.soft-button,
.range-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(23, 32, 38, 0.1);
  font-weight: 800;
}

.ghost-button.danger {
  color: var(--danger);
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.icon-button {
  width: 42px;
  height: 42px;
  color: #fff;
  font-size: 18px;
  background: var(--ink);
}

.deploy-badge,
.save-state {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(10, 113, 107, 0.18);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--brand-strong);
  background: rgba(184, 242, 216, 0.5);
  font-size: 13px;
  font-weight: 800;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, 0.78fr);
  gap: 20px;
  margin-top: 20px;
}

.panel {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: 0 18px 58px rgba(23, 32, 38, 0.09);
  backdrop-filter: blur(22px);
}

.editor-panel,
.preview-panel,
.export-panel,
.table-panel {
  padding: 22px;
}

.panel-title,
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--hot);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: -0.04em;
}

h1 {
  font-size: 34px;
}

h2 {
  font-size: 26px;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(23, 32, 38, 0.07);
}

.mode-button {
  height: 44px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.mode-button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  box-shadow: 0 12px 28px rgba(10, 113, 107, 0.24);
}

.field-config {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(10, 113, 107, 0.14);
  border-radius: 22px;
  background: rgba(184, 242, 216, 0.34);
}

.field-config-main {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}

.field-config p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

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

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

label input,
label textarea {
  margin-top: 7px;
  color: var(--ink);
  font-weight: 500;
}

.writing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

.writing-card {
  display: flex;
  flex-direction: column;
  padding: 14px;
  border: 1px solid rgba(23, 32, 38, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.5);
}

.writing-card span {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.writing-card.full {
  grid-column: 1 / -1;
}

.item-panel {
  margin-top: 18px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(23, 32, 38, 0.08);
}

.section-head {
  align-items: center;
  margin-bottom: 12px;
}

.section-head small {
  color: var(--muted);
}

.item-controls {
  display: grid;
  gap: 10px;
}

.item-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) minmax(160px, 0.7fr) 94px minmax(160px, 0.6fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(23, 32, 38, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
}

.item-tag {
  display: inline-flex;
  justify-content: center;
  padding: 7px 9px;
  border-radius: 999px;
  color: var(--brand-strong);
  background: rgba(184, 242, 216, 0.55);
  font-size: 12px;
  font-weight: 900;
}

.item-text {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-disabled {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 15px;
  color: var(--muted);
  background: rgba(23, 32, 38, 0.06);
  font-size: 13px;
}

.side-stack {
  display: grid;
  gap: 20px;
}

.primary-button {
  min-width: 82px;
  height: 42px;
  color: #fff;
  background: linear-gradient(135deg, var(--hot), #ee3f22);
  font-weight: 900;
  box-shadow: 0 12px 30px rgba(255, 107, 53, 0.26);
}

.copy-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.daily-preview {
  min-height: 330px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  border-radius: 22px;
  color: #1d2b2b;
  white-space: pre-wrap;
  word-break: break-word;
  background:
    linear-gradient(rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.74)),
    repeating-linear-gradient(0deg, transparent 0 30px, rgba(10, 113, 107, 0.08) 30px 31px);
  line-height: 1.75;
}

.export-panel {
  background:
    linear-gradient(135deg, rgba(23, 32, 38, 0.93), rgba(7, 75, 72, 0.9)),
    radial-gradient(circle at 80% 20%, rgba(255, 200, 87, 0.32), transparent 18rem);
  color: #fff;
}

.export-panel .eyebrow {
  color: rgba(255, 255, 255, 0.74);
}

.week-range {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.78);
}

.range-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.range-grid label {
  color: rgba(255, 255, 255, 0.76);
}

.range-grid input {
  margin-top: 7px;
}

.range-button {
  width: 100%;
  margin-top: 10px;
  color: var(--brand-strong);
  background: rgba(184, 242, 216, 0.92);
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.metric-row div {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
}

.metric-row strong,
.metric-row span {
  display: block;
}

.metric-row strong {
  font-size: 28px;
}

.metric-row span {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.export-button {
  width: 100%;
  height: 54px;
  color: var(--ink);
  background: var(--sun);
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 16px 34px rgba(255, 200, 87, 0.22);
}

.table-panel {
  margin-top: 20px;
}

.table-note {
  color: var(--muted);
  line-height: 1.6;
}

.sheet-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
}

.weekly-table {
  width: 100%;
  min-width: 1280px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.weekly-table caption {
  padding: 22px 0;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.weekly-table th,
.weekly-table td {
  border: 1px solid #242424;
  padding: 9px 8px;
  text-align: center;
  vertical-align: middle;
  word-break: break-word;
}

.weekly-table th {
  background: #f6e8c5;
  font-weight: 900;
}

.weekly-table td.plan,
.weekly-table td.content,
.weekly-table td.remark {
  text-align: left;
}

.weekly-table col.date {
  width: 90px;
}

.weekly-table col.weekday {
  width: 66px;
}

.weekly-table col.customer {
  width: 160px;
}

.weekly-table col.parent {
  width: 90px;
}

.weekly-table col.address {
  width: 160px;
}

.weekly-table col.contact {
  width: 78px;
}

.weekly-table col.phone {
  width: 116px;
}

.weekly-table col.plan {
  width: 220px;
}

.weekly-table col.content {
  width: 330px;
}

.weekly-table col.done {
  width: 88px;
}

.weekly-table col.traffic {
  width: 72px;
}

.weekly-table col.remark {
  width: 150px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  transform: translateY(20px);
  max-width: 360px;
  padding: 14px 18px;
  border-radius: 18px;
  color: #fff;
  background: rgba(23, 32, 38, 0.92);
  box-shadow: 0 18px 44px rgba(23, 32, 38, 0.24);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.ghost-button:hover,
.soft-button:hover,
.primary-button:hover,
.export-button:hover,
.icon-button:hover,
.mode-button:hover,
.range-button:hover {
  transform: translateY(-1px);
}

@media (max-width: 1160px) {
  .app-header,
  .workspace {
    grid-template-columns: 1fr;
  }

  .date-tools,
  .header-actions {
    justify-content: flex-start;
  }

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

  .field-config-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1480px);
    padding-top: 10px;
  }

  .header-actions,
  .date-tools,
  .panel-title,
  .section-head,
  .copy-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .field-grid,
  .writing-grid,
  .metric-row,
  .item-row,
  .range-grid {
    grid-template-columns: 1fr;
  }

  .writing-card.full {
    grid-column: auto;
  }
}
