* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary-color: #e53935;
  --primary-dark: #c62828;
  --secondary-color: #1976d2;
  --accent-color: #ff9800;
  --bg-color: #f5f5f5;
  --card-bg: #ffffff;
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-light: #999999;
  --border-color: #e0e0e0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: 20px;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary-color);
  box-shadow: var(--shadow-md);
}

.header-top {
  display: none;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  font-size: 24px;
}

.logo-text {
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 1px;
}

.welcome-text {
  font-size: 12px;
  opacity: 0.9;
}

.main-nav {
  background-color: var(--primary-color);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-bottom: 2px solid rgba(0,0,0,0.08);
  padding: 2px 0 4px;
}

.main-nav::-webkit-scrollbar {
  display: none;
}

.nav-scroll {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: min-content;
  padding: 0 4px;
  width: 100%;
  box-sizing: border-box;
  gap: 0 0;
}

@media (min-width: 560px) {
  .nav-scroll {
    grid-template-columns: repeat(11, minmax(0, 1fr));
  }
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 4px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  position: relative;
  transition: all 0.2s;
  letter-spacing: 0.2px;
  text-align: center;
  line-height: 1.2;
  flex-shrink: 0;
}

.nav-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background-color: #ffeb3b;
  border-radius: 2px 2px 0 0;
  transition: width 0.25s;
}

.nav-item:hover,
.nav-item.active {
  color: #ffffff;
  background-color: rgba(255,255,255,0.08);
}

.nav-item.active::after {
  width: 60%;
}

.app-main {
  max-width: 768px;
  margin: 0 auto;
  padding: 12px;
}

.top-quick-section {
  background-color: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.quick-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 8px;
  background: linear-gradient(135deg, #fff5f5, #ffebee);
  border-radius: var(--radius-md);
  transition: all 0.2s;
  border: 1px solid transparent;
}

.quick-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
  background: linear-gradient(135deg, #ffebee, #ffcdd2);
}

.quick-card:active {
  transform: translateY(0);
}

.quick-icon {
  font-size: 28px;
  margin-bottom: 6px;
}

.quick-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary-color);
}

