    body {
      font-family: "Noto Sans TC", Arial, sans-serif;
      margin: 0;
      padding: 0;
      background: #f6f7fb;
      color: #333;
    }

    .wrapper {
      padding: 24px;
    }

    .header {
      background: #ffffff;
      border-radius: 18px;
      padding: 24px;
      box-shadow: 0 4px 14px rgba(0,0,0,0.08);
      margin-bottom: 20px;
    }

    .header h1 {
      margin: 0;
      font-size: 30px;
      font-weight: 700;
    }

    .tab-bar {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      margin-top: 16px;
    }

    .tab-btn {
      border: none;
      background: #ece7ff;
      color: #5b3cc4;
      padding: 10px 18px;
      border-radius: 999px;
      font-size: 14px;
      font-weight: 700;
      cursor: pointer;
      transition: 0.2s;
    }

    .tab-btn:hover {
      transform: translateY(-1px);
      opacity: 0.95;
    }

    .tab-btn.active {
      background: #A66CFF;
      color: #fff;
      box-shadow: 0 6px 18px rgba(166,108,255,0.28);
    }

    .tab-panel {
      display: none;
    }

    .tab-panel.active {
      display: block;
    }

    .calendar-section,
    .proposal-section {
      margin-top: 24px;
      background: #ffffff;
      border-radius: 18px;
      padding: 22px;
      box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    }

    .calendar-section {
      margin-top: 0;
    }

    .section-subtitle {
      font-size: 22px;
      font-weight: 800;
      margin: 0 0 16px 0;
      color: #2f2f2f;
    }

    .layout {
      display: grid;
      grid-template-columns: 1.2fr 0.8fr;
      gap: 20px;
      align-items: start;
    }

    .calendar-card,
    .side-card {
      background: #ffffff;
      border-radius: 18px;
      padding: 20px;
      box-shadow: 0 4px 14px rgba(0,0,0,0.08);
      border: 1px solid #ececec;
    }

    .calendar-top {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 16px;
      gap: 12px;
      flex-wrap: wrap;
    }

    .calendar-title {
      font-size: 24px;
      font-weight: 700;
    }

    .calendar-btns {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }

    .btn {
      border: none;
      background: #A66CFF;
      color: #fff;
      padding: 10px 16px;
      border-radius: 12px;
      cursor: pointer;
      font-size: 14px;
      font-weight: 600;
      transition: 0.2s;
    }

    .btn:hover {
      opacity: 0.92;
      transform: translateY(-1px);
    }

    .btn-secondary {
      background: #e5e7eb;
      color: #333;
    }

    .btn-danger {
      background: #ef4444;
      color: #fff;
    }

    .btn-success {
      background: #22c55e;
      color: #fff;
    }

    .btn-small {
      padding: 8px 12px;
      font-size: 13px;
    }

    .calendar-grid {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 10px;
    }

    .week-name {
      background: #f0ebff;
      text-align: center;
      padding: 12px 8px;
      border-radius: 10px;
      font-weight: 700;
    }

    .day-cell {
      min-height: 128px;
      background: #fafafa;
      border: 1px solid #e5e7eb;
      border-radius: 12px;
      padding: 10px;
      cursor: pointer;
      position: relative;
      overflow: hidden;
      transition: 0.2s;
    }

    .day-cell:hover {
      border-color: #A66CFF;
      background: #f9f5ff;
      transform: translateY(-1px);
    }

    .day-cell.selected {
      border: 2px solid #A66CFF;
      background: #f6f0ff;
    }

    .day-number {
      font-weight: 700;
      margin-bottom: 8px;
      font-size: 15px;
    }

    .other-month {
      opacity: 0.35;
      cursor: default;
    }

    .event-item {
      border-radius: 8px;
      padding: 5px 7px;
      font-size: 12px;
      margin-bottom: 6px;
      overflow: hidden;
      font-weight: 600;
      line-height: 1.4;
    }

    .event-item-title {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .event-item-meta {
      font-size: 11px;
      opacity: 0.9;
      margin-top: 2px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .side-title {
      font-size: 22px;
      font-weight: 700;
      margin: 0 0 8px 0;
    }

    .selected-date-label {
      color: #A66CFF;
      font-weight: 700;
      margin-bottom: 16px;
    }

    .empty-text {
      color: #888;
      padding: 12px 0;
    }

    .event-list {
      display: flex;
      flex-direction: column;
      gap: 12px;
      margin-bottom: 18px;
    }

    .event-card {
      border: 1px solid #e5e7eb;
      border-radius: 14px;
      padding: 14px;
      background: #fafafa;
    }

    .event-card-head {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 10px;
      margin-bottom: 8px;
    }

    .event-card-title {
      font-size: 16px;
      font-weight: 700;
      line-height: 1.4;
    }

    .event-card-subtitle {
      font-size: 13px;
      color: #666;
      margin-top: 4px;
    }

    .badge-row {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin-bottom: 10px;
    }

    .project-item-badge,
    .owner-badge {
      display: inline-block;
      padding: 4px 10px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 700;
      white-space: nowrap;
    }

    .owner-badge {
      background: #eef2ff;
      color: #4338ca;
    }

    .event-card-content {
      font-size: 14px;
      color: #444;
      white-space: pre-wrap;
      margin-bottom: 10px;
      line-height: 1.6;
    }

    .event-card-meta {
      font-size: 12px;
      color: #888;
      margin-bottom: 12px;
    }

    .event-card-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .form-box {
      border-top: 1px solid #ececec;
      padding-top: 18px;
    }

    .form-title {
      font-size: 18px;
      font-weight: 700;
      margin-bottom: 14px;
    }

    .form-group {
      margin-bottom: 14px;
    }

    .form-group label {
      display: block;
      margin-bottom: 6px;
      font-weight: 600;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
      width: 100%;
      box-sizing: border-box;
      border: 1px solid #d1d5db;
      border-radius: 12px;
      padding: 10px 12px;
      font-size: 14px;
      background: #fff;
    }

    .form-group textarea {
      min-height: 100px;
      resize: vertical;
    }

    .select-row {
      display: flex;
      gap: 8px;
      align-items: stretch;
    }

    .select-row select {
      flex: 1;
    }

    .form-actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }

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

    .stat-card {
      border-radius: 16px;
      padding: 16px;
      color: #fff;
      border: none;
    }

    .stat-card-1 {
      background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    }

    .stat-card-2 {
      background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
    }

    .stat-card-3 {
      background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    }

    .stat-card-4 {
      background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    }

    .stat-card-label {
      font-size: 13px;
      color: rgba(255,255,255,0.88);
      margin-bottom: 8px;
      font-weight: 700;
    }

    .stat-card-value {
      font-size: 28px;
      font-weight: 800;
      color: #fff;
    }

    .proposal-layout {
      display: grid;
      grid-template-columns: 1.05fr 0.95fr;
      gap: 20px;
      align-items: start;
    }

    .proposal-form-card,
    .proposal-list-card {
      background: #fafafa;
      border: 1px solid #ececec;
      border-radius: 16px;
      padding: 18px;
    }

    .proposal-list {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .proposal-item {
      background: #fff;
      border: 1px solid #e5e7eb;
      border-radius: 16px;
      padding: 16px;
    }

    .proposal-item-head {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 12px;
      margin-bottom: 12px;
    }

    .proposal-item-title-wrap {
      flex: 1;
    }

    .proposal-item-title {
      font-size: 18px;
      font-weight: 800;
      line-height: 1.5;
      color: #1f2937;
      margin-bottom: 6px;
    }

    .proposal-item-deadline {
      font-size: 13px;
      color: #6b7280;
    }

    .proposal-item-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 10px 16px;
      margin-bottom: 14px;
    }

    .proposal-field {
      background: #f9fafb;
      border-radius: 12px;
      padding: 10px 12px;
    }

    .proposal-field-label {
      font-size: 12px;
      color: #6b7280;
      margin-bottom: 4px;
      font-weight: 700;
    }

    .proposal-field-value {
      font-size: 14px;
      color: #111827;
      font-weight: 700;
      line-height: 1.5;
      word-break: break-word;
    }

    .proposal-badge-row {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin-bottom: 14px;
    }

    .proposal-badge {
      display: inline-flex;
      align-items: center;
      padding: 6px 10px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 700;
    }

    .proposal-badge.submitted-yes {
      background: #dcfce7;
      color: #15803d;
    }

    .proposal-badge.submitted-no {
      background: #fee2e2;
      color: #b91c1c;
    }

    .proposal-badge.submitted-discuss {
      background: #fef3c7;
      color: #b45309;
    }

    .proposal-badge.awarded-yes {
      background: #dbeafe;
      color: #1d4ed8;
    }

    .proposal-badge.awarded-no {
      background: #f3f4f6;
      color: #4b5563;
    }

    .proposal-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      align-items: center;
    }

    .modal-mask {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.45);
      z-index: 9999;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }

    .modal-mask.show {
      display: flex;
    }

    .modal-card {
      width: 100%;
      max-width: 440px;
      background: #fff;
      border-radius: 22px;
      box-shadow: 0 20px 60px rgba(0,0,0,0.18);
      overflow: hidden;
      animation: popupIn 0.18s ease-out;
    }

    @keyframes popupIn {
      from {
        transform: translateY(8px) scale(0.98);
        opacity: 0;
      }
      to {
        transform: translateY(0) scale(1);
        opacity: 1;
      }
    }

    .modal-header {
      padding: 20px 22px 12px 22px;
      background: linear-gradient(135deg, #f5f3ff 0%, #ffffff 100%);
      border-bottom: 1px solid #f1f5f9;
    }

    .modal-title {
      margin: 0;
      font-size: 22px;
      font-weight: 800;
      color: #3b2a67;
    }

    .modal-subtitle {
      margin-top: 6px;
      font-size: 13px;
      color: #667085;
      line-height: 1.6;
    }

    .modal-body {
      padding: 20px 22px 10px 22px;
    }

    .modal-actions {
      display: flex;
      justify-content: flex-end;
      gap: 10px;
      padding: 10px 22px 22px 22px;
    }

    .color-preview-wrap {
      display: flex;
      gap: 10px;
      align-items: center;
      margin-top: 10px;
    }

    .color-preview {
      min-width: 120px;
      text-align: center;
      padding: 10px 12px;
      border-radius: 999px;
      font-size: 13px;
      font-weight: 700;
      border: 1px solid rgba(0,0,0,0.06);
    }

    .helper-text {
      font-size: 12px;
      color: #6b7280;
      margin-top: 6px;
    }

    /* ===== 視覺化通知 toast ===== */
    .toast-wrap {
      position: fixed;
      top: 20px;
      right: 20px;
      z-index: 20000;
      display: flex;
      flex-direction: column;
      gap: 12px;
      pointer-events: none;
    }

    .toast {
      min-width: 260px;
      max-width: 360px;
      background: #ffffff;
      border-radius: 16px;
      box-shadow: 0 14px 40px rgba(15, 23, 42, 0.18);
      border: 1px solid #ececec;
      padding: 14px 16px;
      display: flex;
      align-items: flex-start;
      gap: 12px;
      pointer-events: auto;
      animation: toastIn 0.22s ease-out;
    }

    .toast-success {
      border-left: 5px solid #22c55e;
    }

    .toast-error {
      border-left: 5px solid #ef4444;
    }

    .toast-info {
      border-left: 5px solid #A66CFF;
    }

    .toast-icon {
      width: 34px;
      height: 34px;
      border-radius: 999px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 800;
      font-size: 16px;
      flex-shrink: 0;
    }

    .toast-success .toast-icon {
      background: #dcfce7;
      color: #15803d;
    }

    .toast-error .toast-icon {
      background: #fee2e2;
      color: #b91c1c;
    }

    .toast-info .toast-icon {
      background: #f3e8ff;
      color: #7c3aed;
    }

    .toast-content {
      flex: 1;
    }

    .toast-title {
      font-size: 14px;
      font-weight: 800;
      margin-bottom: 4px;
      color: #111827;
    }

    .toast-message {
      font-size: 13px;
      line-height: 1.6;
      color: #4b5563;
    }

    .toast-close {
      border: none;
      background: transparent;
      color: #9ca3af;
      cursor: pointer;
      font-size: 18px;
      line-height: 1;
      padding: 0;
    }

    @keyframes toastIn {
      from {
        opacity: 0;
        transform: translateY(-8px) translateX(8px);
      }
      to {
        opacity: 1;
        transform: translateY(0) translateX(0);
      }
    }

    /* ===== 視覺化確認視窗 ===== */
    .confirm-mask {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.45);
      z-index: 21000;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }

    .confirm-mask.show {
      display: flex;
    }

    .confirm-card {
      width: 100%;
      max-width: 420px;
      background: #fff;
      border-radius: 22px;
      box-shadow: 0 20px 60px rgba(0,0,0,0.2);
      overflow: hidden;
      animation: popupIn 0.18s ease-out;
    }

    .confirm-header {
      padding: 22px 22px 10px 22px;
    }

    .confirm-title {
      font-size: 22px;
      font-weight: 800;
      color: #1f2937;
      margin: 0;
    }

    .confirm-body {
      padding: 0 22px 10px 22px;
      font-size: 14px;
      color: #4b5563;
      line-height: 1.8;
    }

    .confirm-actions {
      display: flex;
      justify-content: flex-end;
      gap: 10px;
      padding: 16px 22px 22px 22px;
    }

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

      .day-cell {
        min-height: 110px;
      }

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

    @media (max-width: 640px) {
      .wrapper {
        padding: 14px;
      }

      .calendar-grid {
        gap: 6px;
      }

      .day-cell {
        min-height: 88px;
        padding: 8px;
      }

      .event-item {
        font-size: 11px;
      }

      .calendar-title {
        font-size: 20px;
      }

      .header h1 {
        font-size: 24px;
      }

      .select-row {
        flex-direction: column;
      }

      .modal-card,
      .confirm-card {
        max-width: 100%;
      }

      .stats-grid,
      .proposal-item-grid {
        grid-template-columns: 1fr;
      }

      .toast-wrap {
        top: 14px;
        right: 14px;
        left: 14px;
      }

      .toast {
        max-width: none;
        min-width: 0;
        width: auto;
      }
    }
    .proposal-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.proposal-summary-left {
  flex: 1;
  min-width: 0;
}

