:root {
  --brand: #6387cd;
  --brand-dark: #436bb7;
  --ink: #25344d;
  --muted: #8190a7;
  --line: #e6ebf2;
  --sidebar: #233248;
  --background: #f3f6fa;
  --font: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--background);
}
[hidden] {
  display: none !important;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 0;
  color: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #83a8ef;
  outline-offset: 2px;
}
input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d8e0ec;
  border-radius: 4px;
  outline: 0;
  background: #fff;
  color: var(--ink);
  margin-top: 7px;
  min-height: 42px;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px #6387cd18;
}
textarea {
  resize: vertical;
}
label {
  display: block;
  font-weight: 500;
  margin-bottom: 19px;
}
label i {
  font-style: normal;
  color: #e35353;
}
label small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
  font-weight: 400;
}
button.primary-button,
.primary-button {
  background: var(--brand);
  color: white;
  border-radius: 4px;
  padding: 10px 17px;
  font-weight: 500;
  transition: background 0.15s;
}
button.primary-button:hover {
  background: var(--brand-dark);
}
.secondary-button {
  background: white;
  border: 1px solid #d8e0eb;
  border-radius: 4px;
  padding: 9px 16px;
}
.secondary-button:hover {
  background: #f5f8ff;
}
.danger-button {
  background: #e45858;
  color: white;
  border-radius: 4px;
  padding: 10px 17px;
}
.wide {
  width: 100%;
  font-size: 16px;
  height: 46px;
}
.text-link {
  color: var(--brand);
  background: none;
}
.form-error {
  color: #d44545;
  font-size: 13px;
  margin: 5px 0 15px;
  min-height: 18px;
  line-height: 1.7;
}
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  background: radial-gradient(ellipse at top, #dae7ff, #f3f6fa 60%);
}
.login-card {
  background: #fff;
  width: 400px;
  max-width: 100%;
  border-radius: 9px;
  padding: 34px 36px;
  box-shadow: 0 15px 50px #34537c15;
  border: 1px solid #e2e9f4;
}
.login-brand {
  background: var(--brand);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
  margin-bottom: 27px;
}
.login-brand img {
  height: 43px;
  max-width: 100%;
}
.login-card h1 {
  font-size: 23px;
  margin: 0 0 9px;
  text-align: center;
}
.login-card > p {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  margin: 0 0 27px;
}
.login-card label {
  font-size: 14px;
}
.password-input {
  position: relative;
}
.password-input input {
  padding-right: 58px;
}
.password-input button {
  position: absolute;
  right: 3px;
  top: 10px;
  bottom: 3px;
  padding: 0 10px;
  background: #fff;
  color: #7a8caf;
  font-size: 12px;
}
.back-link {
  display: block;
  text-align: center;
  font-size: 13px;
  color: var(--brand);
  margin-top: 21px;
}
.login-card > small {
  display: block;
  text-align: center;
  color: #9aa9bc;
  font-size: 11px;
  margin-top: 26px;
}
.admin-layout {
  min-height: 100vh;
}
.admin-sidebar {
  width: 230px;
  background: var(--sidebar);
  color: #c3cfde;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.sidebar-brand {
  height: 67px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1e2c40;
}
.sidebar-brand img {
  width: 195px;
  max-height: 46px;
  object-fit: contain;
}
.sidebar-title {
  color: #899bb5;
  font-size: 12px;
  padding: 23px 24px 10px;
}
.admin-sidebar nav {
  display: flex;
  flex-direction: column;
  margin-top: 6px;
}
.admin-sidebar nav button {
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #cad4e4;
  background: none;
  padding: 15px 22px;
  font-size: 14px;
  border-left: 3px solid transparent;
}
.admin-sidebar nav button span {
  color: #99afd0;
  font-size: 19px;
  width: 21px;
  text-align: center;
}
.admin-sidebar nav button.selected {
  background: #6387cd22;
  color: #fff;
  border-left-color: #7ea8f2;
}
.admin-sidebar nav button.selected span {
  color: #85aeef;
}
.admin-sidebar nav button:hover {
  background: #ffffff0b;
}
.sidebar-footer {
  margin-top: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-top: 1px solid #ffffff0b;
  font-size: 12px;
  color: #a5b6cf;
}
.sidebar-footer small {
  color: #6a7e99;
  font-size: 11px;
}
.admin-workspace {
  margin-left: 230px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.admin-header {
  height: 66px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  font-size: 13px;
  color: #8a98aa;
}
.admin-header > span b {
  font-weight: 400;
  padding: 0 14px;
  color: #bdc6d3;
}
.admin-header > span strong {
  color: #46576f;
  font-weight: 500;
}
.admin-header > div {
  display: flex;
  gap: 20px;
  align-items: center;
}
.admin-header > div > span:before {
  content: "A";
  background: #eaf0ff;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  width: 30px;
  border-radius: 50%;
  margin-right: 9px;
  font: 700 13px Arial;
}
.admin-header > div button {
  font-size: 12px;
  background: none;
  color: #7c8a9e;
}
#menu-toggle {
  display: none;
}
.admin-main {
  padding: 27px 30px;
  max-width: 1700px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}
