/* 录入页 / 欢迎页样式（与 index.css 视觉语言一致） */

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans SC', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
html.lang-ja body {
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
}

/* ── 金色主按钮（对齐首页 CTA）────────────────────────── */
.btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 13px 30px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.2px;
  box-shadow: 0 5px 20px rgba(232, 168, 56, 0.45);
  transition: background 0.22s, box-shadow 0.22s, transform 0.2s;
}
.btn-accent:hover {
  background: #d4962e;
  box-shadow: 0 8px 28px rgba(232, 168, 56, 0.52);
  transform: translateY(-1px);
}
.btn-accent:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── 欢迎页 ───────────────────────────────────────────── */
.welcome-page {
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px 48px;
  position: relative;
  box-sizing: border-box;
}
.welcome-page::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(26, 61, 107, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 80% 20%, rgba(232, 168, 56, 0.1) 0%, transparent 60%);
}

.welcome-cols {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
  width: 100%;
  max-width: 1080px;
}

.welcome-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #e8f0fb;
  border: 1px solid rgba(26, 61, 107, 0.14);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--primary);
  margin-bottom: 18px;
  text-transform: uppercase;
}
.welcome-hero h1,
.welcome-card-title {
  font-size: 28px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.6px;
  line-height: 1.3;
  margin: 0 0 28px;
  min-height: calc(1.3em * 2);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.welcome-hero h1 em,
.welcome-card-title em {
  font-style: normal;
  color: var(--primary);
}
.welcome-hero-sub {
  font-size: 15px;
  color: var(--text2);
  line-height: 1.75;
  margin: 0;
  max-width: 480px;
  margin-inline: auto;
}

.welcome-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  min-width: 0;
  padding: 36px 40px 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  transition: box-shadow 0.25s, border-color 0.25s;
}
.welcome-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(26, 61, 107, 0.18);
}
.welcome-intro {
  color: var(--text2);
  font-size: 14.5px;
  line-height: 1.75;
  margin: 0 0 28px;
}

.welcome-steps {
  text-align: left;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.welcome-card .welcome-steps:last-child {
  margin-bottom: 0;
}
.welcome-steps li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background 0.18s;
}
.welcome-steps li:hover {
  background: #e8f0fb;
  border-color: rgba(26, 61, 107, 0.12);
}
.welcome-step-num {
  min-width: 36px;
  width: auto;
  height: 36px;
  padding: 0 10px;
  box-sizing: border-box;
  flex-shrink: 0;
  background: var(--primary);
  color: #fff;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(26, 61, 107, 0.28);
}
.welcome-step-text {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
}

.welcome-privacy {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  color: var(--green);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  background: var(--green-bg);
  border: 1px solid rgba(29, 138, 78, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 0 0 28px;
}

/* ── 录入页 ───────────────────────────────────────────── */
.form-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
.form-page--wide {
  max-width: 1200px;
  height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 20px 24px 16px;
  box-sizing: border-box;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    ". head"
    "form panel";
  column-gap: 24px;
  row-gap: 10px;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}
.two-col > .tpl-panel-head {
  grid-area: head;
  align-self: end;
}
.two-col > .client-form {
  grid-area: form;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.two-col > .tpl-aside {
  grid-area: panel;
}
@media (max-width: 900px) {
  .form-page--wide {
    height: auto;
    overflow: visible;
    padding: 24px 24px 64px;
  }
  .two-col {
    flex: none;
    min-height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "form"
      "head"
      "panel";
    row-gap: 10px;
  }
  .two-col > .client-form {
    overflow: visible;
  }
  .form-fields {
    overflow-y: visible;
  }
  .form-section,
  .client-form fieldset {
    flex: none;
    overflow: visible;
    min-height: auto;
  }
  .welcome-hero h1,
  .welcome-card-title {
    font-size: 22px;
  }
  .welcome-cols {
    grid-template-columns: 1fr;
    max-width: 560px;
  }
}

.form-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-shrink: 0;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.form-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--primary);
  text-transform: uppercase;
  background: #e8f0fb;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 8px;
}
.form-header h1 {
  font-size: 24px;
  font-weight: 900;
  margin: 0;
  color: var(--text);
  letter-spacing: -0.5px;
}

.client-form {
  margin: 0;
  --checkbox-text-indent: 26px; /* 16px checkbox + 10px gap */
}

