* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #f5f7fa;
  color: #2c3e50;
  line-height: 1.6;
}
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* 顶栏 */
.topbar {
  background: #1f2937;
  color: #fff;
  padding: 14px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.topbar-inner { display: flex; justify-content: space-between; align-items: center; }
.brand { color: #fff; text-decoration: none; font-size: 18px; font-weight: 600; }
.nav a {
  color: #d1d5db;
  margin-left: 18px;
  text-decoration: none;
  font-size: 14px;
  transition: color .2s;
}
.nav a:hover { color: #fff; }
.nav .nav-admin { color: #fbbf24; font-weight: 600; }
.nav .nav-logout { color: #f87171; }

/* 内容 */
.content { padding: 30px 20px 60px; min-height: calc(100vh - 130px); }
.footer {
  background: #1f2937;
  color: #9ca3af;
  text-align: center;
  padding: 16px 0;
  font-size: 13px;
}

/* hero */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 60px 40px;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 40px;
}
.hero h1 { font-size: 32px; margin-bottom: 16px; }
.hero-sub { font-size: 16px; opacity: .95; max-width: 720px; margin: 0 auto 24px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* 按钮 */
.btn {
  display: inline-block;
  padding: 10px 22px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
  transition: all .2s;
}
.btn:hover { background: #f3f4f6; }
.btn-primary { background: #3b82f6; border-color: #3b82f6; color: #fff; }
.btn-primary:hover { background: #2563eb; }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-danger { background: #ef4444; border-color: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }

/* 卡片 */
.card {
  background: #fff;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  margin-bottom: 20px;
}
.card h3 { margin-bottom: 14px; color: #1f2937; }
.auth-card { max-width: 420px; margin: 30px auto; }
.auth-card h2 { text-align: center; margin-bottom: 20px; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; color: #4b5563; }
.form-group input, .form-group select, .form-group textarea,
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=file], select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  font-size: 14px;
  font-family: inherit;
}
.form-msg { color: #ef4444; font-size: 13px; min-height: 18px; margin-top: 8px; }
.auth-foot { text-align: center; margin-top: 16px; font-size: 14px; color: #6b7280; }
.auth-foot a, .form-msg a { color: #3b82f6; }
.demo-tip { margin-top: 14px; padding: 8px; background: #fef3c7; border-radius: 4px; font-size: 12px; color: #92400e; text-align: center; }

/* features */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 20px; }
.feature-card {
  background: #fff;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.feature-card h3 { margin-bottom: 10px; color: #1f2937; }
.feature-card p { color: #6b7280; font-size: 14px; }

/* 产品 */
.filter-bar { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.filter-bar label { display: flex; align-items: center; gap: 4px; font-size: 14px; }
.filter-bar input[type=text], .filter-bar select { width: auto; min-width: 160px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 20px; }
.product-card {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  display: flex;
  flex-direction: column;
}
.product-card h3 { margin-bottom: 8px; }
.product-card .desc { color: #6b7280; font-size: 13px; flex: 1; margin-bottom: 12px; }
.product-card .meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 13px; }
.badge { padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.badge-web { background: #dbeafe; color: #1e40af; }
.badge-desktop { background: #fef3c7; color: #92400e; }
.price { color: #ef4444; font-weight: 600; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #e5e7eb; font-size: 14px; }
th { background: #f9fafb; font-weight: 600; color: #374151; }
tr:hover { background: #f9fafb; }
.mono { font-family: Consolas, Monaco, monospace; font-size: 13px; }
.doc-table th { background: #f3f4f6; }
.doc-table code { background: #f3f4f6; padding: 2px 6px; border-radius: 3px; font-size: 13px; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid #e5e7eb; margin-bottom: 20px; }
.tab {
  padding: 10px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #6b7280;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.tab.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* 状态标签 */
.status { padding: 3px 10px; border-radius: 12px; font-size: 12px; display: inline-block; }
.status-inactive { background: #e5e7eb; color: #4b5563; }
.status-active { background: #d1fae5; color: #065f46; }
.status-expired { background: #fee2e2; color: #991b1b; }
.status-revoked { background: #fef3c7; color: #92400e; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-paid { background: #d1fae5; color: #065f46; }
.status-failed { background: #fee2e2; color: #991b1b; }

/* 弹窗 */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal.hidden { display: none; }
.modal-content {
  background: #fff;
  padding: 28px;
  border-radius: 8px;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-content h3 { margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* 统计 */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 16px; margin-bottom: 30px; }
.stat-card {
  background: #fff;
  padding: 18px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.stat-card .label { font-size: 13px; color: #6b7280; }
.stat-card .value { font-size: 26px; font-weight: 700; color: #1f2937; margin-top: 4px; }

/* alert */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 20px; font-size: 14px; }
.alert-info { background: #eff6ff; color: #1e40af; border-left: 4px solid #3b82f6; }
.alert b { color: #1e3a8a; }

.license-info { margin-top: 12px; padding: 10px; background: #f9fafb; border-radius: 4px; font-size: 13px; }
.empty { text-align: center; padding: 30px; color: #9ca3af; }
code { background: #f3f4f6; padding: 2px 6px; border-radius: 3px; font-family: Consolas, monospace; }
