:root {
  --navy: #16233f;
  --navy-soft: #22345c;
  --accent: #0e7c66;
  --accent-dark: #0a5f4e;
  --amber: #b7791f;
  --ink: #1e2430;
  --muted: #5b6472;
  --line: #dde2ea;
  --bg: #f6f7f9;
  --card: #ffffff;
  --danger: #b3261e;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}

.wrap { max-width: 880px; margin: 0 auto; padding: 0 20px; }

.site-header {
  background: var(--navy);
  color: #fff;
  padding: 14px 0;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.brand-mark { font-size: 22px; color: #7fd1c0; }
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: 0.2px; }
.brand-tag { font-size: 13px; color: #b9c4d6; }

.hero { padding: 36px 0 8px; }
.hero h1 { font-size: 30px; line-height: 1.25; margin: 0 0 8px; color: var(--navy); }
.hero p { font-size: 17px; color: var(--muted); margin: 0; max-width: 640px; }

.btn {
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { background: #9db8b2; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--navy); }
.btn-pro { background: var(--amber); color: #fff; white-space: nowrap; }
.btn-pro:hover { background: #96650f; }
.btn-block { width: 100%; padding: 13px 18px; font-size: 16px; }
.linklike {
  background: none; border: 0; padding: 0;
  color: var(--accent); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: underline;
}

.dropzone {
  margin: 24px 0;
  border: 2px dashed #b9c2cf;
  border-radius: var(--radius);
  background: var(--card);
  padding: 34px 20px;
  text-align: center;
  cursor: pointer;
}
.dropzone:hover, .dropzone.dragging { border-color: var(--accent); background: #eef7f4; }
.dropzone-icon { font-size: 30px; color: var(--accent); }
.dropzone-title { font-size: 17px; margin: 6px 0 2px; }
.dropzone-sub { color: var(--muted); font-size: 14px; margin: 0; }

.notice {
  border-radius: 8px; padding: 12px 16px; margin: 0 0 20px;
  background: #fdf3e3; border: 1px solid #f0d9a8; color: #6d4c00;
}
.notice.error { background: #fdecea; border-color: #f2b8b5; color: var(--danger); }
.notice.ok { background: #e6f4f0; border-color: #bfe3d8; color: var(--accent-dark); }

.files { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 24px; }
.files h2 { margin: 0 0 10px; font-size: 18px; }
.files h2 .count { color: var(--muted); font-weight: 400; font-size: 15px; }
.file-list { list-style: none; margin: 0 0 12px; padding: 0; }
.file-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-top: 1px solid var(--line);
}
.file-list li:first-child { border-top: 0; }
.file-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { color: var(--muted); font-size: 13px; white-space: nowrap; }
.file-remove {
  margin-left: auto; background: none; border: 0; color: var(--danger);
  font: inherit; cursor: pointer; padding: 4px 8px;
}

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 0; }
.tab {
  font: inherit; font-weight: 600; padding: 10px 16px; cursor: pointer;
  background: #e8ebf0; border: 1px solid var(--line); border-bottom: 0;
  border-radius: 10px 10px 0 0; color: var(--navy);
}
.tab.active { background: var(--card); }
.pro-badge {
  background: var(--amber); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 4px; padding: 1px 6px; vertical-align: 1px; letter-spacing: 0.4px;
}

.panel {
  display: none; background: var(--card);
  border: 1px solid var(--line); border-radius: 0 var(--radius) var(--radius) var(--radius);
  padding: 22px; margin-bottom: 24px;
}
.panel.active { display: block; }
.panel h2 { margin: 0 0 6px; font-size: 20px; color: var(--navy); }
.panel p { color: var(--muted); margin: 0 0 16px; }
.panel code { background: #eef0f3; padding: 1px 6px; border-radius: 4px; font-size: 13px; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 600; margin-bottom: 5px; }
.field select, .field input[type="text"] {
  width: 100%; font: inherit; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}

.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.hint { color: var(--muted); font-size: 14px; }
.result { background: #e6f4f0; border: 1px solid #bfe3d8; border-radius: 8px; padding: 12px 16px; color: var(--accent-dark); }

.order-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.order-item {
  display: flex; align-items: center; gap: 10px;
  background: #f2f4f7; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px;
}
.order-item .pos {
  background: var(--navy); color: #fff; border-radius: 50%;
  width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.order-item .file-name { flex: 1; }
.order-item button {
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  font: inherit; padding: 3px 10px; cursor: pointer;
}
.order-item button:disabled { opacity: 0.4; cursor: default; }

.page-list { list-style: none; margin: 0 0 16px; padding: 0; max-height: 340px; overflow: auto; }
.page-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-top: 1px solid var(--line);
}
.page-list li:first-child { border-top: 0; }
.page-list li.removed { opacity: 0.45; }
.page-list li.removed .page-label { text-decoration: line-through; }
.page-label { font-weight: 600; flex: 1; }
.page-list button {
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  font: inherit; font-size: 13px; padding: 3px 10px; cursor: pointer;
}
.page-list button:disabled { opacity: 0.4; cursor: default; }
.page-list .delete-btn { color: var(--danger); }

.selling { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 32px; }
.selling h2 { margin: 0 0 10px; font-size: 20px; color: var(--navy); }
.selling ul { margin: 0; padding-left: 20px; }
.selling li { margin-bottom: 8px; color: var(--muted); }
.selling li strong { color: var(--ink); }

.site-footer { border-top: 1px solid var(--line); padding: 18px 0 28px; color: var(--muted); font-size: 14px; }
.site-footer a { color: var(--accent); }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16, 24, 40, 0.6);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: #fff; border-radius: 14px; max-width: 460px; width: 100%;
  padding: 26px; position: relative;
}
.modal h2 { margin: 0 0 8px; color: var(--navy); font-size: 22px; }
.modal p { color: var(--muted); margin: 0 0 14px; }
.modal-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: 0; font-size: 18px; cursor: pointer; color: var(--muted);
}
.pro-list { margin: 0 0 18px; padding-left: 20px; }
.pro-list li { margin-bottom: 6px; }
.fineprint { font-size: 13px; color: var(--muted); margin: 10px 0 0; }

@media (max-width: 600px) {
  .hero h1 { font-size: 24px; }
  .brand-tag { display: none; }
  .file-meta { display: none; }
}