/* 区块标题 + 彩色徽章 */
.form-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 0;
}
.form-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 10px;
  line-height: 1.4;
}
.section-badge {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  color: var(--primary);
}
.section-badge--blue {
  background: #e8f0fb;
}
.section-badge--amber {
  background: #fef4e2;
  color: #b45309;
}
.section-badge--green {
  background: #e6f7ee;
  color: var(--green);
}
.section-badge--purple {
  background: #ede9fe;
  color: #6d28d9;
}

.client-form fieldset {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
  margin: 0;
  min-width: 0;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.22s, border-color 0.22s;
}
.form-section--blue fieldset {
  border-top: 3px solid var(--blue);
}
.form-section--amber fieldset {
  border-top: 3px solid var(--accent);
}
.form-section--green fieldset {
  border-top: 3px solid var(--green);
}
.client-form fieldset:hover {
  box-shadow: var(--shadow);
  border-color: rgba(26, 61, 107, 0.15);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.form-field:last-child {
  margin-bottom: 0;
}
.form-field--check {
  gap: 6px;
}

.form-label {
  font-size: 15px;
  color: var(--text);
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: -4px;
}
.required-mark {
  color: var(--red);
  margin-left: 2px;
}

.field-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--text2);
  line-height: 1.45;
  margin: 0 0 2px;
}
.field-hint--check {
  margin: 0 0 0 var(--checkbox-text-indent, 26px);
}

.form-field--check-sub {
  margin-left: var(--checkbox-text-indent, 26px);
}

.form-input,
.form-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input--color {
  padding: 4px;
  height: 40px;
  width: 72px;
}
.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary-l);
  box-shadow: 0 0 0 3px rgba(44, 95, 138, 0.12);
}

.bool-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  padding: 6px 8px;
  margin: -6px -8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.bool-field:hover {
  background: var(--surface2);
}
.bool-field input {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--primary);
}
.bool-label {
  line-height: 1.5;
}

.form-actions {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.form-actions .btn-accent {
  width: 100%;
}

.form-error {
  color: var(--red);
  font-size: 14px;
  margin: 12px 0 0;
  flex-shrink: 0;
}

.form-fields {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ── 右栏：适用清单面板 ───────────────────────────────── */
.tpl-aside {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  overflow: hidden;
}
.tpl-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin: 0;
  min-height: 28px;
}
.tpl-panel-head .form-section-title {
  margin: 0;
}
.tpl-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid #8b5cf6;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  transition: box-shadow 0.22s;
}
.tpl-panel:hover {
  box-shadow: var(--shadow);
}
@media (max-width: 900px) {
  .tpl-aside {
    min-height: auto;
    overflow: visible;
  }
  .tpl-panel {
    flex: none;
    min-height: auto;
    max-height: none;
    overflow: visible;
  }
  .tpl-list {
    overflow-y: visible;
    max-height: none;
  }
}
.tpl-count {
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 12px;
  box-shadow: 0 2px 8px rgba(26, 61, 107, 0.25);
}
.tpl-placeholder {
  color: var(--text2);
  font-size: 14px;
  line-height: 1.7;
  margin: 12px 0;
}
.tpl-stale {
  color: var(--red);
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 12px;
  background: rgba(201, 43, 43, 0.06);
  border: 1px solid rgba(201, 43, 43, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.tpl-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1;
  min-height: 0;
}
.tpl-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.tpl-item:hover {
  background: var(--surface2);
}
.tpl-item:last-child {
  border-bottom: none;
}
.tpl-enabled {
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--primary);
}
.tpl-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tpl-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.tpl-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tpl-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: #e8f0fb;
  border: 1px solid rgba(26, 61, 107, 0.12);
  border-radius: 12px;
  padding: 2px 8px;
}
.tpl-badge--law {
  color: var(--red);
  background: rgba(201, 43, 43, 0.08);
  border-color: rgba(201, 43, 43, 0.25);
}
.tpl-work {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.tpl-workdays {
  width: 56px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
}
.tpl-workdays:focus {
  outline: none;
  border-color: var(--primary-l);
}
.tpl-work-unit {
  font-size: 12px;
  color: var(--text2);
}

.tpl-foot {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.tpl-foot .btn-accent {
  width: 100%;
}
