:root {
  --gold: #b08d2f;
  --gold-l: #d4b45a;
  --gold-bg: #f3ecd9;
  --ink: #3a352b;
  --muted: #8a8272;
  --bg: #faf8f2;
  --card: #ffffff;
  --line: #e6dfcd;
  --red: #b0472f;
  --green: #4a7a3a;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Microsoft JhengHei", "PingFang TC", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}
.wrap { max-width: 640px; margin: 0 auto; padding: 14px 14px 60px; }
.wrap-wide { max-width: 1100px; }
.brand { text-align: center; padding: 14px 0 4px; }
.brand img { height: 56px; }
.brand .bmark {
  font-family: Georgia, serif; font-size: 40px; color: var(--gold);
  font-style: italic; font-weight: bold; line-height: 1;
}
h1.sys { text-align: center; font-size: 20px; color: var(--gold); letter-spacing: 2px; margin-bottom: 4px; }
h2.hotel { text-align: center; font-size: 22px; letter-spacing: 4px; margin: 6px 0 2px; }
h3.formname { text-align: center; font-size: 19px; letter-spacing: 8px; color: var(--ink); margin-bottom: 10px; }
.gold-line { height: 3px; background: linear-gradient(90deg, transparent, var(--gold-l), transparent); margin: 8px 0 16px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; margin-bottom: 14px; box-shadow: 0 1px 4px rgba(120,100,40,.08);
}
.fld { margin-bottom: 14px; }
.fld label { display: block; font-weight: bold; font-size: 15px; margin-bottom: 4px; color: var(--ink); }
.req { color: var(--red); }
input[type=text], input[type=password], input[type=date], input[type=time],
input[type=number], input[type=email], select, textarea {
  width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 16px; font-family: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold-l); border-color: var(--gold); }
input[type=radio], input[type=checkbox] {
  width: 20px; height: 20px; accent-color: var(--gold);
  vertical-align: -4px; margin-right: 5px; cursor: pointer;
}
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline > * { flex: 1; min-width: 0; }
.inline .fix { flex: 0 0 auto; }

