/* ===== 农药经营许可证申请系统 - 全站样式 ===== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #1e7e34;
  --primary-dark: #155724;
  --primary-light: #d4edda;
  --secondary: #ffc107;
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --border: #d0d7de;
  --text: #1f2328;
  --text-muted: #57606a;
  --danger: #cf222e;
  --info: #0969da;
  --warning: #9a6700;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --radius: 8px;
  --radius-lg: 12px;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 15px;
}

/* ===== 顶部导航 ===== */
.site-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 18px 24px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.site-header h1 {
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-header h1::before {
  content: "🌾";
  font-size: 24px;
}

.site-header nav a {
  color: #fff;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 14px;
  transition: background 0.15s;
}

.site-header nav a:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ===== 主体容器 ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.page-title {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 12px;
}

.back-link:hover {
  color: var(--primary);
}

/* ===== 卡片 ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.card h2 {
  font-size: 18px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card h3 {
  font-size: 15px;
  margin: 16px 0 12px;
  color: var(--text);
  font-weight: 600;
}

/* ===== 表单字段 ===== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 20px;
}

.form-grid.cols-1 { grid-template-columns: 1fr; }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 768px) {
  .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.field label .required {
  color: var(--danger);
  font-weight: 700;
}

.field label .hint-btn {
  font-size: 12px;
  color: var(--info);
  background: transparent;
  border: 1px solid var(--info);
  padding: 2px 8px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: normal;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s;
}

.field label .hint-btn:hover {
  background: var(--info);
  color: #fff;
}

.field label .example {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: normal;
  margin-left: 4px;
}

.field input[type="text"],
.field input[type="number"],
.field input[type="tel"],
.field input[type="email"],
.field input[type="date"],
.field input[type="url"],
.field textarea,
.field select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 126, 52, 0.15);
}

.field textarea {
  resize: vertical;
  min-height: 80px;
}

.field .placeholder {
  color: #999;
  font-size: 12px;
  font-style: italic;
}

/* 单选/复选 */
.radio-group, .check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 8px 0;
}

.radio-group label, .check-group label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: normal;
  font-size: 14px;
  cursor: pointer;
}

.radio-group input, .check-group input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ===== 文件上传 ===== */
.file-upload {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  background: #fafbfc;
  transition: all 0.15s;
  position: relative;
  cursor: pointer;
}

.file-upload:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.file-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-upload .upload-text {
  color: var(--text-muted);
  font-size: 13px;
}

.file-upload .upload-text strong {
  color: var(--primary);
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.file-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary-light);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
}

.file-item .file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item .file-size {
  color: var(--text-muted);
  margin: 0 8px;
}

.file-item .remove-file {
  background: var(--danger);
  color: #fff;
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}

/* ===== 材料清单表 ===== */
.material-list {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 14px;
}

.material-list th,
.material-list td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
}

.material-list th {
  background: var(--primary-light);
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 13px;
}

.material-list tbody tr:hover {
  background: #f8f9fa;
}

.material-list .col-num { width: 60px; text-align: center; }
.material-list .col-name { }
.material-list .col-sample { width: 120px; text-align: center; }
.material-list .col-file { width: 280px; }
.material-list .col-check { width: 80px; text-align: center; }

.material-list .sample-link {
  display: inline-block;
  padding: 4px 10px;
  background: var(--info);
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-size: 12px;
  border: none;
  cursor: pointer;
}

.material-list .sample-link:hover {
  background: #0550ae;
}

.material-list .check-box {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.material-list .note {
  font-size: 12px;
  color: var(--warning);
  font-weight: normal;
}

/* ===== 首页入口卡片 ===== */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 24px;
}

@media (max-width: 768px) {
  .entry-grid { grid-template-columns: 1fr; }
}

.entry-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-decoration: none;
  color: var(--text);
  border: 2px solid var(--border);
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.entry-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary);
}

