/* 发卡网前台样式（自写，对标参考站观感：浅色底、白卡片、橙色点缀） */
* { box-sizing: border-box; }
body { margin: 0; background: #f5f7fa; color: #333; font: 14px/1.6 "PingFang SC", "Microsoft YaHei", sans-serif; }
a { color: #007aff; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* 顶部导航 */
.topbar { background: #fff; border-bottom: 1px solid #e8e8e8; position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 0 16px; height: 56px; display: flex; align-items: center; gap: 24px; }
.logo { font-size: 18px; font-weight: bold; color: #ff5000; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.topnav { display: flex; align-items: center; gap: 18px; margin-left: auto; flex-wrap: wrap; }
.topnav a { color: #333; }
.topnav a:hover { color: #ff5000; }
.nav-user { color: #e67e22; font-weight: bold; }
.cart-badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #ff3b30; color: #fff; font-size: 12px; line-height: 18px; text-align: center; }

/* 布局 */
.container { max-width: 1200px; margin: 20px auto; padding: 0 16px; }
.card { background: #fff; border: 1px solid #e8e8e8; border-radius: 8px; padding: 16px 20px; margin-bottom: 16px; }
.card h2, .card h3 { margin: 0 0 12px; font-size: 16px; }
.layout { display: flex; gap: 16px; align-items: flex-start; }
.sidebar { width: 240px; flex-shrink: 0; }
.main { flex: 1; min-width: 0; }
.flash { background: #fff8e6; border: 1px solid #ffd591; color: #d46b08; border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; }
.error { background: #fff1f0; border: 1px solid #ffa39e; color: #cf1322; border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; }
.success { background: #f6ffed; border: 1px solid #b7eb8f; color: #389e0d; border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; }
.muted { color: #999; font-size: 13px; }
.orange { color: #e67e22; }

/* 公告区 */
.notice p { margin: 6px 0; }
.notice .notice-title { font-weight: bold; }
.notice .risk { color: #ff3b30; }

/* 分类树 */
.cat-tree { list-style: none; margin: 0; padding: 0; }
.cat-tree li { margin: 2px 0; }
.cat-tree a { display: flex; justify-content: space-between; align-items: center; color: #333; padding: 6px 8px; border-radius: 6px; }
.cat-tree a:hover, .cat-tree a.active { background: #fff2e8; color: #ff5000; text-decoration: none; }
.cat-tree ul { list-style: none; margin: 0; padding-left: 18px; }
.cat-tree .count-badge { background: #f0f0f0; color: #666; border-radius: 10px; font-size: 12px; min-width: 22px; text-align: center; padding: 0 6px; line-height: 18px; }
.cat-tree a.active .count-badge { background: #ff5000; color: #fff; }

/* 商品表 */
table { width: 100%; border-collapse: collapse; }
.product-table th, .product-table td { padding: 12px 8px; border-bottom: 1px solid #f0f0f0; text-align: left; vertical-align: middle; }
.product-table th { color: #999; font-weight: normal; font-size: 13px; }
.product-cell { display: flex; align-items: center; gap: 12px; }
.product-thumb { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 1px solid #eee; flex-shrink: 0; }
.product-name { font-size: 14px; }
.product-tag { color: #e67e22; font-weight: bold; }
.price { color: #ff5000; font-size: 16px; font-weight: bold; }
.stock-num { font-size: 15px; }
.stock-empty { color: #ff3b30; }

/* 按钮 */
.btn { display: inline-block; border: none; border-radius: 6px; padding: 8px 18px; font-size: 14px; cursor: pointer; background: #ff5000; color: #fff; }
.btn:hover { background: #e64800; text-decoration: none; }
.btn:disabled { background: #ccc; cursor: not-allowed; }
.btn-green { background: #34c759; }
.btn-green:hover { background: #28a745; }
.btn-blue { background: #007aff; }
.btn-blue:hover { background: #0066d6; }
.btn-gray { background: #f0f0f0; color: #333; }
.btn-gray:hover { background: #e0e0e0; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-danger { background: #ff3b30; }
.btn-danger:hover { background: #e02b20; }

/* 表单 */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; margin-bottom: 4px; font-weight: bold; }
.form-row input[type=text], .form-row input[type=email], .form-row input[type=password],
.form-row input[type=number], .form-row select, .form-row textarea { width: 100%; max-width: 420px; padding: 9px 10px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 14px; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline: none; border-color: #ff5000; }
.pay-option { display: block; padding: 10px 12px; border: 1px solid #d9d9d9; border-radius: 6px; margin-bottom: 8px; max-width: 420px; cursor: pointer; }
.pay-option input { margin-right: 8px; }

/* 面包屑 */
.crumb { color: #999; margin-bottom: 12px; font-size: 13px; }
.crumb a { color: #666; }

/* 数量选择器 */
.qty-box { display: inline-flex; align-items: center; gap: 0; }
.qty-box button { width: 32px; height: 34px; border: 1px solid #d9d9d9; background: #fff; font-size: 16px; cursor: pointer; }
.qty-box button:first-child { border-radius: 6px 0 0 6px; }
.qty-box button:last-child { border-radius: 0 6px 6px 0; }
.qty-box input { width: 56px; height: 34px; border: 1px solid #d9d9d9; border-left: none; border-right: none; text-align: center; font-size: 14px; }

/* 详情页 */
.item-head { display: flex; gap: 20px; align-items: flex-start; }
.item-head img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 1px solid #eee; }
.item-price { font-size: 22px; }
.item-meta { color: #666; margin: 6px 0; }
.item-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.detail-body { line-height: 1.8; }
.cards-list { background: #f6ffed; border: 1px solid #b7eb8f; border-radius: 6px; padding: 12px 14px; font-family: monospace; word-break: break-all; white-space: pre-wrap; }

/* 页脚 */
.footer { border-top: 1px solid #e8e8e8; margin-top: 30px; padding: 20px 0 30px; color: #999; font-size: 13px; text-align: center; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

@media (max-width: 768px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; }
  .topbar-inner { height: auto; padding: 10px 16px; flex-wrap: wrap; }
}