.breadcrumb {
  background-color: var(--card-bg);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.breadcrumb a {
  color: var(--secondary-color);
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb .sep {
  color: var(--text-light);
  margin: 0 2px;
}

.breadcrumb .current {
  color: var(--text-primary);
  font-weight: 500;
}

.sub-nav-section {
  background-color: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.section-title {
  font-size: 16px;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 12px;
  padding-left: 10px;
  border-left: 4px solid var(--primary-color);
}

.sub-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.sub-nav-item {
  padding: 10px 8px;
  background-color: #f8f8f8;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.2s;
  border: 1px solid transparent;
}

.sub-nav-item:hover {
  background-color: #fff3e0;
  color: var(--primary-color);
}

.sub-nav-item.active {
  background-color: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-dark);
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(229, 57, 53, 0.3);
}

.content-section {
  background-color: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 4px 0;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.content-list {
  padding: 0 4px;
}

.content-item {
  display: flex;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s;
  cursor: pointer;
}

.content-item:last-child {
  border-bottom: none;
}

.content-item:hover {
  background-color: #fafafa;
}

.content-item:active {
  background-color: #f5f5f5;
}

.item-index {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin-right: 12px;
  background: linear-gradient(135deg, #ff9800, #f57c00);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
}

.item-index.top-1 {
  background: linear-gradient(135deg, #ff5252, #d32f2f);
}

.item-index.top-2 {
  background: linear-gradient(135deg, #ff9800, #f57c00);
}

.item-index.top-3 {
  background: linear-gradient(135deg, #ffc107, #ffa000);
}

.item-title {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding-right: 8px;
}

.item-arrow {
  flex-shrink: 0;
  color: var(--text-light);
  font-size: 16px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 12px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background-color: #f5f5f5;
  color: var(--text-secondary);
  font-size: 13px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover {
  background-color: #e0e0e0;
  color: var(--text-primary);
}

.page-btn.active {
  background-color: var(--primary-color);
  color: #ffffff;
  font-weight: 500;
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hot-section {
  background-color: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.hot-title {
  font-size: 15px;
  font-weight: bold;
  color: var(--accent-color);
  margin-bottom: 12px;
}

.hot-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.hot-links a {
  display: block;
  padding: 10px 8px;
  background: linear-gradient(135deg, #fff8e1, #ffecb3);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  transition: all 0.2s;
}

.hot-links a:hover {
  background: linear-gradient(135deg, #ffecb3, #ffe082);
  color: var(--accent-color);
  transform: translateY(-1px);
}

.app-footer {
  max-width: 768px;
  margin: 0 auto;
  padding: 20px 16px;
  text-align: center;
  color: var(--text-light);
}

.footer-links {
  font-size: 12px;
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--secondary-color);
  margin: 0 4px;
}

.footer-links .sep {
  color: var(--border-color);
}

.footer-tip {
  font-size: 11px;
  margin-bottom: 8px;
  line-height: 1.8;
}

.footer-copyright {
  font-size: 11px;
}

.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(229, 57, 53, 0.4);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 99;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(229, 57, 53, 0.5);
}

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-light);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-state-text {
  font-size: 14px;
}

.draw-save-nums {
  display: flex;
  gap: 6px;
}
.draw-save-nums input {
  flex: 1 1 0;
  text-align: center;
}
.hint-label {
  color: #666;
  font-size: 12px;
  line-height: 1.6;
}

/* ============================================================
   DRAW RESULT SECTION (cpzj.com style 首页开奖块)
   ============================================================ */
.draw-result-section {
  background: #f5f5f5;
  border: 1px solid #ddd;
  margin-bottom: 10px;
  overflow: hidden;
}
.draw-header-ribbon {
  background: #fff;
  border-top: 3px solid #e53935;
  padding: 7px 10px 6px;
  position: relative;
}
.draw-header-ribbon::before,
.draw-header-ribbon::after {
  content: '';
  position: absolute;
  top: 0;
  width: 22px;
  height: 100%;
  background: linear-gradient(135deg, transparent 50%, #cfd8dc 50%, #b0bec5 100%);
  pointer-events: none;
  opacity: 0.45;
}
.draw-header-ribbon::before { left: 0; transform: scaleX(-1); }
.draw-header-ribbon::after { right: 0; }
.draw-header-title {
  margin: 0;
  text-align: center;
  font-size: 13px;
  font-weight: bold;
  color: #1565c0;
  letter-spacing: 0.5px;
}
.draw-history-title {
  text-align: center;
  padding: 8px 10px 5px;
}
.draw-history-link {
  color: #e53935;
  font-size: 14px;
  font-weight: bold;
  text-decoration: none;
  letter-spacing: 0.5px;
}
.draw-history-link:hover { text-decoration: underline; }
.draw-main-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 5px 10px 7px;
  flex-wrap: wrap;
}
.draw-logo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff59d 0%, #fdd835 22%, #1976d2 23%, #0d47a1 65%, #b71c1c 72%, #e53935 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 3px 8px rgba(0,0,0,0.22), inset 0 -2px 0 rgba(0,0,0,0.15);
  flex-shrink: 0;
}
.draw-logo::before {
  content: '♦';
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  color: #ff1744;
  font-size: 9px;
  text-shadow: 0 1px 0 #fff;
}
.draw-logo-inner {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  line-height: 1;
  margin-top: 4px;
  text-shadow: 0 1px 0 rgba(0,0,0,0.35);
}
.draw-logo-3 {
  font-size: 27px;
  color: #fff176;
  margin-right: 1px;
  transform: rotate(-6deg);
}
.draw-logo-d {
  font-size: 22px;
  color: #ffffff;
}
.draw-logo-knot {
  position: absolute;
  bottom: -8px;
  right: -3px;
  font-size: 12px;
  color: #ffeb3b;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.3));
}
.draw-ball-row {
  display: flex;
  gap: 9px;
}
.draw-ball {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 30px;
  font-weight: bold;
  font-family: Arial, sans-serif;
  box-shadow: 0 3px 7px rgba(0,0,0,0.22), inset 0 -3px 0 rgba(0,0,0,0.18);
  flex-shrink: 0;
}
.draw-ball-red {
  background: radial-gradient(circle at 32% 28%, #ff8a80 0%, #ef5350 40%, #c62828 100%);
  border: 2px solid #fff;
  outline: 1px solid rgba(198, 40, 40, 0.4);
}
.draw-shiji-row {
  padding: 3px 14px 2px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  line-height: 1.7;
}
.draw-shiji-label {
  color: #e53935;
  font-size: 13px;
  font-weight: bold;
}
.draw-shiji-number {
  color: #1565c0;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 1px;
  margin: 0 4px;
}
.draw-shiji-link {
  color: #1565c0;
  font-size: 13px;
  font-weight: bold;
  text-decoration: none;
  margin-left: 5px;
}
.draw-shiji-link:hover { text-decoration: underline; }
.draw-publish-row {
  padding: 0 14px 7px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  line-height: 1.7;
}
.draw-publish-label {
  color: #e53935;
  font-size: 12px;
  font-weight: bold;
}
.draw-publish-date {
  color: #e53935;
  font-size: 14px;
  font-weight: bold;
  margin-left: 4px;
  letter-spacing: 0.5px;
}
.draw-prize-wrap {
  padding: 0 10px 8px;
}
.draw-prize-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border: 1px solid #bdbdbd;
}
.draw-prize-table th,
.draw-prize-table td {
  border: 1px solid #bdbdbd;
  padding: 5px 4px;
  text-align: center;
  font-size: 9px;
}
.draw-prize-table thead th {
  background: #f5f5f5;
  color: #0d47a1;
  font-size: 10px;
  font-weight: bold;
}
.draw-prize-table tbody td:nth-child(1) {
  color: #222;
  font-size: 10px;
  font-weight: bold;
}
.draw-prize-table tbody td:nth-child(2) {
  color: #0d47a1;
  font-size: 11px;
  font-weight: bold;
}
.draw-prize-table tbody td:nth-child(3) {
  color: #e65100;
  font-size: 11px;
  font-weight: bold;
}

/* 开奖 / 试机号历史查询页 */
.kaijiang-section, .shiji-section {
  padding: 10px 8px 24px;
}
.kaijiang-tools {
  padding: 10px 4px 16px;
}
.kaijiang-search {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.kaijiang-search input[type=text] {
  flex: 1 1 200px;
  padding: 8px 10px;
  border: 1px solid #bdbdbd;
  border-radius: 4px;
  font-size: 14px;
}
.kaijiang-list {
  background: #fff;
  border: 1px solid #cfd8dc;
  border-radius: 6px;
  overflow: hidden;
}
.kj-grid-head,
.kj-grid-row {
  display: grid;
  grid-template-columns: 1.1fr 1.6fr 1.2fr;
}
.kj-grid-head {
  background: #1976d2;
  color: #fff;
  font-weight: bold;
}
.kj-grid-head > div,
.kj-grid-row > div {
  padding: 10px 8px;
  border-bottom: 1px solid #e0e0e0;
  text-align: center;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kj-grid-row:nth-child(even) { background: #fafafa; }
.kj-period {
  color: #0d47a1;
  font-weight: bold;
}
.kj-date { color: #455a64; }
.kj-nums { gap: 6px; }
.kj-ball {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: bold;
  font-size: 15px;
  margin: 0 3px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.kj-ball-red {
  background: radial-gradient(circle at 32% 28%, #ff8a80 0%, #ef5350 40%, #c62828 100%);
}
.kj-ball-blue {
  background: radial-gradient(circle at 32% 28%, #82b1ff 0%, #2979ff 40%, #0d47a1 100%);
}
.kj-empty {
  padding: 40px 10px;
  text-align: center;
  color: #90a4ae;
}
.shiji-today-card {
  border: 2px solid #ffb74d;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff8e1, #fff3e0);
  margin-bottom: 16px;
  overflow: hidden;
}
.shiji-today-head {
  background: #fb8c00;
  color: #fff;
  text-align: center;
  padding: 8px;
  font-weight: bold;
  font-size: 15px;
}
.shiji-today-body {
  padding: 12px;
  text-align: center;
}
.shiji-today-period,
.shiji-today-date {
  color: #4e342e;
  font-size: 13px;
  margin: 4px 0;
}
.shiji-today-numbers {
  font-size: 44px;
  font-weight: bold;
  color: #0d47a1;
  letter-spacing: 8px;
  margin: 8px 0;
  font-family: Arial, sans-serif;
}

@media (max-width: 360px) {
  .draw-logo { width: 46px; height: 46px; }
  .draw-logo-3 { font-size: 22px; }
  .draw-logo-d { font-size: 18px; }
  .draw-ball { width: 40px; height: 40px; font-size: 24px; }
  .draw-ball-row { gap: 6px; }
  .draw-header-title { font-size: 11px; }
  .draw-history-link { font-size: 11px; }
  .draw-shiji-label { font-size: 11px; }
  .draw-shiji-number { font-size: 13px; }
  .draw-shiji-link { font-size: 11px; }
  .draw-publish-label { font-size: 10px; }
  .draw-publish-date { font-size: 11px; }
  .quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 480px) {
  .sub-nav {
    grid-template-columns: repeat(6, 1fr);
  }

  .hot-links {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 768px) {
  html {
    font-size: 15px;
  }

  .app-main {
    padding: 16px;
  }

  .hot-links {
    grid-template-columns: repeat(5, 1fr);
  }

  .quick-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ==================== DETAIL PAGE ==================== */
.detail-section {
  background: #fff;
  min-height: 80vh;
}
.detail-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 16px 14px 40px;
}
.detail-breadcrumb {
  font-size: 13px;
  color: #888;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.detail-breadcrumb a {
  color: #1976d2;
  text-decoration: none;
}
.detail-breadcrumb a:hover {
  text-decoration: underline;
}
.detail-breadcrumb span {
  color: #bbb;
}
.detail-cat {
  color: #444 !important;
  font-weight: 500;
}
.detail-title {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.4;
  margin: 0 0 12px;
  letter-spacing: 0.2px;
}
.detail-meta {
  font-size: 13px;
  color: #666;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px dashed #e5e5e5;
  margin-bottom: 18px;
}
.detail-meta .detail-period {
  color: var(--primary);
  font-weight: 600;
}
.detail-meta .detail-source {
  color: #1976d2;
  text-decoration: none;
}
.detail-meta .detail-source:hover {
  text-decoration: underline;
}
.detail-content {
  font-size: 15px;
  color: #222;
  line-height: 1.9;
  word-break: break-word;
}
.detail-content .detail-h3 {
  font-size: 17px;
  font-weight: 700;
  color: #0d47a1;
  border-left: 3px solid var(--primary);
  padding-left: 10px;
  margin: 22px 0 10px;
  line-height: 1.4;
}
.detail-content .detail-p {
  margin: 8px 0;
  text-indent: 2em;
}
.detail-content .detail-num {
  display: inline-block;
  min-width: 28px;
  padding: 2px 8px;
  margin: 0 3px;
  text-align: center;
  border-radius: 16px;
  background: linear-gradient(180deg, #ff5f5f 0%, #e53935 100%);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 1px 3px rgba(229,57,53,0.35);
}
.detail-content .detail-num.blue {
  background: linear-gradient(180deg, #4dabf5 0%, #1565c0 100%);
  box-shadow: 0 1px 3px rgba(21,101,192,0.35);
}
.detail-content .detail-num.gold {
  background: linear-gradient(180deg, #ffca59 0%, #ef8b00 100%);
  color: #4e342e;
  box-shadow: 0 1px 3px rgba(239,139,0,0.35);
}
.detail-content strong,
.detail-content b {
  color: var(--primary);
  font-weight: 700;
}
.detail-content .detail-empty {
  text-align: center;
  color: #999;
  padding: 50px 10px;
  font-size: 14px;
}
.detail-content ul.detail-list {
  margin: 8px 0;
  padding-left: 1.6em;
}
.detail-content ul.detail-list li {
  margin: 4px 0;
}
.detail-actions {
  margin: 28px 0 20px;
  display: flex;
  justify-content: center;
}
.detail-actions .btn {
  min-width: 140px;
  font-size: 15px;
  padding: 10px 18px;
}

/* ==================== LOGIN PAGE ==================== */
.login-section {
  min-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 120px;
  background: linear-gradient(135deg, var(--primary) 0%, #2a7bd6 100%);
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 28px 22px 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
}
.login-title {
  margin: 0 0 6px;
  font-size: 20px;
  text-align: center;
  color: #222;
}
.login-sub {
  margin: 0 0 20px;
  font-size: 13px;
  text-align: center;
  color: #888;
}
.login-field {
  margin-bottom: 14px;
}
.login-field label {
  display: block;
  font-size: 13px;
  color: #555;
  margin-bottom: 6px;
  font-weight: 600;
}
.login-field input {
  width: 100%;
  padding: 11px 12px;
  font-size: 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #fafafa;
}
.login-field input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(30,120,210,0.12);
}
.login-btn {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 8px;
  transition: transform 0.1s, box-shadow 0.15s, opacity 0.15s;
}
.login-btn:hover:not(:disabled) { opacity: 0.92; }
.login-btn:active:not(:disabled) { transform: translateY(1px); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.login-tip {
  margin: 14px 0 0;
  font-size: 12px;
  text-align: center;
  color: #999;
}
body.admin-login-pure {
  background: #ffffff;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}
body.admin-login-pure main.app-main,
body.admin-login-pure .app-main {
  display: block !important;
  background: #ffffff;
  min-height: 100vh;
  width: 100%;
}
body.admin-login-pure .login-section {
  background: #ffffff;
  min-height: 100vh;
  padding: 24px 16px;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}
body.admin-login-pure .login-card {
  border: 1px solid #e5e7eb;
}

/* ==================== ADMIN CONTROL PANEL (SIDE NAV LAYOUT) ==================== */
.admin-section {
  display: flex;
  min-height: 100vh;
  background: #ffffff;
  padding: 0;
  margin: 0;
}
.admin-sidebar {
  width: 240px;
  background: #ffffff;
  color: #374151;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e5e7eb;
  flex-shrink: 0;
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px 18px;
  border-bottom: 1px solid #e5e7eb;
}
.admin-brand-logo {
  width: 40px;
  height: 40px;
  background: #e53935;
  border-radius: 10px;
  position: relative;
  flex-shrink: 0;
  transform: rotate(45deg);
  box-shadow: 0 4px 12px rgba(229, 57, 53, 0.18);
}
.admin-brand-logo:before {
  content: '';
  position: absolute;
  top: 13px; left: 13px;
  width: 14px; height: 14px;
  background: #ffffff;
  border-radius: 3px;
  transform: rotate(-45deg);
}
.admin-brand-info {
  min-width: 0;
}
.admin-brand-title {
  font-size: 17px;
  font-weight: 700;
  color: #1f2937;
  letter-spacing: 0.3px;
}
.admin-brand-sub {
  font-size: 11px;
  letter-spacing: 1.2px;
  color: #6b7280;
  margin-top: 2px;
  text-transform: uppercase;
}
.admin-side-nav {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  flex: 1;
  overflow-y: auto;
}
.admin-side-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  font-size: 14px;
  color: #4b5563;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
  user-select: none;
  position: relative;
}
.admin-side-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #6b7280;
  flex-shrink: 0;
  transition: color .15s;
}
.admin-side-item:hover {
  background: #f9fafb;
  color: #111827;
}
.admin-side-item:hover .admin-side-icon { color: #e53935; }
.admin-side-item.active {
  background: #eff6ff;
  color: #1d4ed8;
  border-left-color: #3b82f6;
  font-weight: 600;
}
.admin-side-item.active .admin-side-icon { color: #3b82f6; }
.admin-side-dot {
  margin-left: auto;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4caf50;
  box-shadow: 0 0 0 3px rgba(76,175,80,0.18);
  animation: pulse 2s infinite;
}
.admin-side-dot-green { background: #4caf50; box-shadow: 0 0 0 3px rgba(76,175,80,0.18); }
.admin-side-user {
  padding: 14px 18px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  flex-wrap: wrap;
}
.admin-side-user > span:nth-child(2) {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #374151;
}
.admin-side-user > div { width: 100%; margin-top: 8px; }
.admin-side-logout {
  width: 100%;
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 12.5px;
  cursor: pointer;
  transition: all .15s;
}
.admin-side-logout:hover { background: #f44336; border-color: #f44336; color: #fff; }

.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  max-height: 100vh;
  overflow: hidden;
}
.admin-main-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
}
.admin-main-title h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #1f2230;
}
.admin-main-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: #6b7280;
}
.admin-main-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-top-user {
  font-size: 13px;
  color: #6b7280;
  padding-right: 4px;
}
.admin-panel {
  flex: 1;
  padding: 18px 20px 40px;
  overflow-y: auto;
}
.admin-change-pwd {
  padding: 0 20px 14px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding-top: 14px;
}
.admin-header {
  display: none;
}
.admin-user-info { display: none; }
.admin-section .section-title { display: none; }
.admin-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  border: 1px solid var(--border-light);
}
.admin-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #eef0f3;
  flex-wrap: wrap;
}
.admin-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #1f2230;
  flex: 1 0 180px;
}
.hint-label {
  display: inline-block !important;
  font-size: 12px !important;
  color: #8a8fa3 !important;
  font-weight: 400 !important;
  margin-left: auto !important;
  max-width: 60%;
  line-height: 1.6;
}
.admin-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #bbb;
  display: inline-block;
  flex-shrink: 0;
}
.admin-status-dot.ok { background: #4caf50; box-shadow: 0 0 0 3px rgba(76,175,80,0.15); animation: pulse 2s infinite; }
.admin-status-dot.err { background: #f44336; }
.admin-status-dot.warn { background: #ff9800; }
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}
.admin-status-text {
  font-size: 12px;
  color: #777;
  flex-shrink: 0;
}

.admin-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.admin-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-field > label:first-child {
  font-size: 12.5px;
  color: #4b5563;
  font-weight: 500;
}
.admin-field input[type="time"],
.admin-field input[type="number"],
.admin-field input[type="text"],
.admin-field input[type="password"],
.admin-field select,
.admin-field textarea {
  padding: 9px 11px;
  border: 1px solid #e3e5ec;
  border-radius: 8px;
  font-size: 14px;
  background: #fafbff;
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  resize: vertical;
}
.admin-field textarea { min-height: 64px; line-height: 1.7; }
.admin-field input:focus,
.admin-field select:focus,
.admin-field textarea:focus {
  border-color: var(--primary-color);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(229,57,53,0.08);
}
.admin-field input:disabled {
  opacity: 0.6;
  background: #f3f4f6;
  cursor: not-allowed;
}
.draw-save-nums {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.draw-save-nums input { text-align: center; font-weight: 600; }

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: 0.2s;
  border-radius: 26px;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider {
  background-color: var(--primary-color);
}
.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

/* Buttons */
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 6px 0 4px;
}
.btn {
  padding: 9px 15px;
  border: none;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  font-family: inherit;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.04); box-shadow: 0 3px 10px rgba(0,0,0,0.08); }
.btn:active { transform: translateY(0); filter: brightness(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; filter: none; box-shadow: none; }
.btn-primary { background: var(--primary-color); color: #fff; }
.btn-success { background: #2e7d32; color: #fff; }
.btn-info { background: #1565c0; color: #fff; }
.btn-warn { background: #e65100; color: #fff; }
.btn-danger { background: #c62828; color: #fff; }
.btn-small, .btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 7px; background: #f3f4f6; color: #4b5563; border: 1px solid #e5e7eb; }
.btn-sm.btn-primary { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }
.btn-sm.btn-danger { background: #ef4444; color: #fff; border-color: #ef4444; }

.admin-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.status-item {
  background: #f8f9fc;
  padding: 12px;
  border-radius: 9px;
  border: 1px solid #eef0f5;
}
.status-label {
  font-size: 12px;
  color: #8a8fa3;
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}
.status-value {
  font-size: 14px;
  color: #1f2230;
  font-weight: 600;
  word-break: break-all;
  line-height: 1.5;
}

.data-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  border-radius: 7px;
  margin-bottom: 5px;
  font-size: 13px;
  background: #f8f9fc;
}
.data-summary-row:nth-child(even) { background: #eef2ff; }
.data-summary-row .count { color: var(--primary-color); font-weight: 700; }

.log-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}
.log-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  background: #f8f9fc;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 13px;
  border: 1px solid transparent;
}
.log-item:hover { background: #eef2ff; border-color: #d6dcff; }
.log-item .log-meta {
  color: #8a8fa3;
  font-size: 11.5px;
}

.log-viewer {
  margin-top: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
}
.log-viewer-header {
  background: #f5f5f5;
  padding: 9px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
}
.log-viewer-content {
  max-height: 340px;
  overflow: auto;
  padding: 12px;
  font-size: 12px;
  background: #0d1117;
  color: #e6edf3;
  font-family: Consolas, 'Courier New', monospace;
  line-height: 1.65;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.cat-list-preview {
  padding: 10px 12px;
  background: #f8f9fc;
  border-radius: 9px;
  max-height: 440px;
  overflow-y: auto;
  font-size: 13px;
  color: #374151;
  line-height: 1.8;
  border: 1px solid #eef0f5;
}
.cat-list-preview .cat-row {
  padding: 6px 0;
  border-bottom: 1px dashed #e5e7eb;
  display: flex;
  gap: 10px;
}
.cat-list-preview .cat-row:last-child { border-bottom: none; }
.cat-list-preview .cat-idx { color: var(--primary-color); font-weight: 700; width: 32px; flex-shrink: 0; }
.cat-list-preview .cat-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-list-preview .cat-cat { color: #8a8fa3; font-size: 12px; }

.detail-preview-box {
  padding: 12px 14px;
  background: #fff8e1;
  border-radius: 9px;
  border: 1px dashed #f0c36d;
  font-size: 13.5px;
  line-height: 1.9;
  color: #5d4037;
  max-height: 480px;
  overflow-y: auto;
}
.detail-preview-box h4 { margin: 14px 0 6px; font-size: 14px; color: #3e2723; }

.seo-preview-box {
  margin-top: 12px;
  padding: 12px 14px;
  background: #0f172a;
  color: #cbd5e1;
  border-radius: 10px;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 12.5px;
  line-height: 1.7;
  max-height: 420px;
  overflow-y: auto;
}
.seo-preview-box .seo-line { margin: 2px 0; }
.seo-preview-box .seo-k { color: #d4ff3b; }
.seo-preview-box .seo-v { color: #93c5fd; }

.admin-toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 80px;
  padding: 10px 20px;
  border-radius: 22px;
  color: #fff;
  font-size: 13px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  max-width: 90%;
  text-align: center;
}
.admin-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}
.admin-toast.ok { background: #2e7d32; }
.admin-toast.err { background: #c62828; }
.admin-toast.info { background: #1565c0; }
.admin-toast.warn { background: #e65100; }

@media (max-width: 780px) {
  .admin-section { flex-direction: column; }
  .admin-sidebar {
    width: 100%;
    max-height: 48vh;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }
  .admin-side-nav {
    padding: 8px 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px;
  }
  .admin-side-item {
    padding: 10px 14px;
    font-size: 13px;
    border-left: none;
    border-top: 2px solid transparent;
  }
  .admin-side-item.active { border-left: none; border-top-color: #3b82f6; }
  .admin-main { max-height: none; }
  .admin-main-header { padding: 14px; }
  .admin-panel { padding: 14px; }
  .admin-change-pwd { padding: 12px 14px; }
}