.proposal-detail-wrap {
  display: none;
  margin-top: 10px;
}

.proposal-detail-wrap.show {
  display: block;
}

.proposal-toggle-btn {
  background: #f3e8ff;
  color: #6d28d9;
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.proposal-toggle-btn:hover {
  opacity: 0.92;
}
.project-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.project-summary-left {
  flex: 1;
  min-width: 0;
}

.project-detail-wrap {
  display: none;
  margin-top: 10px;
}

.project-detail-wrap.show {
  display: block;
}

.project-toggle-btn {
  background: #f3e8ff;
  color: #6d28d9;
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.project-toggle-btn:hover {
  opacity: 0.92;
}

.task-panel {
  margin-top: 20px;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 16px;
  padding: 18px;
}

.task-panel.hidden {
  display: none;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.task-item {
  border: 1px solid #e5e7eb;
  background: #fafafa;
  border-radius: 14px;
  padding: 14px;
}

.task-item-title {
  font-size: 16px;
  font-weight: 800;
  color: #1f2937;
  margin-bottom: 6px;
}

.task-item-meta {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.7;
}

.task-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 640px) {
  .task-form-grid {
    grid-template-columns: 1fr;
  }
}
.task-inline {
  margin-top: 12px;
  padding: 14px;
  background: #fafafa;
  border-radius: 12px;
  border: 1px solid #eee;
}

.task-inline.hidden {
  display: none;
}
.task-inline {
  margin-top: 14px;
  padding: 18px;
  background: #fafafa;
  border: 1px solid #ececec;
  border-radius: 18px;
}

.task-inline.hidden {
  display: none;
}

.task-inline-title {
  font-size: 18px;
  font-weight: 800;
  color: #1f2937;
  margin-bottom: 14px;
}

.task-inline .task-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.task-inline .task-form-grid input,
.task-inline .task-form-grid select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  background: #fff;
}

.task-inline .form-actions {
  margin-bottom: 14px;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-item {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 14px 16px;
}

.task-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.task-item-title {
  font-size: 16px;
  font-weight: 800;
  color: #1f2937;
  line-height: 1.5;
}

.task-item-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.task-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.task-badge-owner {
  background: #eef2ff;
  color: #4338ca;
}

.task-badge-progress {
  background: #f3e8ff;
  color: #7c3aed;
}

.task-item-remark {
  font-size: 14px;
  color: #4b5563;
  line-height: 1.7;
  margin-bottom: 12px;
  white-space: pre-wrap;
}

.task-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.task-empty {
  color: #6b7280;
  padding: 10px 0;
}

@media (max-width: 640px) {
  .task-inline .task-form-grid {
    grid-template-columns: 1fr;
  }

  .task-item-top {
    flex-direction: column;
  }
}
.task-inline-title {
  margin-bottom: 14px;
}

.task-list {
  margin-bottom: 16px;
}
textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  resize: vertical;
}
.project-filter-card {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.project-filter-card:hover {
  transform: translateY(-2px);
}

.project-filter-card.active {
  outline: 3px solid rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.stat-card-sub {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 4px;
}
.proposal-filter-card {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.proposal-filter-card:hover {
  transform: translateY(-2px);
}

.proposal-filter-card.active {
  outline: 3px solid rgba(0,0,0,0.12);
  transform: translateY(-2px);
}
.year-group {
  margin-bottom: 20px;
}

.year-header {
  font-weight: bold;
  font-size: 18px;
  padding: 10px 12px;
  background: #f3f4f6;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 10px;
}

.year-content.hidden {
  display: none;
}
.year-group {
  margin-bottom: 20px;
}

.year-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #f3f4f6;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 10px;
  font-weight: 700;
}

.year-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.year-toggle-icon {
  font-size: 16px;
  line-height: 1;
}

.year-count {
  font-size: 13px;
  color: #6b7280;
}

.year-content.hidden {
  display: none;
}

    .login-overlay {
      position: fixed;
      inset: 0;
      background: #f6f7fb;
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 9999;
    }

    .login-overlay.hidden {
      display: none;
    }

    .login-card {
      background: #fff;
      border-radius: 20px;
      padding: 40px 36px;
      box-shadow: 0 8px 32px rgba(0,0,0,0.12);
      width: 100%;
      max-width: 380px;
      text-align: center;
    }

    .login-card h2 {
      margin: 0 0 8px 0;
      font-size: 24px;
      font-weight: 800;
      color: #2f2f2f;
    }

    .login-card p {
      margin: 0 0 24px 0;
      font-size: 14px;
      color: #888;
    }

    .login-card input[type="password"] {
      width: 100%;
      padding: 12px 16px;
      border: 2px solid #ece7ff;
      border-radius: 12px;
      font-size: 16px;
      outline: none;
      box-sizing: border-box;
      transition: border-color 0.2s;
    }

    .login-card input[type="password"]:focus {
      border-color: #A66CFF;
    }

    .login-card .btn-login {
      width: 100%;
      margin-top: 16px;
      padding: 12px;
      background: #A66CFF;
      color: #fff;
      border: none;
      border-radius: 12px;
      font-size: 16px;
      font-weight: 700;
      cursor: pointer;
      transition: opacity 0.2s;
    }

    .login-card .btn-login:hover {
      opacity: 0.88;
    }

    .login-error {
      margin-top: 12px;
      color: #e53e3e;
      font-size: 13px;
      min-height: 18px;
    }

    /* 公文發函 */
    .letter-layout {
      display: grid;
      grid-template-columns: 360px 1fr;
      gap: 20px;
      align-items: start;
    }

    @media (max-width: 900px) {
      .letter-layout { grid-template-columns: 1fr; }
    }

    .letter-form-panel,
    .letter-preview-panel {
      background: #fff;
      border-radius: 18px;
      padding: 22px;
      box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    }

    .letter-preview-panel {
      position: sticky;
      top: 20px;
    }

    .letter-preview-panel > h3 {
      margin: 0 0 12px 0;
      font-size: 16px;
      font-weight: 700;
    }

    .letter-actions {
      display: flex;
      gap: 10px;
      margin-bottom: 14px;
      flex-wrap: wrap;
    }

    .letter-doc {
      font-family: "Kaiti TC", "BiauKai", "標楷體", "DFKai-SB", "Noto Serif TC", serif;
      font-size: 15px;
      line-height: 2;
      color: #111;
      background: #fff;
      border: 1px solid #ccc;
      padding: 36px 44px 44px;
      min-height: 640px;
      box-shadow: 0 2px 10px rgba(0,0,0,0.09);
    }

    .letter-doc .doc-meta-right {
      text-align: right;
      font-size: 13px;
      line-height: 1.8;
      margin-bottom: 2px;
    }

    .letter-doc .doc-title-row {
      display: flex;
      justify-content: center;
      align-items: baseline;
      gap: 14px;
      margin: 10px 0 2px;
    }

    .letter-doc .doc-company {
      font-size: 23px;
      font-weight: 700;
      letter-spacing: 5px;
    }

    .letter-doc .doc-doc-type {
      font-size: 23px;
      font-weight: 700;
      letter-spacing: 0;
    }

    .letter-doc .doc-info-right {
      text-align: right;
      font-size: 13px;
      line-height: 1.9;
      margin-bottom: 10px;
    }

    .letter-doc hr.doc-sep {
      border: none;
      border-top: 1.5px solid #222;
      margin: 2px 0 8px;
    }

    .letter-doc .doc-field-row {
      display: flex;
      align-items: baseline;
      line-height: 1.95;
      margin-bottom: 0;
    }

    .letter-doc .doc-field-label {
      white-space: nowrap;
      min-width: 8.5em;
      flex-shrink: 0;
    }

    .letter-doc .doc-body {
      margin-top: 22px;
    }

    .letter-doc .doc-body-row {
      display: flex;
      align-items: flex-start;
      line-height: 2;
      margin-bottom: 14px;
    }

    .letter-doc .doc-body-label {
      white-space: nowrap;
      flex-shrink: 0;
      min-width: 3.5em;
    }

    .letter-doc .doc-body-content {
      flex: 1;
      word-break: break-all;
    }

    .letter-doc .doc-bottom {
      margin-top: 32px;
      padding-top: 6px;
      border-top: 1.5px solid #222;
    }

    .letter-doc .doc-stamp-area {
      margin-top: 20px;
      text-align: right;
      color: #ccc;
      font-size: 12px;
      font-style: italic;
    }

    .letter-records-section {
      margin-top: 20px;
      background: #fff;
      border-radius: 18px;
      padding: 22px;
      box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    }

    .letter-record-item {
      display: flex;
      gap: 12px;
      align-items: flex-start;
      padding: 12px 0;
      border-bottom: 1px solid #f3f3f3;
    }

    .letter-record-item:last-child { border-bottom: none; }

    .letter-record-num {
      font-size: 11px;
      color: #A66CFF;
      font-weight: 700;
      white-space: nowrap;
      max-width: 180px;
    }

    .letter-record-info { flex: 1; }

    .letter-record-recipient {
      font-weight: 600;
      font-size: 14px;
    }

    .letter-record-subject {
      font-size: 13px;
      color: #666;
      margin-top: 2px;
    }

    .letter-record-date {
      font-size: 12px;
      color: #999;
      white-space: nowrap;
    }

    /* 支出 */
    .expense-record-layout {
      display: grid;
      grid-template-columns: 360px 1fr;
      gap: 20px;
      align-items: start;
    }

    @media (max-width: 900px) {
      .expense-record-layout { grid-template-columns: 1fr; }
    }

    .expense-record-form-panel {
      position: sticky;
      top: 20px;
    }

    #erTransportFields {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }

    .expense-record-stats-panel {
      background: #fff;
      border-radius: 18px;
      padding: 22px;
      box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    }

    .expense-record-filters {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      margin-bottom: 18px;
    }

    .expense-record-filters select,
    .expense-record-filters input {
      padding: 10px 12px;
      border: 1px solid #ddd;
      border-radius: 10px;
      font-size: 14px;
    }

    .er-table-wrap {
      border-radius: 12px;
      overflow: hidden;
      border: 1px solid #e5e5e5;
      margin-bottom: 24px;
    }

    .er-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 14px;
    }

    .er-table thead tr.er-title-row th {
      background: #1a1a1a;
      color: #fff;
      font-size: 17px;
      font-weight: 800;
      padding: 12px 16px;
      text-align: left;
    }

    .er-table thead tr.er-title-row th.er-total-label {
      background: #c0392b;
      text-align: center;
      width: 110px;
    }

    .er-table thead tr.er-total-row th.er-total-value {
      background: #c0392b;
      color: #fff;
      font-size: 18px;
      font-weight: 800;
      text-align: center;
    }

    .er-table thead tr.er-col-head th {
      background: #9a9a9a;
      color: #fff;
      font-weight: 700;
      padding: 8px 10px;
      text-align: center;
      font-size: 13px;
    }

    .er-table tbody td {
      border: 1px solid #eee;
      padding: 8px 10px;
      text-align: center;
      vertical-align: middle;
    }

    .er-table tbody td.er-col-item { text-align: left; }
    .er-table tbody td.er-col-remark { text-align: left; color: #555; }
    .er-table tbody tr:nth-child(even) { background: #fafafa; }

    .er-row-actions {
      display: flex;
      gap: 6px;
      justify-content: center;
    }

    .er-row-actions .btn {
      padding: 4px 10px;
      font-size: 12px;
      border-radius: 8px;
    }

    .er-empty {
      color: #999;
      font-size: 14px;
      padding: 20px;
      text-align: center;
    }

    .er-attachment-link {
      color: #A66CFF;
      font-weight: 600;
      text-decoration: none;
    }

    .er-attachment-link:hover { text-decoration: underline; }
