/* ============================================================
   迪诺斯DOS 管理后台样式
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f3f4f6; color: #111827; font-size: 14px; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* 侧边栏 */
.admin-sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: 220px;
  background: #111827; color: #d1d5db; display: flex; flex-direction: column; z-index: 50;
}
.admin-logo { padding: 22px 20px; font-size: 18px; font-weight: 800; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); line-height: 1.3; }
.admin-logo em { font-style: normal; }
.admin-logo span { display: block; font-size: 11px; font-weight: 500; color: #6b7280; margin-top: 4px; letter-spacing: 2px; }
.admin-nav { padding: 14px 0; flex: 1; overflow-y: auto; }
.admin-nav-group {
  padding: 12px 22px 4px; font-size: 11px; color: #6b7280;
  letter-spacing: 1px; text-transform: uppercase; font-weight: 600;
}
.admin-nav a {
  display: block; padding: 10px 22px; font-size: 14px; color: #9ca3af;
  transition: all .2s; border-left: 3px solid transparent;
}
.admin-nav a:hover { color: #fff; background: rgba(255,255,255,.05); }
.admin-nav a.active { color: #fff; background: rgba(255,255,255,.08); border-left-color: #fff; font-weight: 600; }
.admin-sidebar-foot { padding: 18px 20px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 10px; }
.admin-sidebar-foot a { font-size: 13px; color: #9ca3af; }
.admin-sidebar-foot a:hover { color: #fff; }

/* 主区域 */
.admin-main { margin-left: 220px; min-height: 100vh; }
.admin-topbar {
  background: #fff; padding: 18px 28px; display: flex; align-items: center;
  justify-content: space-between; border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 40;
}
.admin-topbar h1 { font-size: 18px; font-weight: 700; }
.admin-user { font-size: 14px; color: #6b7280; }
.admin-content { padding: 28px; }

/* 卡片 */
.card { background: #fff; border-radius: 12px; padding: 24px; margin-bottom: 20px; border: 1px solid #e5e7eb; }
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 12px; padding: 22px; border: 1px solid #e5e7eb; }
.stat-num { font-size: 30px; font-weight: 800; }
.stat-label { font-size: 13px; color: #6b7280; margin-top: 6px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; }
th { background: #f9fafb; font-size: 12px; color: #6b7280; font-weight: 600; text-align: left; padding: 12px 14px; border-bottom: 1px solid #e5e7eb; white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid #f3f4f6; font-size: 13px; vertical-align: middle; }
tr:hover td { background: #fafafa; }
.table-wrap { overflow-x: auto; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 18px; border-radius: 6px; font-size: 13px; font-weight: 600; border: none; transition: all .2s; }
.btn-dark { background: #111827; color: #fff; }
.btn-dark:hover { background: #000; }
.btn-light { background: #f3f4f6; color: #374151; }
.btn-light:hover { background: #e5e7eb; }
.btn-red { background: #fef2f2; color: #dc2626; }
.btn-red:hover { background: #fee2e2; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: #6b7280; }
.btn-ghost:hover { color: #111827; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.form-control { width: 100%; padding: 10px 14px; border: 1px solid #e5e7eb; border-radius: 8px; outline: none; font-size: 14px; background: #fff; }
.form-control:focus { border-color: #111827; }
textarea.form-control { min-height: 110px; resize: vertical; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* 徽章 */
.tag { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.tag-gray { background: #f3f4f6; color: #6b7280; }
.tag-green { background: #ecfdf5; color: #059669; }
.tag-red { background: #fef2f2; color: #dc2626; }
.tag-blue { background: #eff6ff; color: #2563eb; }
.tag-yellow { background: #fef3c7; color: #b45309; }

/* 提示 */
.tip { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.tip-ok { background: #ecfdf5; color: #059669; }
.tip-err { background: #fef2f2; color: #dc2626; }

/* 分页 */
.pagination { display: flex; gap: 6px; margin-top: 18px; }
.pagination a, .pagination span { min-width: 32px; height: 32px; padding: 0 8px; border-radius: 6px; border: 1px solid #e5e7eb; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; color: #374151; background: #fff; }
.pagination .active { background: #111827; color: #fff; border-color: #111827; }

/* 图片缩略 */
.img-thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; border: 1px solid #e5e7eb; }

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #0f1729; }
.login-card { background: #fff; border-radius: 14px; padding: 40px; width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-card h1 { font-size: 22px; text-align: center; }
.login-card .sub { text-align: center; color: #6b7280; font-size: 13px; margin: 8px 0 24px; }
.login-card input { margin-bottom: 14px; }
.login-btn { width: 100%; padding: 12px; background: #111827; color: #fff; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; }
.login-btn:hover { background: #000; }

/* 响应式 */
@media (max-width: 1024px) {
  .admin-sidebar { width: 60px; }
  .admin-logo span, .admin-nav a { font-size: 0; }
  .admin-nav a { padding: 14px 0; text-align: center; }
  .admin-main { margin-left: 60px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

/* 仪表盘扩展 */
.stat-card em { display: block; font-style: normal; font-size: 12px; color: #6b7280; margin-top: 2px; }
.dash-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.todo-list { display: flex; flex-direction: column; gap: 8px; }
.todo-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-radius: 8px; background: #f9fafb;
  color: #111827; font-size: 14px; text-decoration: none; transition: all .15s;
}
.todo-item:hover { background: #f3f4f6; }
.todo-num { font-weight: 700; font-size: 15px; }
.quick-ops { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.qop-item {
  padding: 12px 8px; text-align: center; background: #f9fafb; border-radius: 8px;
  color: #111827; font-size: 13px; text-decoration: none; transition: all .15s;
}
.qop-item:hover { background: #111827; color: #fff; }
.hc-mini { display: flex; flex-wrap: wrap; gap: 8px; }
.hc-mini a {
  padding: 8px 14px; background: #f9fafb; border-radius: 8px; color: #111827;
  font-size: 13px; text-decoration: none; transition: all .15s;
}
.hc-mini a:hover { background: #111827; color: #fff; }

/* 首页内容管理 */
.hc-desc { color: #6b7280; font-size: 13px; margin: 0 0 16px; }
.hc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.hc-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px; border: 1px solid #e5e7eb; border-radius: 12px;
  color: #111827; text-decoration: none; transition: all .2s;
}
.hc-card:hover { border-color: #111827; box-shadow: 0 6px 20px rgba(0,0,0,.06); transform: translateY(-2px); }
.hc-num { font-size: 22px; font-weight: 800; color: #111827; }
.hc-name { font-size: 15px; font-weight: 600; }
.hc-tip { font-size: 12px; color: #6b7280; }
.code-area { font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 1.6; }

/* 订单管理 */
.ord-tabs { float: right; display: flex; gap: 6px; }
.ord-tab {
  padding: 6px 14px; border-radius: 8px; font-size: 13px;
  background: #f3f4f6; color: #6b7280; text-decoration: none;
}
.ord-tab.active { background: #111827; color: #fff; }
.btn-active { background: #111827 !important; color: #fff !important; border-color: #111827 !important; }
.ord-status {
  display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px;
  background: #f3f4f6; color: #6b7280;
}
.ord-pending { background: #fef3c7; color: #92400e; }
.ord-confirmed { background: #dbeafe; color: #1e40af; }
.ord-paid { background: #dcfce7; color: #166534; }
.ord-shipped { background: #e0e7ff; color: #3730a3; }
.ord-done { background: #dcfce7; color: #166534; }
.ord-cancelled { background: #fee2e2; color: #991b1b; }

@media (max-width: 900px) {
  .dash-row { grid-template-columns: 1fr; }
  .hc-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-ops { grid-template-columns: repeat(2, 1fr); }
  .ord-tabs { float: none; display: block; margin-top: 8px; }
}
@media (max-width: 640px) {
  .hc-grid { grid-template-columns: 1fr; }
}
