:root {
  color-scheme: light;
  font-family: "Noto Sans TC", "Segoe UI", sans-serif;
  background: #f4f5f2;
  color: #1d1f27;
  --brand-primary: #2f5c55;
  --brand-primary-dark: #264c46;
  --brand-muted: #eef1ed;
  --brand-surface: #f7f8f5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, #f3f4f4 0%, #f7f7f8 40%, #f1f2f5 100%);
}

.auth-container {
  max-width: 980px;
}

.auth-header {
  margin-bottom: 32px;
  color: #3b4f4b;
}

.auth-header-content {
  width: 100%;
  display: block;
}

.auth-header-text {
  position: relative;
  width: fit-content;
  margin: 0 auto;
  text-align: center;
}

.auth-logo {
  position: absolute;
  top: 50%;
  left: 0;
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
  transform: translate(calc(-100% - 12px), -50%);
}

.auth-brand {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--brand-primary);
  text-align: center;
}

.auth-subtitle {
  font-size: 18px;
  color: #5b6462;
}

.auth-panel {
  border-radius: 24px;
  background: #ffffff;
}

.auth-panel-title {
  font-size: 24px;
  font-weight: 700;
  color: #334542;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.auth-panel-subtitle {
  color: #6b7472;
  font-size: 16px;
}

.option-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 16px 20px;
  border-radius: 14px;
  border: 1px solid #d1d8d6;
  background: #ffffff;
  color: #32423f;
  text-align: left;
  cursor: pointer;
  font: inherit;
  appearance: none;
  outline: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 2px 10px rgba(28, 45, 41, 0.08);
}

.option-card--active {
  background: var(--brand-primary);
  border-color: var(--brand-primary-dark);
  color: #ffffff;
}

.option-card:hover,
.option-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--brand-primary-dark);
  background: var(--brand-primary);
  color: #ffffff;
}