.entry-card[data-type="new"]::before { background: #1e7e34; }
.entry-card[data-type="change"]::before { background: #0969da; }
.entry-card[data-type="renew"]::before { background: #9a6700; }
.entry-card[data-type="replace"]::before { background: #cf222e; }

.entry-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.entry-card .icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.entry-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text);
}

.entry-card p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.entry-card .arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  margin-top: 12px;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #f6f8fa;
  border-color: var(--text-muted);
}

.btn-warning {
  background: var(--secondary);
  color: #000;
}

.btn-warning:hover {
  background: #e0a800;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #a40e26;
}

.btn-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
}

/* ===== 模态框 ===== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 16px;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: #f6f8fa;
  color: var(--text);
}

.modal-body {
  flex: 1;
  overflow: auto;
  padding: 20px;
}

.modal-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.modal-body iframe {
  width: 100%;
  height: 70vh;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}

.modal-body .doc-content {
  background: #f9f9f9;
  padding: 24px;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: "KaiTi", "楷体", serif;
}

/* ===== 提示与警告 ===== */
.notice {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin: 12px 0;
  font-size: 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.notice-info {
  background: #ddf4ff;
  border-left: 4px solid var(--info);
  color: #0550ae;
}

.notice-warning {
  background: #fff8c5;
  border-left: 4px solid var(--warning);
  color: var(--warning);
}

.notice-tip {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  color: var(--primary-dark);
}

.notice::before {
  flex-shrink: 0;
  font-size: 16px;
  margin-top: 1px;
}

.notice-info::before { content: "ℹ️"; }
.notice-warning::before { content: "⚠️"; }
.notice-tip::before { content: "💡"; }

/* ===== 步骤指示器 ===== */
.steps {
  display: flex;
  margin-bottom: 24px;
  background: #fff;
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 6px;
  min-width: 180px;
  color: var(--text-muted);
  font-size: 14px;
  position: relative;
}

.step.active {
  background: var(--primary);
  color: #fff;
}

.step.done {
  color: var(--primary);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
}

.step.active .step-num { background: rgba(255, 255, 255, 0.3); }
.step:not(.active) .step-num { background: var(--border); color: var(--text-muted); }
.step.done .step-num { background: var(--primary); color: #fff; }

/* ===== 字段值预览(用于 PDF) ===== */
.preview-block {
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 14px;
  line-height: 1.8;
}

.preview-block dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 18px;
}

.preview-block dt {
  font-weight: 600;
  color: var(--primary-dark);
}

.preview-block dd {
  color: var(--text);
}

.preview-block .empty {
  color: #999;
  font-style: italic;
}

/* 进度条 */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  z-index: 2000;
  transform-origin: left;
  animation: progress 2s ease-in-out;
}

@keyframes progress {
  0% { transform: scaleX(0); }
  50% { transform: scaleX(0.7); }
  100% { transform: scaleX(1); opacity: 0; }
}

/* 帮助区块 */
.help-section {
  background: #f6f8fa;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 12px 0;
}

.help-section h4 {
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--primary-dark);
}

.help-section ul {
  padding-left: 20px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.8;
}

/* 表格内容内的空字段 */
.empty-value {
  color: #c0c4c8;
}

