/* ===== 基础 ===== */
* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  background: #f2f4f8;
  color: #1f2733;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

a { color: #1867d2; text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: #8a94a6; }
.nowrap { white-space: nowrap; }

/* ===== 提示条 ===== */
.alert {
  padding: 10px 14px;
  border-radius: 8px;
  margin: 0 0 14px;
  font-size: 14px;
}
.alert.error { background: #fdeceb; color: #b3261e; border: 1px solid #f6c7c4; }
.alert.ok    { background: #e8f6ed; color: #17663a; border: 1px solid #bfe4cd; }

/* ===== 按钮 ===== */
.btn {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 15px;
  line-height: 1.2;
  cursor: pointer;
  background: #e9ecf2;
  color: #364152;
  font-family: inherit;
}
.btn:hover { filter: brightness(0.97); }
.btn-primary { background: #1867d2; color: #fff; }
.btn-copy    { background: #eef2f9; color: #1867d2; border-color: #cfdcf0; }
.btn-danger  { background: #fdeceb; color: #b3261e; border-color: #f3c8c5; }
.btn-sm      { padding: 6px 12px; font-size: 13px; }

/* ===== 前台 ===== */
.wrap {
  max-width: 620px;
  margin: 0 auto;
  padding: 32px 16px 60px;
}

.site-head { text-align: center; margin-bottom: 22px; }
.site-head h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: 1px; }
.site-head .sub { margin: 0; color: #8a94a6; font-size: 14px; }

.card {
  background: #fff;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 6px 24px rgba(24, 39, 75, 0.06);
  margin-bottom: 18px;
}

.code-form { display: flex; gap: 10px; }
.code-form input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  font-size: 17px;
  letter-spacing: 3px;
  border: 1px solid #d7dce6;
  border-radius: 10px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  outline: none;
}
.code-form input[type="text"]:focus { border-color: #1867d2; box-shadow: 0 0 0 3px rgba(24, 103, 210, .12); }
.code-form .btn { padding: 12px 22px; font-size: 16px; white-space: nowrap; }

.code-tip { margin: 10px 0 0; font-size: 13px; color: #8a94a6; }

/* ===== 提取结果 ===== */
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px dashed #e3e7ef;
  margin-bottom: 14px;
  font-size: 14px;
  color: #667085;
}
.result-head b {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 17px;
  letter-spacing: 2px;
  color: #1867d2;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
  color: #667085;
}

pre.card-content {
  margin: 0;
  padding: 14px;
  background: #f7f9fc;
  border: 1px solid #e3e7ef;
  border-radius: 10px;
  font-family: ui-monospace, Menlo, Consolas, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 420px;
  overflow: auto;
}

.remark { margin: 12px 0 0; font-size: 13px; color: #8a94a6; }

.notice-inline { border-left: 4px solid #1867d2; }
.notice-inline h3 { margin: 0 0 8px; font-size: 15px; color: #1867d2; }
.notice-inline .notice-text { font-size: 14px; color: #364152; }
.notice-img { display: block; max-width: 100%; border-radius: 8px; margin: 0 0 10px; }

/* ===== 使用说明 ===== */
.guide-card { border-left: 4px solid #12a15a; }
.guide-card h3 { margin: 0 0 10px; font-size: 15px; color: #0f7a44; }
.guide-text { font-size: 14px; color: #364152; word-break: break-word; }
.guide-img {
  display: block;
  width: 100%;
  margin-top: 12px;
  border: 1px solid #e3e7ef;
  border-radius: 8px;
}

/* 后台缩略图列表 */
.thumb-list { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; }
.thumb { width: 170px; }
.thumb img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
  background: #f7f9fc;
  border: 1px solid #e3e7ef;
  border-radius: 8px;
}
.thumb form { margin-top: 8px; }
.thumb .btn { width: 100%; }

/* ===== 公告弹窗 ===== */
.modal-mask {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(15, 23, 42, .5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 99;
}
.modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 460px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  padding: 22px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .25);
}
.modal h2 { margin: 0 0 14px; font-size: 18px; text-align: center; }
.modal-body { overflow: auto; margin-bottom: 18px; }
.modal-text { font-size: 14px; color: #364152; word-break: break-word; }
.modal .btn { width: 100%; padding: 11px 18px; font-size: 16px; }

/* ===== 后台 ===== */
.admin-top { background: #16233a; color: #fff; }
.admin-top-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 18px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.admin-brand { font-size: 16px; font-weight: 600; }
.admin-brand span { color: #9fb2d0; font-weight: 400; font-size: 13px; margin-left: 6px; }
.admin-nav { display: flex; align-items: center; gap: 4px; }
.admin-nav a {
  color: #c9d6ea;
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 14px;
}
.admin-nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; }
.admin-nav a.on { background: #1867d2; color: #fff; }
.admin-nav a.nav-quit { color: #8fa2bd; }

.admin-main { max-width: 1080px; margin: 0 auto; padding: 22px 18px 50px; }

.panel {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 18px rgba(24, 39, 75, .05);
  margin-bottom: 20px;
}
.panel-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eef1f6;
}

.form-row { margin-bottom: 14px; }
.form-row > label { display: block; font-size: 14px; color: #4b5565; margin-bottom: 6px; }
.form-row input[type="text"],
.form-row input[type="password"],
.form-row textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d7dce6;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: #fff;
  color: #1f2733;
}
.form-row input:focus, .form-row textarea:focus { border-color: #1867d2; box-shadow: 0 0 0 3px rgba(24, 103, 210, .12); }
.form-row textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.form-row textarea.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.form-hint { font-size: 12px; color: #8a94a6; margin: 6px 0 0; }
.form-inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form-inline .form-row { flex: 1; margin-bottom: 0; min-width: 180px; }

.check-line { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #4b5565; margin-bottom: 10px; }

.img-preview { margin: 10px 0 0; }
.img-preview img { max-width: 320px; max-height: 220px; border: 1px solid #e3e7ef; border-radius: 8px; display: block; }

/* 新生成的编号提示 */
.flash-code {
  background: #eef7ff;
  border: 1px solid #bfdcff;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 20px;
}
.flash-code .t { font-size: 13px; color: #1867d2; margin-bottom: 8px; }
.flash-code .c {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.flash-code .c code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 22px;
  letter-spacing: 4px;
  color: #0f3f86;
  background: #fff;
  border: 1px dashed #9dc4f0;
  border-radius: 8px;
  padding: 6px 14px;
}

/* 表格 */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th, table.list td { padding: 10px 12px; border-bottom: 1px solid #eef1f6; text-align: left; vertical-align: middle; }
table.list th { background: #f7f9fc; color: #4b5565; font-weight: 600; white-space: nowrap; }
table.list tbody tr:hover { background: #fafbfd; }
table.list code { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 1px; color: #1867d2; }
table.list .col-check { width: 36px; }
table.list .col-act { white-space: nowrap; text-align: right; }

.empty { padding: 34px 10px; text-align: center; color: #98a2b3; }

/* 列表里的行操作按钮 */
.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.row-actions .inline-form { display: inline; margin: 0; }
.row-actions .btn { padding: 5px 10px; font-size: 13px; }
.btn-view { background: #eef2f9; color: #1867d2; border-color: #cfdcf0; }

/* 编辑页的编号展示 */
.code-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.code-line code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 18px;
  letter-spacing: 3px;
  color: #1867d2;
  background: #f7f9fc;
  border: 1px dashed #cfdcf0;
  border-radius: 8px;
  padding: 5px 12px;
}

/* 查看卡密弹窗里的补充信息 */
.view-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; letter-spacing: 1px; color: #1867d2; }
.view-meta { font-size: 12px; color: #8a94a6; margin: 10px 0 0; }

/* 动态验证码输入框 */
.otp-input {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 20px;
  letter-spacing: 8px;
  text-align: center;
}
.code-line code.uri-code {
  font-size: 12px;
  letter-spacing: 0;
  line-height: 1.6;
  word-break: break-all;
  white-space: normal;
}

.list-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.search-form { display: flex; gap: 8px; }
.search-form input[type="text"] {
  padding: 8px 12px;
  border: 1px solid #d7dce6;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  min-width: 200px;
}

.pager { margin-top: 16px; display: flex; align-items: center; gap: 10px; font-size: 14px; color: #667085; }
.pager a { padding: 5px 12px; border: 1px solid #d7dce6; border-radius: 8px; color: #364152; }
.pager a:hover { border-color: #1867d2; color: #1867d2; text-decoration: none; }
.pager .off { padding: 5px 12px; border: 1px solid #eef1f6; border-radius: 8px; color: #c2c9d6; }

/* 登录页 */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-box {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 14px;
  padding: 28px 24px;
  box-shadow: 0 10px 40px rgba(24, 39, 75, .1);
}
.login-box h1 { margin: 0 0 4px; font-size: 20px; text-align: center; }
.login-box .sub { margin: 0 0 20px; text-align: center; color: #8a94a6; font-size: 13px; }
.login-box .btn { width: 100%; padding: 11px 18px; font-size: 16px; }

/* 页脚 */
.site-foot { text-align: center; color: #98a2b3; font-size: 13px; padding: 20px 10px 30px; }

/* 手机端 */
@media (max-width: 560px) {
  .code-form { flex-direction: column; }
  .code-form .btn { width: 100%; }
  .admin-top-inner { height: auto; padding: 10px 14px; }
  .admin-main { padding: 16px 12px 40px; }
  .panel { padding: 16px; }
}
