:root {
  --brand: #1f4e79;
  --brand-2: #2e6da4;
  --brand-accent: #c9a227;
}

body {
  font-family: "PingFang TC", "PingFang SC", "Microsoft JhengHei", "Microsoft YaHei",
    "Noto Sans CJK TC", "Noto Sans CJK SC", "Hiragino Sans GB", system-ui, -apple-system,
    "Segoe UI", Roboto, sans-serif;
}

.app-navbar {
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 100%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.brand-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-accent);
  margin-right: 8px;
  vertical-align: middle;
}

.app-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
}

/* Auth cards */
.auth-wrap {
  max-width: 440px;
  margin: 3vh auto;
}
.auth-card {
  border: none;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(31, 78, 121, 0.12);
}
.auth-card .card-body {
  padding: 2rem;
}
.auth-title {
  color: var(--brand);
  font-weight: 700;
}
.btn-toggle-password {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
}

/* Category cards */
.category-card {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  height: 100%;
  text-decoration: none;
  color: inherit;
  display: block;
}
.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(31, 78, 121, 0.15);
  border-color: var(--brand-2);
}
.category-icon {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: rgba(46, 109, 164, 0.1);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

/* Dynamic form list groups */
.item-group {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 1rem 1rem 0.25rem;
  margin-bottom: 1rem;
  background: #fff;
  position: relative;
}
.item-group .item-index {
  position: absolute;
  top: -12px;
  left: 14px;
  background: var(--brand);
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: 10px;
}
.section-card {
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  margin-bottom: 1.25rem;
}
.section-card .card-header {
  background: #fff;
  border-bottom: 2px solid rgba(46, 109, 164, 0.15);
  font-weight: 600;
  color: var(--brand);
  border-radius: 14px 14px 0 0;
}

/* Preview */
.preview-doc {
  margin-bottom: 2rem;
}
.preview-doc h5 {
  color: var(--brand);
  border-left: 4px solid var(--brand-accent);
  padding-left: 10px;
}
.preview-page-img {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  margin-bottom: 1rem;
  background: #fff;
}
.preview-text {
  white-space: pre-wrap;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  padding: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.9;
}

.btn-brand {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-brand:hover {
  background: var(--brand-2);
  border-color: var(--brand-2);
  color: #fff;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(4px);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding: 0.75rem 0;
  z-index: 10;
}

/* Keep link-style buttons vertically centered when sized like btn-lg */
.sticky-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* History action buttons: uniform size / centered label */
.history-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.25rem;
  font-size: 0.875rem;
  line-height: 1.2;
}

.sample-json-pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f8f9fa;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  max-height: none;
}

@media (max-width: 576px) {
  .auth-card .card-body {
    padding: 1.5rem;
  }
}
