/* styles.css — 共享样式 + 报价单排版 + 打印(A4)样式 */
:root {
  --brand: #1f3a5f;
  --brand2: #2d6a9f;
  --line: #c9d2dc;
  --bg: #f4f6f9;
  --text: #1c2530;
  --muted: #6b7785;
  --accent: #d98324;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
}

/* 顶部工具栏（打印隐藏） */
.toolbar {
  position: sticky; top: 0; z-index: 50;
  background: #fff; border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 16px;
}
.toolbar .brand { font-weight: 700; color: var(--brand); margin-right: auto; }
.btn {
  border: 1px solid var(--brand2); background: #fff; color: var(--brand2);
  padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.btn:hover { background: var(--brand2); color: #fff; }
.btn.primary { background: var(--brand2); color: #fff; }
.btn.primary:hover { background: var(--brand); }
select.lang {
  border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font-size: 13px;
}

/* 首页 */
.hero { max-width: 900px; margin: 40px auto; padding: 0 20px; text-align: center; }
.hero h1 { color: var(--brand); font-size: 30px; margin-bottom: 8px; }
.hero p { color: var(--muted); font-size: 16px; }
.card-grid { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 22px; width: 240px; text-align: left; text-decoration: none; color: var(--text);
  transition: .15s;
}
.card:hover { border-color: var(--brand2); box-shadow: 0 4px 14px rgba(0,0,0,.08); transform: translateY(-2px); }
.card h3 { margin: 0 0 6px; color: var(--brand); }
.card p { margin: 0; color: var(--muted); font-size: 13px; }
.badge { display: inline-block; background: #eef3f8; color: var(--brand2); border-radius: 4px; padding: 2px 8px; font-size: 12px; margin-top: 10px; }

/* A4 纸张容器 */
.sheet-wrap { padding: 24px; }
.sheet {
  width: 210mm; max-width: 100%; margin: 0 auto; background: #fff;
  border: 1px solid var(--line); padding: 14mm 14mm; box-shadow: 0 2px 10px rgba(0,0,0,.08);
}
.doc-title { text-align: center; color: var(--brand); font-size: 24px; letter-spacing: 2px; font-weight: 800; margin: 0 0 2px; }
.doc-sub { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 14px; }

.meta-row { display: flex; gap: 14px; margin-bottom: 12px; }
.meta-row .col { flex: 1; }
.party { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.party h4 { margin: 0 0 8px; font-size: 13px; color: var(--brand); border-bottom: 2px solid var(--brand2); padding-bottom: 4px; display: inline-block; }
.logo-img { max-height: 46px; max-width: 160px; display: block; margin-bottom: 6px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; }
.field label { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.field input, .field textarea, .field select {
  border: 1px solid var(--line); border-radius: 4px; padding: 5px 7px; font-size: 13px;
  font-family: inherit; width: 100%; background: #fff; color: var(--text);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand2); }

table.items { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
table.items th, table.items td { border: 1px solid var(--line); padding: 6px 7px; font-size: 12px; vertical-align: top; }
table.items th { background: var(--brand); color: #fff; text-align: center; font-weight: 600; }
table.items td input { border: none; width: 100%; background: transparent; font-size: 12px; padding: 2px; }
table.items td input:focus { outline: 1px solid var(--brand2); }
table.items .col-no { width: 28px; text-align: center; }
table.items .col-amt { width: 90px; text-align: right; }
table.items .col-qty, table.items .col-up { width: 70px; }
table.items .col-photo { width: 64px; text-align: center; }
table.items .rowdel { color: #c0392b; cursor: pointer; border: none; background: none; font-size: 14px; }
table.items .amt-cell { text-align: right; white-space: nowrap; }
.item-photo { max-height: 40px; max-width: 56px; display: block; margin: 0 auto; }
.photo-up { font-size: 10px; display: block; margin-top: 2px; color: var(--brand2); cursor: pointer; }

.totals { display: flex; justify-content: flex-end; margin: 8px 0; }
.totals .box { border: 1px solid var(--line); border-radius: 6px; min-width: 280px; }
.totals .row { display: flex; justify-content: space-between; padding: 6px 12px; }
.totals .row.total { background: var(--brand); color: #fff; font-weight: 700; font-size: 15px; }

.words { font-size: 12px; color: var(--text); margin: 6px 0 12px; border-left: 3px solid var(--accent); padding: 6px 10px; background: #fdf6ec; }

.remarks { width: 100%; min-height: 60px; border: 1px solid var(--line); border-radius: 6px; padding: 8px; font-family: inherit; font-size: 13px; }

.sign-row { display: flex; gap: 30px; margin-top: 26px; }
.sign-box { flex: 1; border-top: 1px solid var(--text); padding-top: 6px; font-size: 12px; color: var(--muted); }

.footer-note { text-align: center; color: var(--muted); font-size: 11px; margin-top: 16px; }

/* 中英对照模式：中文小字 */
.zh { font-size: 11px; color: var(--muted); margin-left: 4px; }

/* ===== 打印 / 导出 PDF（A4） ===== */
@media print {
  @page { size: A4; margin: 10mm; }
  html, body { background: #fff; font-size: 12px; }
  .toolbar, .no-print { display: none !important; }
  .sheet-wrap { padding: 0; }
  .sheet { border: none; box-shadow: none; width: 100%; padding: 0; margin: 0; }
  table.items th { background: var(--brand) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .totals .row.total { background: var(--brand) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .words { background: #fdf6ec !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .field input, .field textarea, table.items td input { border: none !important; }
}
