:root {
  --brand: #358D63;
  --brand-dark: #2c7553;
  --brand-soft: #eef7f2;
  --brand-line: #d7e9de;
  --text: #193328;
  --muted: #6d7f77;
  --line: #dfe8e2;
  --card: #ffffff;
  --bg: #f5f8f6;
  --danger: #c84b4b;
  --danger-soft: #fff5f5;
  --warn-soft: #fff7e8;
  --warn-text: #96651d;
  --shadow: 0 12px 30px rgba(26, 48, 38, 0.08);
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f8fbf9 0%, #f3f7f5 100%);
}
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
.page-shell { max-width: 1680px; margin: 0 auto; padding: 20px; }
.hero-card, .card {
  background: var(--card);
  border: 1px solid rgba(53, 141, 99, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero-card {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 24px 26px; margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(53, 141, 99, 0.12), rgba(53, 141, 99, 0.03));
}
.compact-hero h1 { font-size: 28px; }
.hero-card h1 { margin: 6px 0 8px; font-size: 31px; }
.hero-card p { margin: 0; color: var(--muted); line-height: 1.7; }
.eyebrow {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  background: rgba(53, 141, 99, 0.12); color: var(--brand-dark); font-size: 13px; font-weight: 700;
}
.inline-form, .header-actions, .hero-actions, .list-tools, .dialog-actions, .row-actions, .history-actions, .print-actions {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.btn {
  border: 1px solid transparent; background: #fff; color: var(--text);
  border-radius: 999px; padding: 10px 16px; font: inherit; cursor: pointer;
  transition: .16s ease; box-shadow: 0 4px 16px rgba(26, 48, 38, 0.04);
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { border-color: var(--brand-line); color: var(--brand-dark); background: #fff; }
.btn-ghost { background: #f5f8f6; color: var(--text); }
.danger-outline { border-color: #f0d2d2; color: var(--danger); }
.flash-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.flash-item { padding: 12px 14px; border-radius: 14px; font-size: 14px; }
.flash-success { background: var(--brand-soft); color: var(--brand-dark); }
.flash-danger { background: var(--danger-soft); color: var(--danger); }
.flash-warning { background: var(--warn-soft); color: var(--warn-text); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-card {
  background: #fff; border: 1px solid rgba(53, 141, 99, 0.08); border-radius: 18px; box-shadow: var(--shadow);
  padding: 18px 18px 16px;
}
.stat-card span, .mobile-item-meta label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.stat-card strong { display: block; font-size: 28px; line-height: 1.1; }
.stat-card em { display: block; margin-top: 8px; color: var(--muted); font-style: normal; font-size: 13px; }
.layout-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.single-main-grid { grid-template-columns: minmax(0, 1fr) 420px; }
.main-column, .side-column { display: flex; flex-direction: column; gap: 18px; }
.card-header {
  display: flex; justify-content: space-between; align-items: center; gap: 18px;
  padding: 20px 22px 14px; border-bottom: 1px solid #edf3ef;
}
.card-header h2, .card-header h3, .section-head h3 { margin: 0; font-size: 20px; }
.muted, .section-head p { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.small { font-size: 12px; }
.sticky {
  position: sticky; top: 14px; z-index: 5;
  background: rgba(255,255,255,0.96); backdrop-filter: blur(8px);
}
.form-grid { display: grid; gap: 14px; padding: 20px 22px 10px; }
.settings-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
label span, .title-preview span { display: block; margin-bottom: 8px; font-size: 13px; color: var(--muted); font-weight: 700; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; color: var(--text); background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
textarea { min-height: 82px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(53, 141, 99, 0.55); box-shadow: 0 0 0 4px rgba(53, 141, 99, 0.12); }
.title-preview { padding: 12px 14px; border: 1px dashed rgba(53, 141, 99, 0.25); background: var(--brand-soft); border-radius: 14px; }
.title-preview strong { display: block; line-height: 1.7; }
.title-sub { margin-top: 6px; color: var(--brand-dark); font-size: 13px; }
.card-section { padding: 6px 22px 22px; }
.section-head {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px;
}
.section-head p { margin-bottom: 0; }
.raw-text { min-height: 220px; font-family: Consolas, "Microsoft YaHei", monospace; line-height: 1.65; }
.count-badge, .status-badge {
  padding: 8px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: 13px; font-weight: 700;
}
.large-badge { font-size: 14px; padding: 10px 14px; }
.status-submitted { background: var(--brand-soft); color: var(--brand-dark); }
.status-draft { background: var(--warn-soft); color: var(--warn-text); }
.status-updated { background: #eef6ff; color: #245ea7; }
.list-tools-gap { margin-bottom: 16px; }
.helper-inline { margin-bottom: 14px; line-height: 1.9; }
.helper-chip {
  display: inline-flex; align-items: center; margin: 0 8px 8px 0; padding: 4px 10px; border-radius: 999px;
  background: #f6f9f7; color: var(--muted); font-size: 12px; border: 1px solid #e6eeea;
}
.table-wrap, .preview-scroll { overflow: auto; }
.edit-table, .preview-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 1080px; }
.preview-table { min-width: 1160px; }
.edit-table th, .edit-table td, .preview-table th, .preview-table td {
  border-right: 1px solid #dfe7e2; border-bottom: 1px solid #dfe7e2; padding: 10px; vertical-align: middle; background: #fff;
}
.edit-table th:first-child, .edit-table td:first-child, .preview-table th:first-child, .preview-table td:first-child { border-left: 1px solid #dfe7e2; }
.edit-table thead th, .preview-table thead th {
  position: sticky; top: 0; z-index: 2; background: #f7faf8; font-weight: 800; text-align: center; vertical-align: middle;
}
.preview-table .title-row th, .preview-table thead tr:first-child th { background: #fff; font-size: 22px; padding: 16px 10px; }
.edit-table textarea { min-height: 54px; }
.left-cell { text-align: left !important; }
.schedule-type-picker{
  display:flex;
  flex-wrap:wrap;
  gap:.65rem;
  align-items:center;
  background:#f5faf7;
  border:1px solid #d7e8dd;
  border-radius:10px;
  padding:.45rem;
  width:max-content;
  max-width:100%;
}
.schedule-type-picker label{
  display:inline-flex;
  flex-direction:row;
  align-items:center;
  margin:0;
  font-weight:700;
  cursor:pointer;
}
.schedule-type-picker input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.schedule-type-picker span{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  padding:0 14px;
  border-radius:8px;
  color:#315949;
  white-space:nowrap;
  transition:background .16s ease, color .16s ease, box-shadow .16s ease;
}
.schedule-type-picker input:checked + span{
  background:#176b4d;
  color:#fff;
  box-shadow:0 6px 16px rgba(23,107,77,.18);
}
.all-day-time-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:.5rem;
}
.all-day-time-grid[hidden],
.untimed-field[hidden],
.time-suggest-inline[hidden],
.dialog-grid label[hidden]{
  display:none !important;
}
.untimed-summary-cell{
  text-align:left !important;
  white-space:normal;
  line-height:1.7;
}
.unscheduled-calendar-cell{
  border-color:#91c7aa !important;
}
.compact-raw-text{
  min-height:110px;
}
.check-col { width: 52px; text-align: center; }
.action-col { width: 130px; }
.empty-tip, .empty-history { text-align: center; color: var(--muted); padding: 20px !important; }
.footer-line { text-align: left !important; padding: 12px 14px !important; background: #fff; }
.footer-right { text-align: right !important; }
.single-card { max-width: 720px; margin: 30px auto; }
.side-card { overflow: hidden; }
.side-collapse {
  border: 1px solid #e3ece7;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(26, 48, 38, 0.05);
  overflow: hidden;
}
.side-collapse > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.side-collapse > summary::-webkit-details-marker { display: none; }
.side-collapse > summary::after {
  content: "展开";
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
}
.side-collapse[open] > summary::after { content: "收起"; }
.side-collapse > .card {
  border: 0;
  border-top: 1px solid #edf3ef;
  border-radius: 0;
  box-shadow: none;
}
.history-group {
  border: 1px solid #e6eeea;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.history-group > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-weight: 800;
}
.history-group > summary::-webkit-details-marker { display: none; }
.history-group summary em {
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.history-group-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 10px 10px;
}
.history-group-body .history-item { border-radius: 12px; }
.overview-mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; padding: 18px 22px 4px; }
.overview-mini-grid div { background: #f7faf8; border: 1px solid #e7efea; border-radius: 14px; padding: 14px 12px; text-align: center; }
.overview-mini-grid b { display: block; font-size: 24px; }
.overview-mini-grid span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.special-pool-actions {
  display: grid;
  gap: 10px;
  padding: 12px 22px 4px;
}
.special-pool-group {
  border: 1px solid #e6eeea;
  border-radius: 12px;
  background: #fbfdfc;
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.special-pool-group strong {
  flex: 1 1 150px;
}
.share-create-box { padding: 16px 22px 4px; }
.stack-form { display: flex; flex-direction: column; gap: 12px; }
.compact-stack textarea { min-height: 90px; }
.section-mini-title {
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 900;
  padding: 8px 0 2px;
  border-top: 1px solid #edf3ef;
}
.section-mini-title:first-child { border-top: 0; padding-top: 0; }
.share-list, .history-list { display: flex; flex-direction: column; gap: 12px; padding: 10px 22px 22px; }
.share-item-card, .history-item {
  border: 1px solid #e6eeea; border-radius: 14px; padding: 14px; background: #fff;
}
.share-item-card.share-updated { border-color: #d8e6fa; background: #f8fbff; }
.share-item-card.share-draft { border-color: #f0e4c6; background: #fffdf8; }
.share-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.share-item-meta { color: var(--muted); font-size: 12px; line-height: 1.6; }
.share-actions-grid, .history-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.mini-link, .history-actions a { font-size: 13px; }
.danger-text { color: var(--danger); }
.item-dialog {
  width: min(920px, calc(100vw - 28px)); max-width: calc(100vw - 28px); border: 1px solid rgba(53, 141, 99, 0.14); border-radius: 20px; padding: 0; overflow-x: hidden;
}
.item-dialog::backdrop { background: rgba(13, 34, 23, 0.36); backdrop-filter: blur(3px); }
.dialog-head {
  display: flex; justify-content: space-between; gap: 14px; align-items: flex-start;
  padding: 22px 24px 12px; border-bottom: 1px solid #edf3ef;
}
.dialog-head h3 { margin: 0; font-size: 22px; }
.dialog-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.dialog-close {
  width: 38px; height: 38px; border: 0; border-radius: 50%; background: #f5f8f6; color: var(--text); font-size: 24px; cursor: pointer;
}
.dialog-grid {
  display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 18px 24px 10px;
  overflow-x: hidden;
}
.dialog-grid > * { min-width: 0; }
.dialog-span-3 { grid-column: 1 / -1; }
.dialog-actions { padding: 6px 24px 22px; justify-content: flex-end; }
.quick-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.chip-btn {
  border: 1px solid #dce8e0; background: #f7faf8; color: var(--brand-dark); border-radius: 999px;
  padding: 6px 10px; font: inherit; font-size: 12px; cursor: pointer;
}
.readonly-table td { background: #fff; }
.row-actions { justify-content: center; }
.mini-btn {
  border: 1px solid #dce8e0; background: #fff; color: var(--brand-dark); border-radius: 999px;
  padding: 6px 10px; font-size: 12px; cursor: pointer;
}
.mini-btn.danger { border-color: #f0d2d2; color: var(--danger); }
.share-meta-inline {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 22px 0; flex-wrap: wrap;
}
.share-meta-left { font-weight: 700; }
.share-meta-right { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.share-meta-time { color: var(--muted); font-size: 12px; }
.mobile-card-list { display: none; }
.mobile-item-card {
  border: 1px solid #e6eeea; border-radius: 16px; padding: 14px; background: #fff; margin-bottom: 12px;
}
.mobile-item-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.mobile-item-content { font-weight: 700; line-height: 1.6; margin-bottom: 10px; }
.mobile-item-meta { display: flex; gap: 10px; line-height: 1.7; margin-bottom: 8px; }
.mobile-item-meta label { flex: 0 0 46px; margin: 0; }
.mobile-row-actions { justify-content: flex-start; margin-top: 8px; }
.calendar-grid {
  display: grid; gap: 12px; padding: 18px 22px 22px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.calendar-grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.calendar-grid.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.calendar-grid.cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-grid.cols-8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.calendar-cell {
  border: 1px solid #e5eeea; border-radius: 16px; background: #fff; min-height: 240px; display: flex; flex-direction: column;
}
.calendar-cell > header {
  padding: 14px 14px 10px; border-bottom: 1px solid #edf3ef; background: #f8fbf9;
  display: grid; grid-template-columns: auto 1fr auto; gap: 6px; align-items: center;
}
.calendar-cell header strong { font-size: 15px; }
.calendar-cell header span { color: var(--muted); font-size: 13px; }
.calendar-cell header em { font-style: normal; color: var(--brand-dark); font-size: 12px; }
.calendar-items { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.calendar-item { border: 1px solid #e8efea; border-radius: 14px; padding: 10px; background: #fff; }
.calendar-time { color: var(--brand-dark); font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.calendar-content { line-height: 1.6; font-weight: 700; }
.calendar-meta { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.calendar-empty { color: var(--muted); min-height: 96px; display: flex; align-items: center; justify-content: center; }
.compact-calendar { padding-top: 6px; }
.compact-preview thead th:first-child { font-size: 16px; }
.small-preview-scroll .preview-table { min-width: 940px; }
.print-shell { max-width: 100%; padding: 0; background: #eef2ef; }
.print-toolbar {
  position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 16px 20px; background: rgba(255,255,255,0.95); border-bottom: 1px solid #e5ede8;
}
.print-title { font-size: 18px; font-weight: 800; }
.print-paper {
  max-width: 1280px; margin: 18px auto 28px; background: #fff; border-radius: 22px; box-shadow: var(--shadow); padding: 28px;
}
.print-doc-title { text-align: center; font-size: 24px; font-weight: 800; margin-bottom: 18px; }
.print-table thead tr:first-child th { font-size: 15px !important; }
.print-calendar-grid { padding: 0; }
.print-calendar-cell { min-height: 290px; }
.no-print { display: flex; }
@media (max-width: 1300px) {
  .layout-grid, .single-main-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .page-shell { padding: 12px; }
  .hero-card, .card-header, .dialog-grid, .section-head { gap: 12px; }
  .hero-card { flex-direction: column; align-items: flex-start; padding: 18px; }
  .hero-card h1 { font-size: 26px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .overview-mini-grid { grid-template-columns: 1fr; }
  .dialog-grid { grid-template-columns: 1fr; padding: 16px 18px 8px; }
  .card-header, .card-section { padding-left: 16px; padding-right: 16px; }
  .share-meta-inline { padding-left: 16px; padding-right: 16px; }
  .calendar-grid, .print-calendar-grid { grid-template-columns: 1fr !important; padding-left: 16px; padding-right: 16px; }
  .mobile-only-hidden { display: none; }
  .mobile-only-show { display: block; }
  .mobile-card-list { display: block; }
  .print-paper { border-radius: 0; margin: 0; padding: 18px 14px; }
}
@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .print-paper { box-shadow: none; border-radius: 0; margin: 0; max-width: none; padding: 0; }
  .print-doc-title { margin: 0 0 12px; }
  .print-calendar-grid { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; gap: 8px; }
  .print-calendar-cell { min-height: 190px; break-inside: avoid; }
}


.time-field-wrap { align-self: start; }
.time-suggest-inline { margin-top: 8px; }
.time-suggest-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.time-suggest-inline .quick-chips { margin-top: 0; }
@media (max-width: 900px) {
  .time-field-wrap { grid-column: 1 / -1; }
}


.lock-fieldset { border: 0; padding: 0; margin: 0; min-inline-size: 0; }
.lock-banner {
  margin: 0 22px 8px; padding: 14px 16px; border-radius: 16px; border: 1px solid #d7e9de;
  background: linear-gradient(135deg, rgba(53,141,99,.11), rgba(53,141,99,.04));
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.compact-lock-banner { margin-top: 12px; }
.lock-note {
  padding: 12px 14px; border-radius: 14px; background: #f7faf8; border: 1px dashed #d7e9de; color: var(--muted);
}
.suggest-list {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px;
}
.suggest-list[hidden] { display: none; }
.suggest-item {
  border: 1px solid #dbe8df; background: #fff; color: var(--brand-dark);
  border-radius: 999px; padding: 5px 10px; font: inherit; font-size: 12px; cursor: pointer;
}
.suggest-item:hover { background: var(--brand-soft); }
.calendar-cell.density-low > header { background: #f7fbf8; }
.calendar-cell.density-mid > header { background: #f3f8ff; }
.calendar-cell.density-high > header { background: #fff7eb; }
.calendar-toggle {
  margin: 0 12px 12px; border: 1px dashed #cfe1d6; background: #f8fbf9; color: var(--brand-dark);
  border-radius: 999px; padding: 8px 12px; font: inherit; cursor: pointer;
}
.calendar-meta { display: flex; flex-direction: column; gap: 4px; }
.calendar-item-extra { background: #fcfefd; }
.month-calendar-panel {
  background: #fff;
  border: 1px solid #e3ece7;
  border-radius: 18px;
  padding: 18px;
}
.month-calendar-title {
  text-align: center;
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 14px;
}
.month-calendar-weekdays,
.month-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.month-calendar-weekdays {
  gap: 8px;
  margin-bottom: 8px;
}
.month-calendar-weekdays span {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.month-calendar-grid {
  gap: 8px;
}
.month-calendar-cell {
  min-width: 0;
  min-height: 132px;
  border: 1px solid #e2ebe6;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 9px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.month-calendar-cell:hover {
  border-color: rgba(53,141,99,.45);
  box-shadow: 0 10px 24px rgba(34,58,47,.08);
  transform: translateY(-1px);
}
.month-calendar-cell[aria-disabled="true"] {
  cursor: default;
}
.month-calendar-cell[aria-disabled="true"]:hover {
  border-color: #e2ebe6;
  box-shadow: none;
  transform: none;
}
.month-calendar-cell.is-muted {
  background: #f8faf9;
  color: #98a6a0;
}
.month-calendar-cell.density-low { background: #fbfefd; }
.month-calendar-cell.density-mid { background: #f5f9ff; }
.month-calendar-cell.density-high { background: #fff8ed; }
.month-calendar-date {
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}
.month-calendar-weekday,
.month-calendar-empty {
  color: var(--muted);
  font-size: 12px;
}
.month-calendar-count {
  align-self: flex-start;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 800;
}
.month-calendar-brief {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.45;
  font-size: 12px;
  font-weight: 700;
}
.month-untimed-block {
  margin-top: 14px;
  border: 1px dashed #cfe1d6;
  border-radius: 12px;
  padding: 12px 14px;
  background: #f8fbf9;
  line-height: 1.7;
}
.month-untimed-block strong {
  display: block;
  margin-bottom: 6px;
  color: var(--brand-dark);
}
.day-dialog {
  width: min(720px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 28px));
  border: 1px solid rgba(53, 141, 99, 0.16);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 28px 80px rgba(13, 34, 23, .24);
}
.day-dialog:not([open]) { display: none; }
.day-dialog::backdrop {
  background: rgba(13, 34, 23, .36);
  backdrop-filter: blur(3px);
}
.day-dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
}
.day-dialog-title {
  padding-right: 44px;
  font-size: 22px;
  font-weight: 900;
}
.day-dialog-subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}
.day-dialog-item {
  border: 1px solid #e6eeea;
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 12px;
  background: #fff;
}
.day-dialog-time {
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 6px;
}
.day-dialog-content {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.7;
}
.day-dialog-meta {
  margin-top: 8px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  line-height: 1.6;
}
.day-dialog-empty {
  padding: 24px 0 4px;
  color: var(--muted);
  text-align: center;
}
.share-meta-compact { padding-top: 14px; }
.polished-mobile-card {
  border-radius: 18px; box-shadow: 0 10px 24px rgba(26, 48, 38, 0.06); border-color: #e3ece7;
}
.mobile-item-time { color: var(--muted); font-size: 12px; margin-top: 4px; }
.mobile-item-pill {
  display: inline-flex; align-items: center; justify-content: center; padding: 6px 10px;
  border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: 12px; font-weight: 700;
}
.mobile-item-grid { display: grid; gap: 8px; }
.mobile-row-actions-large .mini-btn { padding: 10px 14px; font-size: 13px; }
.print-lock-pill {
  display: inline-flex; margin-left: 10px; padding: 4px 10px; border-radius: 999px; font-size: 12px;
  background: var(--brand-soft); color: var(--brand-dark); vertical-align: middle;
}
.share-state-draft { border-left: 4px solid #dca537; }
.share-state-updated { border-left: 4px solid #4b87c8; }
.share-state-submitted { border-left: 4px solid var(--brand); }
.locked-tools { justify-content: flex-start; }
@media (max-width: 900px) {
  .share-mobile-hero { padding-bottom: 14px; }
  .share-mobile-hero h1 { font-size: 24px; }
  .share-tools { position: sticky; top: 12px; z-index: 6; background: rgba(255,255,255,.96); padding: 10px; border-radius: 16px; border: 1px solid #ebf2ee; }
  .mobile-item-grid { gap: 10px; }
  .mobile-item-meta { align-items: flex-start; }
  .mobile-item-meta label { flex-basis: 54px; color: var(--muted); }
  .month-calendar-panel { padding: 10px; border-radius: 14px; }
  .month-calendar-title { font-size: 17px; margin-bottom: 10px; }
  .month-calendar-weekdays, .month-calendar-grid { gap: 4px; }
  .month-calendar-weekdays span { font-size: 11px; }
  .month-calendar-cell {
    min-height: 68px;
    border-radius: 7px;
    padding: 5px;
    gap: 3px;
  }
  .month-calendar-date { font-size: 15px; }
  .month-calendar-weekday, .month-calendar-empty { display: none; }
  .month-calendar-count { padding: 2px 5px; font-size: 10px; }
  .month-calendar-brief {
    font-size: 10px;
    line-height: 1.3;
    -webkit-line-clamp: 1;
  }
  .day-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    padding: 18px 14px;
    border-radius: 16px;
  }
  .day-dialog-title { font-size: 19px; }
}
@media print {
  .calendar-extra { display: contents !important; }
  .calendar-toggle, .print-lock-pill.no-print { display: none !important; }
  .month-calendar-panel { border: 0; padding: 0; }
  .month-calendar-grid, .month-calendar-weekdays { gap: 5px; }
  .month-calendar-cell { min-height: 96px; break-inside: avoid; box-shadow: none; }
  .month-calendar-brief { -webkit-line-clamp: 3; }
}

.publish-box { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 12px; }
.publish-link-row { display: flex; gap: 10px; align-items: center; }
.publish-link-input {
  flex: 1; min-width: 0; padding: 12px 14px; border-radius: 14px; border: 1px solid #dbe6df;
  background: #f9fcfa; color: var(--text); font: inherit;
}
.publish-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.public-shell { background: linear-gradient(180deg, #eef4f0 0%, #f6faf7 100%); }
.public-topbar {
  position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.94); backdrop-filter: blur(10px);
  border-bottom: 1px solid #e4ece8;
}
.public-topbar-inner {
  max-width: 1320px; margin: 0 auto; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.public-kicker { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.public-title { font-size: 24px; font-weight: 900; line-height: 1.25; }
.public-subtitle { color: var(--muted); margin-top: 6px; }
.public-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.tab-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.public-container { max-width: 1320px; margin: 0 auto; padding: 20px; }
.public-switcher { display: none; gap: 10px; margin-bottom: 14px; }
.public-hero-card {
  background: linear-gradient(135deg, rgba(53,141,99,.10), rgba(53,141,99,.03)); border: 1px solid #dfeae4;
  border-radius: 24px; padding: 24px 26px; box-shadow: 0 18px 40px rgba(34, 58, 47, .06);
  display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 18px;
}
.public-hero-card h1 { margin: 0; font-size: 34px; line-height: 1.25; }
.public-meta-inline { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.public-meta-inline span, .public-badge {
  display: inline-flex; align-items: center; padding: 8px 12px; border-radius: 999px;
  background: rgba(255,255,255,.82); border: 1px solid #dce8e1; color: var(--brand-dark); font-size: 13px; font-weight: 700;
}
.public-table-wrap {
  background: #fff; border: 1px solid #e3ece7; border-radius: 24px; box-shadow: 0 20px 44px rgba(34, 58, 47, .06);
  overflow: auto; padding: 20px;
}
.public-preview-table { width: 100%; min-width: 1180px; border-collapse: separate; border-spacing: 0; }
.public-preview-table th, .public-preview-table td {
  border-right: 1px solid #dbe5df; border-bottom: 1px solid #dbe5df; padding: 12px 12px; background: #fff; vertical-align: middle;
}
.public-preview-table th:first-child, .public-preview-table td:first-child { border-left: 1px solid #dbe5df; }
.public-preview-table thead th { text-align: center; font-weight: 800; }
.public-preview-table thead .group-row th {
  background: linear-gradient(180deg, #ebf4ef, #e4efe9); color: var(--brand-dark); font-size: 16px; padding: 14px 8px;
}
.public-preview-table thead .sub-row th { background: #f7faf8; color: #234737; font-size: 14px; }
.public-preview-table tbody tr:nth-child(even) td { background: #fbfdfc; }
.public-preview-table .work-col { font-weight: 700; line-height: 1.72; }
.public-preview-table tfoot td { background: #fff; }
.public-calendar-grid { display: grid; gap: 14px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.public-calendar-grid.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.public-calendar-grid.cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.public-calendar-grid.cols-8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.public-calendar-cell {
  border: 1px solid #e2ebe6; border-radius: 20px; background: #fff; box-shadow: 0 14px 36px rgba(34, 58, 47, .05);
  overflow: hidden; min-height: 260px; display: flex; flex-direction: column;
}
.public-calendar-cell > header {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; background: #f8fbf9; border-bottom: 1px solid #eaf1ed;
}
.public-calendar-cell header strong { display: block; font-size: 16px; }
.public-calendar-cell header span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.public-calendar-cell header em { font-style: normal; color: var(--brand-dark); font-size: 12px; }
.public-calendar-items { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.public-calendar-item { border: 1px solid #e8efea; border-radius: 14px; padding: 11px 12px; background: #fff; }
.public-calendar-time { font-size: 12px; color: var(--brand-dark); font-weight: 800; margin-bottom: 6px; }
.public-calendar-content { font-weight: 800; line-height: 1.7; }
.public-calendar-extra { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }
.public-mobile-cards { display: none; }
.public-mobile-day-card { background: #fff; border: 1px solid #e3ece7; border-radius: 20px; box-shadow: 0 12px 30px rgba(34, 58, 47, .05); overflow: hidden; margin-top: 14px; }
.public-mobile-day-card > header { padding: 14px 16px; background: #f8fbf9; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #edf3ef; }
.public-mobile-item-card { padding: 14px 16px; border-top: 1px solid #f0f4f1; }
.public-mobile-summary-card { border-color: #cfe4d7; }
.public-mobile-summary-card > header { background: var(--brand-soft); color: var(--brand-dark); }
.public-mobile-time { color: var(--brand-dark); font-size: 12px; font-weight: 800; margin-bottom: 6px; }
.public-mobile-content { font-weight: 800; line-height: 1.7; margin-bottom: 8px; }
.public-mobile-meta { display: grid; grid-template-columns: 56px 1fr; gap: 8px; color: var(--muted); line-height: 1.7; font-size: 13px; }
.public-mobile-meta label { color: var(--text); font-weight: 700; }
.public-calendar-cell.density-mid > header { background: #f3f8ff; }
.public-calendar-cell.density-high > header { background: #fff6e9; }

@media (max-width: 900px) {
  .publish-link-row { flex-direction: column; align-items: stretch; }
  .public-topbar { display: none; }
  .public-container { padding: 14px; }
  .public-switcher { display: flex; }
  .public-hero-card { padding: 18px; border-radius: 20px; }
  .public-hero-card h1 { font-size: 24px; }
  .public-calendar-grid { grid-template-columns: 1fr !important; }
  .public-table-wrap { display: none; }
  .public-mobile-cards { display: block; }
}

@media print {
  .public-topbar, .public-switcher { display: none !important; }
  .public-container { max-width: none; padding: 0; }
  .public-hero-card { box-shadow: none; border-radius: 0; border: 0; background: #fff; padding: 0 0 12px; }
  .public-table-wrap, .public-calendar-cell, .public-mobile-day-card { box-shadow: none; }
  .public-table-wrap { border: 0; border-radius: 0; padding: 0; overflow: visible; }
  .public-preview-table { min-width: 0; }
  .public-calendar-grid { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
}

.inline-form { display: inline-flex; margin: 0; }
.mini-link-btn { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.login-shell { min-height: calc(100vh - 40px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: min(520px, 100%); background: #fff; border: 1px solid #dfe8e3; border-radius: 28px; box-shadow: 0 24px 60px rgba(20, 46, 36, .10); padding: 28px; }
.login-card h1 { margin: 8px 0 12px; }
.login-form { margin-top: 18px; }
.login-btn { width: 100%; justify-content: center; }
.login-tip { margin-top: 14px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.login-tip code { background: #f4f7f5; border: 1px solid #e2ebe6; border-radius: 8px; padding: 2px 6px; }

/* 固定协助链接 */
.fixed-collab-card .card-header,
.fixed-week-browser .card-header { border-bottom: 1px solid #e8f0eb; }
.fixed-collab-form { padding: 16px 22px 8px; border-top: 1px dashed #dfe9e3; }
.fixed-collab-form textarea { min-height: 110px; }
.fixed-share-list { padding-top: 8px; }
.fixed-link-box { display: flex; gap: 8px; align-items: center; margin: 10px 0 8px; }
.fixed-link-input { font-size: 12px; padding: 10px 12px; border-radius: 12px; }
.copy-fixed-link-btn { white-space: nowrap; padding: 9px 12px; }
.fixed-week-browser { margin-bottom: 16px; }
.week-chip-list { padding: 16px 20px 20px; display: flex; flex-wrap: wrap; gap: 10px; }
.week-chip {
  display: inline-flex; flex-direction: column; gap: 4px; min-width: 160px; flex: 1 1 180px;
  text-decoration: none; color: var(--text); background: #fbfdfc; border: 1px solid #e1ebe5;
  border-radius: 16px; padding: 12px 14px; transition: all .18s ease;
}
.week-chip:hover { transform: translateY(-1px); border-color: rgba(53,141,99,.45); box-shadow: 0 10px 24px rgba(34,58,47,.07); }
.week-chip.active { background: linear-gradient(135deg, rgba(53,141,99,.12), rgba(53,141,99,.04)); border-color: rgba(53,141,99,.42); }
.week-chip strong { font-size: 15px; }
.week-chip span { color: var(--muted); font-size: 12px; }
.week-chip em { align-self: flex-start; font-style: normal; font-size: 12px; font-weight: 800; color: var(--brand-dark); background: rgba(53,141,99,.10); padding: 3px 8px; border-radius: 999px; }
@media (max-width: 900px) {
  .fixed-link-box { flex-direction: column; align-items: stretch; }
  .week-chip { flex-basis: 100%; min-width: 0; }
}

/* 学期设置 */
.semester-card { border-color: rgba(53,141,99,.16); }
.semester-form input[type="date"], .semester-form input[type="number"], .semester-form input[type="text"] { width: 100%; }
.semester-date-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.semester-note {
  border: 1px dashed #d7e9de; background: #f7faf8; color: var(--muted);
  border-radius: 14px; padding: 10px 12px; font-size: 13px; line-height: 1.7;
}

/* 协助填写页：手机优先简洁版 */
.share-simple-hero { align-items: stretch; }
.share-hero-main { min-width: 0; }
.share-hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.share-hero-meta span {
  display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px;
  background: rgba(255,255,255,.72); border: 1px solid #dfeae4; color: var(--brand-dark); font-size: 12px; font-weight: 700;
}
.share-hero-actions { align-items: center; }
.hero-add-btn { box-shadow: 0 10px 20px rgba(53,141,99,.18); }
.share-edit-card { margin-bottom: 16px; }
.share-main-section { padding-top: 18px; }
.share-section-head-compact p { margin-top: 4px; }
.share-table-preview-card { margin-bottom: 16px; }
.share-preview-scroll { padding: 0 22px 22px; }
.share-preview-scroll .preview-table { min-width: 980px; }
.fixed-week-browser-bottom { margin-top: 16px; margin-bottom: 0; }
.week-select-wrap { padding: 18px 22px 22px; }
.week-select-wrap label { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.week-select-wrap label span { font-weight: 800; color: var(--text); }
.week-select-wrap select {
  width: 100%; border: 1px solid #dbe6df; border-radius: 14px; padding: 12px 14px;
  background: #f9fcfa; color: var(--text); font: inherit;
}

.simple-week-browser { box-shadow: none; background: transparent; border: 0; margin-top: 14px; }
.simple-week-browser .week-select-wrap { padding: 0; }
.simple-week-browser select { background: #fff; box-shadow: 0 10px 24px rgba(26, 48, 38, 0.06); }
.share-preview-header .btn { white-space: nowrap; }

/* 后台汇总事项统一管理 */
.aggregate-lock-banner { margin-bottom: 16px; }
.aggregate-stats { margin-bottom: 16px; }
.aggregate-preview-card { margin-bottom: 18px; }
.aggregate-editor-card { margin-bottom: 28px; }
.aggregate-edit-table { min-width: 1320px; }
.aggregate-edit-table th:first-child { min-width: 128px; }
.aggregate-edit-table th:last-child { min-width: 112px; }
.aggregate-source-cell small { display: block; margin-top: 7px; color: var(--muted); line-height: 1.45; }
.source-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.source-main { color: #245b43; background: rgba(53,141,99,.12); }
.source-share { color: #315f96; background: #eaf2fc; }
.aggregate-action-cell { white-space: nowrap; }
.aggregate-action-cell .mini-btn { display: block; width: 100%; margin: 0 0 7px; }
.aggregate-action-cell .mini-btn:last-child { margin-bottom: 0; }
.aggregate-muted-cell { color: var(--muted); font-weight: 700; }

@media (max-width: 900px) {
  .semester-date-grid { grid-template-columns: 1fr; }
  .share-simple-hero { padding: 16px; gap: 14px; }
  .share-mobile-hero h1 { font-size: 22px; line-height: 1.25; }
  .share-mobile-hero p { font-size: 13px; line-height: 1.6; }
  .share-hero-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .share-hero-actions .hero-add-btn { grid-column: 1 / -1; width: 100%; justify-content: center; padding: 12px 14px; }
  .share-hero-actions .status-badge { justify-content: center; }
  .share-hero-meta { gap: 6px; }
  .share-hero-meta span { font-size: 11px; padding: 5px 8px; }
  .share-tools { position: sticky; top: 8px; z-index: 6; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: rgba(255,255,255,.96); padding: 10px; border-radius: 16px; border: 1px solid #ebf2ee; }
  .share-tools .btn { width: 100%; justify-content: center; }
  .share-tools .btn-primary { grid-column: 1 / -1; }
  .share-preview-scroll { padding: 0 14px 16px; }
  .share-preview-scroll .preview-table { min-width: 760px; }
  .week-select-wrap { padding: 14px 16px 18px; }

  .share-preview-header { align-items: center; padding: 16px; }
  .share-preview-header h2 { font-size: 18px; }
  .share-preview-header .btn { padding: 9px 12px; font-size: 13px; }
  .simple-week-browser { margin-top: 12px; }
  .fixed-week-browser-bottom .card-header { padding-bottom: 10px; }
}