.admin-page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 23px;
}
.admin-page-title h1 {
  margin: 0;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.admin-page-title p {
  color: var(--muted);
  margin: 8px 0 0;
  font-size: 13px;
}
.admin-page-title button {
  font-size: 12px;
}
.demo-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #eef4ff;
  border: 1px solid #dce7fb;
  border-radius: 5px;
  padding: 12px 15px;
  font-size: 12px;
  color: #677fa7;
  margin-bottom: 23px;
  line-height: 1.7;
}
.demo-notice > b {
  color: var(--brand);
  white-space: nowrap;
  padding: 3px 7px;
  border: 1px solid #cbdcfa;
  border-radius: 3px;
  font-size: 11px;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 19px;
  margin-bottom: 23px;
}
.metric-grid article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 23px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 2px #22314b02;
}
.metric-grid small {
  font-size: 13px;
  color: #687b96;
}
.metric-grid strong {
  font:
    600 35px/1.8 Arial,
    sans-serif;
  color: #354760;
}
.metric-grid article > span {
  font-size: 11px;
  color: #93a2b6;
}
.text-blue {
  color: #6387cd !important;
}
.text-green {
  color: #38a389 !important;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 23px;
  box-shadow: 0 1px 2px #22314b02;
}
.panel-head {
  padding: 18px 21px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 10px;
}
.panel-head h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}
.panel-head button {
  font-size: 12px;
}
.table-scroll {
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
  font-size: 12px;
}
.admin-table th {
  background: #fafbfd;
  color: #8191a8;
  font-weight: 500;
  border-bottom: 1px solid var(--line);
  padding: 13px 20px;
}
.admin-table td {
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
  color: #536780;
}
.admin-table tr:last-child td {
  border-bottom: 0;
}
.admin-table tr:hover td {
  background: #fcfdff;
}
.status-pill {
  display: inline-block;
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 3px;
  background: #eaf3ff;
  color: #557cb7;
}
.status-pill.completed {
  color: #2b9a73;
  background: #eaf8f1;
}
.status-pill.cancelled {
  color: #8795a8;
  background: #f0f2f5;
}
.table-numbers {
  display: flex;
  gap: 4px;
}
.table-ball {
  height: 24px;
  width: 24px;
  line-height: 24px;
  text-align: center;
  background: #e9effb;
  color: #4e74b1;
  border-radius: 50%;
  font: 600 11px/24px Arial;
}
.table-ball:last-child {
  background: #fae9e9;
  color: #d36262;
}
.table-muted {
  color: #9aa9be;
}
.table-actions {
  background: none;
  color: #d56868;
  padding: 3px;
  font-size: 12px;
}
.empty-state {
  text-align: center;
  color: #9cabc0;
  padding: 35px;
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 19px;
}
.quick-grid button {
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quick-grid button:hover {
  border-color: #b3c9ed;
}
.quick-grid b {
  font-weight: 500;
  color: #597fb9;
  font-size: 14px;
}
.quick-grid span {
  color: #93a2b6;
  font-size: 12px;
}
.filter-row {
  display: flex;
  gap: 15px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.filter-row label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 12px;
  color: #7a8ba4;
}
.filter-row select {
  font-size: 12px;
  width: 140px;
  margin: 0;
  padding: 6px 9px;
  min-height: 34px;
}
.panel-note {
  color: #8f9fb6;
  font-size: 12px;
  margin: 0;
  padding: 13px 20px;
  background: #fafbfd;
  line-height: 1.8;
}
.admin-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 17px 30px;
  font-size: 11px;
  color: #99a8bd;
  display: flex;
  justify-content: space-between;
  gap: 15px;
}
.form-dialog {
  width: calc(100% - 28px);
  max-width: 550px;
  border: 1px solid #dde5f0;
  border-radius: 7px;
  padding: 0;
  max-height: 88vh;
  box-shadow: 0 25px 100px #10203e33;
}
.form-dialog::backdrop {
  background: #1e2e4b77;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 23px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 2;
}
.modal-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}
.modal-head button {
  background: none;
  color: #a1aec1;
  font-size: 25px;
  line-height: 25px;
}
.modal-form,
.confirm-body {
  padding: 22px 23px;
}
.form-tip {
  background: #f5f8fc;
  color: #8092ab;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.8;
  margin: 0 0 20px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.midnight-draw-dialog {
  width: min(620px, calc(100vw - 24px));
}
.draw-special-panel {
  margin-bottom: 18px;
}
.draw-special-tip {
  margin: 0;
  padding: 10px 12px;
  border-radius: 4px;
  background: #f5f8fc;
  color: #66788f;
  font-size: 12px;
  line-height: 1.8;
}
.draw-inline-field {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}
.draw-inline-title {
  font-weight: 500;
  color: var(--ink);
}
.draw-inline-options {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  min-height: 42px;
}
.draw-inline-options label {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
}
.draw-inline-options input[type="radio"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  appearance: auto;
  accent-color: #1677ff;
  flex: 0 0 auto;
}
.draw-special-numbers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.draw-special-readonly {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 16px;
}
.draw-special-readonly input[readonly] {
  background: #f7f9fc;
  color: #6d7e93;
}
.draw-special-note {
  margin-top: 4px;
}
.help-panel {
  padding: 25px;
}
.help-panel > h2 {
  font-size: 20px;
  font-weight: 500;
  margin: 0 0 25px;
}
.help-step {
  display: flex;
  gap: 17px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}
.help-step > b {
  height: 30px;
  width: 30px;
  flex: 0 0 30px;
  line-height: 30px;
  text-align: center;
  background: #eaf0fc;
  color: var(--brand);
  border-radius: 50%;
}
.help-step h3 {
  font-size: 14px;
  font-weight: 500;
  margin: 3px 0 8px;
}
.help-step p {
  font-size: 13px;
  line-height: 1.9;
  color: #8999af;
  margin: 0;
}
.help-warning {
  font-size: 13px;
  color: #ab7f45;
  background: #fff9ee;
  padding: 12px;
  border-radius: 4px;
  line-height: 1.8;
  margin-top: 25px;
}
.toast {
  position: fixed;
  bottom: 35px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  opacity: 0;
  pointer-events: none;
  background: #243c61ed;
  color: #fff;
  max-width: 90vw;
  border-radius: 5px;
  padding: 12px 20px;
  font-size: 13px;
  z-index: 90;
  transition: 0.2s;
}
.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
@media (max-width: 1100px) {
  .admin-sidebar {
    width: 200px;
  }
  .admin-workspace {
    margin-left: 200px;
  }
  .admin-main {
    padding: 24px 20px;
  }
  .metric-grid {
    gap: 12px;
  }
  .metric-grid article {
    padding: 18px;
  }
  .quick-grid {
    gap: 12px;
  }
  .quick-grid button {
    padding: 18px;
  }
  .admin-table th,
  .admin-table td {
    padding-left: 15px;
    padding-right: 15px;
  }
  .sidebar-brand img {
    width: 175px;
  }
  .draw-special-readonly {
    grid-template-columns: 1fr;
  }
  .draw-inline-field {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
@media (max-width: 760px) {
  .admin-sidebar {
    transform: translateX(-100%);
    transition: 0.2s;
    width: 220px;
    box-shadow: 8px 0 30px #16264533;
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-workspace {
    margin-left: 0;
  }
  .admin-header {
    padding: 0 17px;
    height: 58px;
  }
  .admin-header > span {
    flex: 1;
    margin-left: 13px;
    font-size: 12px;
  }
  .admin-header > span b {
    padding: 0 8px;
  }
  .admin-header > div {
    gap: 10px;
  }
  .admin-header > div > span {
    font-size: 0;
  }
  .admin-header > div > span:before {
    font-size: 12px;
    margin: 0;
    height: 27px;
    width: 27px;
  }
  #menu-toggle {
    display: block;
    background: none;
    color: #617897;
    font-size: 20px;
  }
  .admin-main {
    padding: 20px 14px;
  }
  .admin-page-title {
    margin-bottom: 17px;
  }
  .admin-page-title h1 {
    font-size: 22px;
  }
  .admin-page-title p {
    font-size: 12px;
  }
  .admin-page-title button {
    padding: 8px 10px;
    font-size: 11px;
  }
  .demo-notice {
    padding: 10px;
    font-size: 11px;
    gap: 7px;
    margin-bottom: 17px;
  }
  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 17px;
  }
  .metric-grid article {
    padding: 15px;
  }
  .metric-grid strong {
    font-size: 29px;
  }
  .quick-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .quick-grid button {
    padding: 17px;
    gap: 7px;
  }
  .panel {
    margin-bottom: 17px;
  }
  .panel-head {
    padding: 15px;
  }
  .filter-row {
    padding: 13px;
    gap: 10px;
  }
  .filter-row label {
    gap: 5px;
    flex: 1;
  }
  .filter-row select {
    width: 100%;
    min-width: 80px;
  }
  .admin-footer {
    padding: 15px;
    flex-direction: column;
    gap: 5px;
  }
  .admin-table th,
  .admin-table td {
    padding: 13px 12px;
  }
  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .draw-special-numbers,
  .draw-special-readonly {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .draw-inline-options {
    gap: 14px;
    min-height: 0;
  }
  .modal-form,
  .confirm-body {
    padding: 19px;
  }
  .modal-head {
    padding: 16px 19px;
  }
  .form-dialog {
    max-height: 85vh;
  }
  .login-card {
    padding: 29px 25px;
  }
  .help-panel {
    padding: 19px;
  }
  .help-panel > h2 {
    font-size: 18px;
  }
  .sidebar-footer {
    padding-bottom: 35px;
  }
}

/* 资料模板管理：仅扩展文章编辑与列表，不影响既有登录、开奖表单。 */
.article-panel-actions,
.article-row-actions,
.template-editor-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.article-panel-actions {
  justify-content: flex-end;
  font-size: 12px;
}
.article-admin-table .article-title-cell {
  min-width: 180px;
  max-width: 360px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.8;
}
.article-template-badge {
  display: inline-block;
  background: #eef3fc;
  color: #587bb5;
  border: 1px solid #dce7fa;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
}
.article-row-actions {
  flex-wrap: nowrap;
  gap: 12px;
}
.article-edit-action {
  color: var(--brand-dark);
}
.form-dialog.article-form-dialog {
  max-width: 760px;
}
.article-template-editor {
  min-width: 0;
  margin: 0 0 22px;
  padding: 17px;
  border: 1px solid #dce5f2;
  border-radius: 5px;
  background: #fafcfe;
}
.article-template-editor legend {
  padding: 0 8px;
  font-size: 14px;
  color: #4c6589;
  font-weight: 600;
}
.template-editor-actions {
  justify-content: space-between;
  font-size: 12px;
}
.template-editor-actions button {
  font-size: 12px;
}
.template-editor-note {
  margin: 12px 0 18px;
  color: #8092ab;
  font-size: 12px;
  line-height: 1.8;
}
.article-template-editor label:last-child {
  margin-bottom: 0;
}
.article-template-editor label small {
  line-height: 1.8;
  overflow-wrap: anywhere;
}
#article-template-headers,
#article-template-rows,
#article-template-images {
  font-family: "Microsoft YaHei", "PingFang SC", ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.8;
}
#article-template-description {
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  [data-panel="articles"] .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .article-panel-actions {
    justify-content: flex-start;
    gap: 10px 14px;
  }
  .article-template-editor {
    padding: 13px;
  }
}