/* ===== 申请表下载卡(主入口) ===== */
.form-card {
  background: linear-gradient(135deg, #ffffff 0%, #f0f8f2 100%);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px 26px;
  margin-bottom: 20px;
}

.form-card h2 {
  font-size: 18px;
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-card .form-desc {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 16px;
}

.form-card .form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.form-card .form-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 14px;
}

.form-card .form-preview img {
  width: 72px;
  height: 88px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  background: #f6f8fa;
}

.form-card .form-preview .preview-text {
  flex: 1;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.form-card .form-preview .preview-text strong {
  display: block;
  font-size: 15px;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.form-card .btn-download {
  background: var(--info);
  color: #fff;
  font-weight: 500;
  font-size: 15px;
  padding: 12px 22px;
}

.form-card .btn-download:hover {
  background: #0550ae;
}

.form-card .btn-download::before {
  content: "⬇";
  font-size: 16px;
  margin-right: 6px;
}

.form-card .file-upload {
  background: #fff;
  border-style: solid;
  border-color: var(--primary);
}

/* ===== 简化的子材料行(只保留上传位,无在线填字段) ===== */
.material-row {
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border-left: 4px solid var(--primary);
}

.material-row .row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.material-row .row-head strong {
  color: var(--primary-dark);
  font-size: 14px;
}

.material-row .row-file {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.material-row .check-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}

.material-row .check-label input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

@media (max-width: 640px) {
  .material-row .row-file {
    grid-template-columns: 1fr;
  }
}

/* 材料子项(用于 5 号 6 个子材料等场景) */
.material-subitem {
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 14px;
  border-left: 4px solid var(--primary);
}

.material-subitem .subitem-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.material-subitem .subitem-header strong {
  color: var(--primary-dark);
  font-size: 15px;
}

.material-subitem .form-grid {
  margin-bottom: 10px;
}

.material-subitem .file-upload {
  margin-bottom: 8px;
}

.material-subitem .check-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  margin-top: 4px;
}

.material-subitem .check-label input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.hint-text {
  font-size: 12px;
  font-weight: normal;
  margin-left: 6px;
}

/* 角色（操作员、负责人等）多行 */
.people-row {
  display: grid;
  grid-template-columns: 1.5fr 0.8fr 2fr 1.5fr 0.8fr auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  background: #fafbfc;
  border-radius: 6px;
  margin-bottom: 8px;
}

.people-row .field { margin: 0; }

.people-row .field label { font-size: 11px; }

.people-row .add-row, .people-row .remove-row {
  background: var(--primary);
  color: #fff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  margin-bottom: 0;
}

.people-row .remove-row { background: var(--danger); }

@media (max-width: 768px) {
  .people-row {
    grid-template-columns: 1fr 1fr;
  }
  .people-row .field:has(.add-row),
  .people-row .field:has(.remove-row) {
    grid-column: span 2;
  }
}

/* 脚注 */
.footnote {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 20px;
  margin-top: 40px;
  border-top: 1px solid var(--border);
}

/* 打印样式 */
@media print {
  .site-header, .btn-group, .steps, .back-link, .file-upload, .material-list .col-file, .material-list .col-sample, .notice { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; }
  body { background: #fff; }
}

/* 进度提示 */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius);
  z-index: 1500;
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success { background: var(--primary); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--info); }

/* ===== Hero 区域(首页一句话卖点,SEO 友好) ===== */
.hero {
  background: linear-gradient(135deg, #e8f5ed 0%, #f0f9f3 100%);
  border: 1px solid #c8e6d0;
  border-radius: 12px;
  padding: 28px 32px 24px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "🌾";
  position: absolute;
  right: -10px;
  top: -16px;
  font-size: 120px;
  opacity: 0.08;
  transform: rotate(-15deg);
  pointer-events: none;
}
.hero-headline {
  font-size: 24px;
  font-weight: 700;
  color: #1e7e34;
  line-height: 1.5;
  margin: 0 0 14px 0;
}
.hero-pitch {
  font-size: 15px;
  line-height: 1.85;
  color: #2d3e36;
  margin: 0 0 18px 0;
  max-width: 880px;
}
.hero-pitch strong {
  color: #1e7e34;
  font-weight: 600;
}
.hero-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.hero-keywords li {
  background: #fff;
  border: 1px solid #b6dec1;
  color: #1e7e34;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .hero { padding: 20px 18px 18px; }
  .hero-headline { font-size: 19px; }
  .hero-pitch { font-size: 14px; }
  .hero-keywords { gap: 6px 8px; }
  .hero-keywords li { font-size: 13px; padding: 5px 10px; }
}
