:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --primary: #1697b7;
  --primary-dark: #0f7f9a;
  --accent: #d59b31;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #d8e3ea;
  --danger: #d93025;
  --success: #0f9d58;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Microsoft JhengHei", "Noto Sans TC", Arial, sans-serif;
  background: linear-gradient(180deg, #eef3f8 0%, #f7f9fc 100%);
  color: var(--text);
  font-size: 17px;
}

body {
  min-height: 100vh;
}

a {
  text-decoration: none;
}

.page-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 16px 100px;
}

.hero {
  background: linear-gradient(135deg, #ffffff 0%, #f5fbff 100%);
  border-radius: 24px;
  box-shadow: var(--shadow);
  border: 1px solid #e6edf3;
  overflow: hidden;
  margin-bottom: 24px;
  position: relative;
}

.hero::before {
  content: "";
  display: block;
  height: 6px;
  background: linear-gradient(90deg, #e4b34c, #f1cf80);
}

.hero-inner {
  padding: 36px 28px 30px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 999px;
  background: #eef8fc;
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
}

.hero-title {
  margin: 0;
  font-size: 44px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 1px;
  color: #1c2b4d;
}

.hero-line {
  width: 88px;
  height: 5px;
  margin: 16px auto;
  border-radius: 999px;
  background: linear-gradient(90deg, #dba54a, #f0cf87);
}

.hero-desc {
  margin: 0 auto;
  max-width: 900px;
  color: #374151;
  font-size: 17px;
  line-height: 1.9;
}

.hero-actions {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.main {
  min-width: 0;
}

.side {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.side-card {
  background: var(--card);
  border: 1px solid #e6edf3;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px;
}

.side-card h3 {
  margin: 0 0 14px;
  font-size: 20px;
  color: #1f2e4f;
}

.side-list {
  padding-left: 20px;
  margin: 0;
  color: var(--muted);
  line-height: 1.9;
  font-size: 15px;
}

.progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #edf3f7;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #19a4c8, #1585a4);
  transition: width 0.25s ease;
}

.progress-text {
  font-size: 15px;
  color: var(--muted);
  margin: 0;
}

.section {
  background: var(--card);
  border: 1px solid #e6edf3;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-bottom: 22px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.section-no {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
}

.section-title {
  margin: 0;
  font-size: 28px;
  color: #1c2b4d;
  font-weight: 800;
}

.section-desc {
  width: 100%;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.divider-line {
  flex: 1;
  min-width: 60px;
  height: 2px;
  background: linear-gradient(90deg, #f2cf87 0%, rgba(242, 207, 135, 0.1) 100%);
  border-radius: 999px;
}

/* Buttons */
.btn {
  min-width: 148px;
  min-height: 48px;
  border-radius: 999px;
  border: none;
  padding: 0 22px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #19a4c8 0%, #157f9e 100%);
  color: #fff;
  box-shadow: 0 10px 20px rgba(21, 127, 158, 0.24);
}

.btn-secondary {
  background: #eef7fb;
  color: var(--primary-dark);
  border: 1px solid #d4e8ef;
}

.btn-light {
  background: #fff;
  color: #374151;
  border: 1px solid #d9e3ea;
}

/* Form page */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.label {
  font-size: 15px;
  font-weight: 800;
  color: #374151;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  line-height: 1.6;
}

.required {
  color: var(--danger);
  font-weight: 900;
}

.input,
.select,
.textarea,
.file-input {
  width: 100%;
  min-height: 48px;
  border: 1.5px solid #b9d7e0;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  padding: 12px 15px;
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  outline: none;
}

.textarea {
  min-height: 130px;
  resize: vertical;
  line-height: 1.7;
}

.input:focus,
.select:focus,
.textarea:focus,
.file-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(22, 151, 183, 0.12);
}

.row-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr) 34px;
  gap: 10px;
  align-items: end;
}

.unit {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.option-group {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  min-height: 48px;
  align-items: center;
  padding: 6px 0;
}

.option-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: #374151;
  cursor: pointer;
}

.option-item input {
  accent-color: var(--primary);
  transform: translateY(1px);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
}

.status-card {
  border: 1px solid #e6edf3;
  border-radius: 14px;
  padding: 18px;
  background: #fbfdff;
}

.status-card h4 {
  margin: 0 0 12px;
  font-size: 18px;
  color: #1f2e4f;
}

.upload-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.upload-item {
  border: 1px solid #e6edf3;
  border-radius: 14px;
  padding: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
}

.upload-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.upload-title {
  font-size: 16px;
  font-weight: 800;
  color: #374151;
  margin: 0;
  line-height: 1.7;
}

.upload-required {
  color: var(--danger);
  font-size: 14px;
  font-weight: 800;
}

.upload-optional {
  color: #64748b;
  font-size: 14px;
  font-weight: 700;
}

.upload-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.upload-note a,
.agreement-link,
.info-link,
.doc-link {
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px dashed rgba(15, 127, 154, 0.35);
}

.upload-note a:hover,
.agreement-link:hover,
.info-link:hover,
.doc-link:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.upload-files {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.upload-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.upload-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.btn-upload-add,
.btn-upload-remove {
  min-height: 42px;
  border-radius: 999px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
  border: none;
}

.btn-upload-add {
  background: #e8f7fb;
  color: var(--primary-dark);
  border: 1px solid #cfeaf1;
}

.btn-upload-add:hover {
  background: #dcf2f8;
}

.btn-upload-remove {
  background: #fff3f2;
  color: #c24134;
  border: 1px solid #f5d2ce;
}

.btn-upload-remove:hover {
  background: #ffe7e4;
}

.upload-count {
  font-size: 14px;
  color: var(--muted);
}

.agreement-box {
  margin-top: 24px;
  border: 1px solid #e6edf3;
  border-radius: 16px;
  background: #fbfdff;
  padding: 18px;
}

.agreement-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  line-height: 1.9;
  font-size: 16px;
  color: #374151;
}

.agreement-item + .agreement-item {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed #d9e5ec;
}

.agreement-item input[type="checkbox"] {
  margin-top: 5px;
  transform: scale(1.2);
  accent-color: var(--primary);
  flex: 0 0 auto;
}

.agreement-text {
  flex: 1;
  min-width: 0;
}

.agreement-sublist {
  margin-top: 8px;
  padding-left: 0;
}

.agreement-subitem {
  display: block;
  margin-top: 4px;
  color: #4b5563;
  line-height: 1.9;
}

.form-actions {
  /*position: sticky; */ /*取消浮動*/
  bottom: 14px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  padding: 14px 16px;
  border: 1px solid rgba(230, 237, 243, 0.9);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.actions-left,
.actions-right {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.msg {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  line-height: 1.8;
}

.footer-note {
  margin-top: 18px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  line-height: 1.8;
}

.info-block {
  margin-top: 22px;
  border: 1px solid #e6edf3;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  padding: 20px;
}

.info-block + .info-block {
  margin-top: 16px;
}

.info-title {
  margin: 0 0 10px;
  font-size: 19px;
  color: #1f2e4f;
  font-weight: 800;
}

.info-content {
  font-size: 15px;
  color: #4b5563;
  line-height: 1.95;
}

.invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 4px rgba(217, 48, 37, 0.1) !important;
  background: #fffafa;
}

.upload-group-invalid {
  border-color: #f0b7b2 !important;
  box-shadow: 0 0 0 4px rgba(217, 48, 37, 0.08) !important;
  background: #fffafa !important;
}

.agreement-invalid {
  border-color: #f0b7b2 !important;
  box-shadow: 0 0 0 4px rgba(217, 48, 37, 0.08) !important;
  background: #fffafa !important;
}

/* Entry page */
.hint-grid {
  display: grid;
  /* grid-template-columns: repeat(3, minmax(0, 1fr)); */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.hint-card {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid #e6edf3;
  border-radius: 16px;
  padding: 18px;
}

.hint-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: #1f2e4f;
}

.hint-card p {
  margin: 0;
  color: #4b5563;
  font-size: 15px;
  line-height: 1.85;
}

.doc-table-wrap {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid #e6edf3;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
  background: #fff;
}

.doc-table thead th {
  background: linear-gradient(180deg, #eff8fc 0%, #eaf4f9 100%);
  color: #1f2e4f;
  font-size: 16px;
  font-weight: 800;
  padding: 16px 14px;
  border-bottom: 1px solid #dbe8ef;
  text-align: left;
  line-height: 1.7;
}

.doc-table tbody td {
  padding: 16px 14px;
  border-bottom: 1px solid #edf3f6;
  vertical-align: top;
  font-size: 15px;
  line-height: 1.85;
  color: #374151;
}

.doc-table tbody tr:last-child td {
  border-bottom: none;
}

.doc-name {
  font-weight: 700;
  color: #1f2937;
}

.check-yes,
.check-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 38px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 17px;
}

.check-yes {
  background: #eaf8f0;
  color: var(--success);
}

.check-no {
  background: #f5f7fa;
  color: #9aa5b1;
}

.note-box {
  margin-top: 16px;
  border: 1px solid #e6edf3;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  padding: 18px;
  color: #4b5563;
  font-size: 15px;
  line-height: 1.9;
}

/** 兩區塊 */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

/** 一區塊 */
.entry-grid-1 {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 18px;
}

.entry-card {
  border: 1px solid #e6edf3;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  padding: 22px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.entry-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  background: #fff5df;
  color: #b67a10;
  font-size: 14px;
  font-weight: 800;
}

.entry-card h3 {
  margin: 0;
  font-size: 24px;
  color: #1c2b4d;
}

.entry-card p {
  margin: 0;
  color: #4b5563;
  font-size: 15px;
  line-height: 1.9;
  flex: 1;
}

.entry-list {
  margin: 0;
  padding-left: 18px;
  color: #4b5563;
  font-size: 15px;
  line-height: 1.9;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .side {
    position: static;
    order: -1;
  }
}

@media (max-width: 992px) {
  .hint-grid,
  .entry-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  html,
  body {
    font-size: 16px;
  }

  .page-shell {
    padding: 18px 12px 40px;
  }

  .hero-inner {
    padding: 28px 18px 24px;
  }

  .hero-title {
    font-size: 36px;
  }

  .hero-desc {
    font-size: 15px;
  }

  .section {
    padding: 18px;
  }

  .section-title {
    font-size: 22px;
  }

  .form-grid,
  .status-grid {
    grid-template-columns: 1fr;
  }

  .row-inline {
    grid-template-columns: 1fr;
  }

  .unit {
    justify-content: flex-start;
    min-height: auto;
    padding-left: 4px;
  }

  .upload-file-row {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .actions-left,
  .actions-right {
    width: 100%;
  }

  .actions-right .btn {
    width: 100%;
  }

  .agreement-item {
    font-size: 15px;
  }

  .doc-table {
    min-width: 720px;
  }
}

/*20260414kevin*/

/*.doc-table tbody td:nth-child(2) {
  text-align: center;
  vertical-align: middle;
}*/

/*
如果未來再多：
第四類
第五類
nth-child(4)
nth-child(5)
*/

/* 表頭置中 */
.doc-table thead th {
  text-align: center;
}

/* 第一欄（文件項目）維持靠左 */
.doc-table thead th:first-child,
.doc-table tbody td:first-child {
  text-align: left;
}

/* 第二欄（是否必備）全部置中 */
.doc-table thead th:nth-child(2),
.doc-table tbody td:nth-child(2) {
  text-align: center;
}

/* 第三欄（第二類）置中 ✅新增 */
.doc-table thead th:nth-child(3),
.doc-table tbody td:nth-child(3) {
  text-align: center;
}

/*表單下方送出/清除 按鈕*/

/* 浮動操作區 */
.form-actions {
  /*position: sticky;*//*取消浮動*/
  bottom: 14px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  padding: 14px 16px;
  border: 1px solid rgba(230, 237, 243, 0.9);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.actions-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.actions-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.actions-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.msg-warning {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: #d93025;
  font-weight: 700;
}

@media (max-width: 768px) {
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .actions-left,
  .actions-right,
  .actions-buttons {
    width: 100%;
  }

  .actions-right {
    align-items: stretch;
  }

  .actions-buttons {
    display: flex;
    flex-direction: column;
  }

  .actions-buttons .btn,
  .actions-left .btn {
    width: 100%;
  }

  /* 小螢幕排序 */
  .actions-buttons .btn-primary {
    order: 1;
  }

  .actions-buttons .btn-light {
    order: 2;
  }

  .actions-left .btn-secondary {
    order: 3;
  }

  .actions-left {
    order: 2;
  }

  .actions-right {
    order: 1;
  }
}