.option-icon {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: rgba(47, 92, 85, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.option-card--active .option-icon {
  background: rgba(255, 255, 255, 0.18);
}

.option-card:hover .option-icon,
.option-card:focus-visible .option-icon {
  background: rgba(255, 255, 255, 0.18);
}

.option-icon svg {
  width: 34px;
  height: 34px;
  fill: currentColor;
  opacity: 0.85;
}

.option-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.option-title {
  font-size: 20px;
  font-weight: 700;
}

.option-desc {
  font-size: 14px;
  color: inherit;
  opacity: 0.8;
}

.auth-divider {
  height: 1px;
  background: #e2e6e4;
  margin: 24px 0;
}

.auth-footnote {
  font-size: 14px;
  color: #6b7472;
  text-align: center;
}

.auth-label {
  font-size: 15px;
  color: #4c5a57;
  font-weight: 600;
}

.auth-submit {
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 18px;
  font-weight: 600;
  background: linear-gradient(180deg, #3d6a62 0%, #2f5c55 55%, #274b45 100%);
  border-color: #274b45;
}

.auth-submit:hover,
.auth-submit:focus,
.auth-submit:active {
  background: linear-gradient(180deg, #3a645d 0%, #2b534c 60%, #23413c 100%);
  border-color: #23413c;
}

.auth-help {
  font-size: 14px;
  color: #5f6a68;
  text-align: center;
}


.main-body {
  padding: 24px;
  background: var(--brand-surface);
  overflow-x: hidden;
}

.layout-toggle .btn {
  min-width: 96px;
}

.parcel-rows .parcel-row {
  width: 100%;
}

.toggle-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.results-section {
  margin-top: 24px;
}

.hold-share {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border-radius: 999px;
  background: #f0f2fb;
  font-weight: 600;
}

.table-summary {
  background: var(--brand-muted);
}

.missing-row td {
  color: #dc3545;
  font-weight: 600;
}

.table-summary td {
  border-top: 2px solid #d7ded6;
}

.main-body .navbar {
  background: var(--brand-primary) !important;
  color: #ffffff;
}

.main-body .navbar h1,
.main-body .navbar .h4,
.main-body .navbar .h5 {
  color: #ffffff;
}

.main-body .navbar p {
  color: rgba(255, 255, 255, 0.78);
}

.search-panel {
  background: #ffffff;
}

.btn-primary {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: var(--brand-primary-dark);
  border-color: var(--brand-primary-dark);
}

.btn-outline-primary {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #ffffff;
}

.btn-outline-success {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.btn-outline-success:hover,
.btn-outline-success:focus,
.btn-outline-success:active {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #ffffff;
}

.btn-outline-secondary {
  color: var(--brand-primary);
  border-color: #c9d3c9;
  background-color: #ffffff;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active {
  background-color: #e3e9e2;
  border-color: #c9d3c9;
  color: var(--brand-primary-dark);
}

.form-check-input {
  accent-color: var(--brand-primary);
}

.form-check-input:checked {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.table thead.table-light th {
  background-color: var(--brand-primary);
  color: #ffffff;
  border-bottom: 0;
}

.table thead.table-light th + th {
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.table thead.table-light th,
.excel-paste-table th {
  background-color: var(--brand-primary);
  color: #ffffff;
  text-align: center;
}

.excel-paste-wrapper {
  border-color: var(--brand-primary);
}

.card + .card {
  margin-top: 16px;
}

.card-body {
  font-size: 23px;
}

.card-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  font-size: 13px;
}

.card-grid span {
  color: #4b4f5f;
}

.card-grid strong {
  display: block;
  margin-bottom: 4px;
  color: #8a90a0;
  font-weight: 500;
}

.hidden {
  display: none !important;
}

.results-table {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.results-table-image-wrapper {
  overflow: auto;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
}

.results-table-image-wrapper img {
  display: block;
  width: 100%;
  height: auto;
}

.results-table-image-wrapper.is-dragging {
  cursor: grabbing;
}

.results-table-render {
  position: fixed;
  top: -9999px;
  left: -9999px;
  width: 1500px;
  background: #ffffff;
  padding: 16px;
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.results-table table {
  width: 100%;
  min-width: 0;
}

.results-table table th,
.results-table table td,
.excel-paste-table th,
.excel-paste-table td {
  text-align: center;
}

.results-table.zoomable {
  --table-font-scale: 1;
  --table-responsive-scale: 1;
  --table-font-size: 0.875rem;
  --table-cell-padding-y: 0.5rem;
  --table-cell-padding-x: 0.75rem;
}

.results-table.zoomable table {
  font-size: 3px;
  );
}

.results-table.zoomable th,
.results-table.zoomable td {
  padding: 2px 0px;
}

.main-body.layout-mobile {
  padding: 16px;
}

.main-body.layout-mobile .results-table {
  max-height: 60vh;
}

.main-body.layout-mobile .results-table-image-wrapper {
  max-height: 60vh;
}

.main-body.layout-mobile.results-tab .results-table {
  max-height: none;
}

.main-body.layout-mobile.results-tab .results-table-image-wrapper {
  max-height: none;
}

.main-body.layout-mobile.results-tab .results-table {
  --table-column-count: 17;
}

.main-body.layout-mobile.results-tab .results-table table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.main-body.layout-mobile.results-tab .results-table th,
.main-body.layout-mobile.results-tab .results-table td {
  width: calc(100% / var(--table-column-count));
  min-width: 0;
  line-height: 1.2;
  word-break: break-word;
  white-space: normal;
}


.main-body.layout-desktop .results-table {
  max-height: none;
}

.excel-paste-panel {
  background: #ffffff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.results-table .col-id,
.results-table .col-urban-plan,
.results-table .col-year-value {
  width: 70px;
}

.results-table .col-share-area {
  width: 60px;
}

.layout-switch .btn {
  min-width: 96px;
}

.excel-paste-wrapper {
  border-radius: 16px;
  overflow: hidden;
}

.excel-paste-table th,
.excel-paste-table td {
  min-width: 96px;
}

.excel-paste-table td {
  cursor: text;
}

.excel-paste-table td[contenteditable="true"]:focus {
  outline: 2px solid rgba(13, 110, 253, 0.2);
  outline-offset: -2px;
}

@media (max-width: 900px) {
  .main-body {
    padding: 20px;
  }
}

@media (max-width: 720px) {
  .main-body {
    padding: 16px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
}