.btn {
  display: inline-block; width: 100%; padding: 13px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), var(--gold-l)); color: #fff;
  font-size: 17px; font-weight: bold; letter-spacing: 3px; cursor: pointer; text-align: center;
}
.btn:active { opacity: .85; }
.btn.sec { background: #fff; color: var(--gold); border: 1.5px solid var(--gold); }
.btn.ghost { background: #f1ede1; color: var(--muted); border: 1px solid var(--line); }
.btn.danger { background: var(--red); }
.btn.sm { width: auto; padding: 7px 14px; font-size: 14px; letter-spacing: 1px; border-radius: 8px; }
.btnrow { display: flex; gap: 10px; margin-top: 12px; }
.btnrow .btn { flex: 1; }

.pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pick button {
  padding: 16px 8px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
  font-size: 17px; font-weight: bold; color: var(--ink); cursor: pointer; font-family: inherit;
}
.pick button:active { border-color: var(--gold); background: var(--gold-bg); }

.seg { border: 1px dashed var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; background: #fdfcf8; }
.seg .del { float: right; color: var(--red); background: none; border: none; font-size: 14px; cursor: pointer; }
.addrow { background: none; border: 1.5px dashed var(--gold); color: var(--gold); width: 100%;
  padding: 9px; border-radius: 10px; font-size: 15px; cursor: pointer; font-family: inherit; }

.note { background: var(--gold-bg); border-radius: 10px; padding: 10px 12px; font-size: 13px;
  color: var(--ink); white-space: pre-line; margin-bottom: 12px; }
.hint { font-size: 13px; color: var(--muted); }
.err { color: var(--red); font-size: 14px; margin-top: 8px; white-space: pre-line; }

.pv-table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.pv-table th, .pv-table td { border: 1px solid var(--line); padding: 8px 10px; font-size: 15px; text-align: left; vertical-align: top; }
.pv-table th { background: var(--gold-bg); width: 105px; font-weight: bold; white-space: nowrap; }
.pv-table td { white-space: pre-line; word-break: break-word; }

.sigbox { border: 1.5px solid var(--line); border-radius: 10px; background: #fff; touch-action: none; width: 100%; height: 230px; display: block; }
.sigtools { display: flex; gap: 8px; margin-top: 8px; }
.sigtools button { flex: 1; padding: 9px; border: 1px solid var(--line); background: #fff;
  border-radius: 8px; font-size: 15px; cursor: pointer; font-family: inherit; color: var(--ink); }

.tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 13px; font-weight: bold; }
.tag.wait { background: #fdeed3; color: #a26a1a; }
.tag.ok { background: #e2efdb; color: var(--green); }
.tag.no { background: #f6dfd8; color: var(--red); }
.tag.lock { background: #e3e0d6; color: #555; }
.tag.cancel { background: #eee; color: #999; }

.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 0; flex-wrap: wrap; }
.topbar .who { margin-left: auto; font-size: 14px; color: var(--muted); }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { padding: 9px 16px; border: 1px solid var(--line); background: #fff; border-radius: 20px;
  font-size: 15px; cursor: pointer; font-family: inherit; color: var(--ink); position: relative; }
.tabs button.on { background: var(--gold); color: #fff; border-color: var(--gold); font-weight: bold; }
.tabs .cnt { position: absolute; top: -6px; right: -4px; background: var(--red); color: #fff;
  border-radius: 10px; font-size: 11px; padding: 0 6px; }

.list-table { width: 100%; border-collapse: collapse; background: #fff; }
.list-table th { background: var(--gold-bg); font-size: 14px; padding: 8px; border-bottom: 2px solid var(--gold-l); text-align: left; white-space: nowrap; }
.list-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.list-table tr:hover td { background: #fbf7ea; }
.scrollx { overflow-x: auto; }

.modal-bg { position: fixed; inset: 0; background: rgba(50,40,20,.45); display: flex;
  align-items: flex-start; justify-content: center; z-index: 50; padding: 20px 10px; overflow-y: auto; }
.modal { background: var(--bg); border-radius: 14px; max-width: 680px; width: 100%; padding: 18px; position: relative; }
.modal .close { position: absolute; top: 8px; right: 14px; background: none; border: none; font-size: 26px; color: var(--muted); cursor: pointer; }

.grid-edit { width: 100%; border-collapse: collapse; background: #fff; }
.grid-edit th { background: var(--gold-bg); font-size: 13px; padding: 6px; border: 1px solid var(--line); white-space: nowrap; }
.grid-edit td { border: 1px solid var(--line); padding: 2px; }
.grid-edit input, .grid-edit select { border: none; padding: 7px 6px; font-size: 14px; width: 100%; min-width: 70px; }
.grid-edit textarea { border: none; padding: 7px 6px; font-size: 14px; width: 100%; min-width: 150px; font-family: inherit; resize: vertical; line-height: 1.5; }
.grid-edit td.c { text-align: center; }
.grid-edit input[type=checkbox] { width: 20px; height: 20px; min-width: 0; padding: 0; accent-color: var(--gold); vertical-align: middle; }
.grid-edit input.ro { background: #f7f5f0; color: var(--muted); }
.grid-edit textarea.wide { min-width: 280px; }
.grid-edit .ucheck { display: flex; flex-wrap: wrap; gap: 4px 12px; min-width: 260px; padding: 6px; }
.grid-edit .ucheck label { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; white-space: nowrap; cursor: pointer; }
.grid-edit .ucheck input[type=checkbox] { width: 16px; height: 16px; }
.grid-edit .rowdel { color: var(--red); background: none; border: none; cursor: pointer; font-size: 16px; }

.filebox { font-size: 14px; }
.filebox li { margin: 3px 0 3px 18px; }
.sigimg { max-width: 220px; max-height: 90px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.sigrow { display: flex; margin-top: -1px; }
.sigcell { flex: 1; min-width: 0; border: 1px solid var(--line); border-left: none; padding: 8px; background: #fff; min-height: 96px; }
.sigcell:first-child { border-left: 1px solid var(--line); }
.sigcell .lbl { font-weight: bold; font-size: 14px; }
.sigcell .nt { font-size: 12px; color: var(--muted); white-space: pre-line; }
.sigcell img { max-width: 100%; max-height: 80px; display: block; margin: 4px 0; }
.sigcell .sigblank { height: 52px; }
.sigcell .tm { font-size: 12px; color: var(--muted); }
.pick button .hint { font-weight: normal; font-size: 12px; margin-top: 2px; }
.step-ind { text-align: center; font-size: 13px; color: var(--muted); margin-bottom: 10px; letter-spacing: 1px; }
.done-icon { text-align: center; font-size: 56px; margin: 26px 0 10px; }
.center { text-align: center; }
.mt { margin-top: 12px; }
.copybox { display: flex; gap: 8px; }
.copybox input { flex: 1; font-size: 13px; color: var(--muted); }
/* 離職書正式版型 */
.rletter { max-width: 600px; margin: 0 auto; background: #fff; }
.rl-title { text-align: center; font-size: 20px; font-weight: bold; letter-spacing: 2px; color: var(--ink); }
.rl-date { text-align: right; font-size: 13px; color: var(--muted); margin: 8px 0; }
.rl-tbl { width: 100%; border-collapse: collapse; }
.rl-tbl td { border: 1px solid var(--line); padding: 9px 10px; font-size: 14px; vertical-align: top; word-break: break-word; }
.rl-k { background: var(--gold-bg); width: 92px; white-space: nowrap; color: var(--muted); font-weight: bold; }
.rl-reasons { border: 1px solid var(--line); border-top: none; padding: 10px 12px; }
.rl-reasons .rl-lbl { color: var(--ink); font-size: 16px; font-weight: bold; margin-bottom: 8px; }
.rl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 14px; font-size: 14px; }
.rl-note { border: 1px solid var(--line); border-top: none; padding: 10px 12px; font-size: 12px; color: var(--muted); }
.rl-note b { font-size: 16px; color: var(--ink); }
.rl-note-em { color: var(--red); font-size: 15px; }
.rl-note-em b { color: var(--red); }
.rl-block { border: 1px solid var(--line); border-top: none; padding: 10px 12px; }
.rl-block .rl-blbl { font-weight: bold; font-size: 15px; margin-bottom: 6px; color: var(--ink); }
.rl-block .rl-btext { white-space: pre-line; font-size: 14px; min-height: 3em; word-break: break-word; }
.rl-check { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.rl-check .rlc { font-weight: normal; font-size: 15px; display: flex; align-items: center; }

@media (max-width: 480px) {
  .pick { grid-template-columns: 1fr; }
  body { font-size: 15px; }
  .rl-grid, .rl-check { grid-template-columns: 1fr; }
}
@media print {
  .noprint { display: none !important; }
}
