/* ===== 星轨二维码 · 网页版 全局样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #4a6cf7;
  --primary-dark: #3a5ae0;
  --primary-light: #eef1fe;
  --success: #52c41a;
  --warning: #faad14;
  --danger: #ea6668;
  --text: #1a1b1c;
  --text-secondary: #6b7280;
  --bg: #f5f6fa;
  --card: #ffffff;
  --border: #e4e3dd;
  --sidebar: #1e2132;
  --sidebar-hover: #2a2e45;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== 布局 ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 210px; flex-shrink: 0; background: var(--sidebar);
  color: #fff; display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
}
.sidebar-logo {
  padding: 18px 20px; font-size: 17px; font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 8px;
}
.sidebar-logo .dot {
  width: 28px; height: 28px; border-radius: 7px;
  background: linear-gradient(135deg, var(--primary), #7c9bff);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 8px; color: #b8bdd0;
  font-size: 14px; cursor: pointer; margin-bottom: 2px;
  transition: all .15s;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item .icon { width: 18px; text-align: center; font-size: 15px; }
.main { flex: 1; margin-left: 210px; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px; background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 16px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-search {
  flex: 1; max-width: 360px; position: relative;
}
.topbar-search input {
  width: 100%; padding: 7px 12px 7px 34px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; outline: none;
}
.topbar-search input:focus { border-color: var(--primary); }
.topbar-search::before {
  content: "🔍"; position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%); font-size: 13px; opacity: .5;
}
.topbar-user {
  margin-left: auto; display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-secondary); cursor: pointer;
}
.topbar-user .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
}
.content { flex: 1; padding: 20px 24px; }

/* ===== 卡片 ===== */
.card {
  background: var(--card); border-radius: 10px; padding: 18px 20px;
  margin-bottom: 16px; border: 1px solid rgba(0,0,0,0.04);
}
.card-title {
  font-size: 15px; font-weight: 600; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between;
}

/* ===== 统计卡片 ===== */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 16px;
}
.stat-card {
  background: var(--card); border-radius: 10px; padding: 16px 18px;
  border: 1px solid rgba(0,0,0,0.04);
}
.stat-card .label { font-size: 12px; color: var(--text-secondary); }
.stat-card .value { font-size: 26px; font-weight: 700; margin-top: 4px; }
.stat-card .sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.stat-card.primary { background: linear-gradient(135deg, var(--primary), #7c9bff); color: #fff; }
.stat-card.primary .label, .stat-card.primary .sub { color: rgba(255,255,255,0.85); }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
table.data-table th {
  text-align: left; padding: 10px 12px; background: #f8f9fc;
  color: var(--text-secondary); font-weight: 600; font-size: 12px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data-table td {
  padding: 10px 12px; border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
table.data-table tr:hover { background: #fafbff; }
table.data-table .qr-thumb {
  width: 40px; height: 40px; border-radius: 6px; object-fit: cover;
  border: 1px solid var(--border);
}
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 16px; border-radius: 7px; font-size: 13px;
  cursor: pointer; border: 1px solid transparent;
  transition: all .15s; font-weight: 500;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-default { background: #fff; color: var(--text); border-color: var(--border); }
.btn-default:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; text-decoration: none; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.form-control {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: 7px; font-size: 13px; outline: none; background: #fff;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74,108,247,0.1); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 200px; }
.form-hint { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* ===== 标签/徽章 ===== */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 500;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: #e8f8e8; color: var(--success); }
.badge-warning { background: #fff7e6; color: var(--warning); }
.badge-danger { background: #fff0f0; color: var(--danger); }
.badge-gray { background: #f0f0f0; color: var(--text-secondary); }

/* ===== 类型标签（6种码类型） ===== */
.type-tag {
  display: inline-block; padding: 2px 8px; border-radius: 5px;
  font-size: 11px; font-weight: 500;
}
.type-text { background: #e8f0fe; color: #1a73e8; }
.type-url { background: #e6f7ee; color: #0d9e4f; }
.type-image { background: #fef0e6; color: #e8710a; }
.type-video { background: #f3e8fe; color: #8b3ff0; }
.type-audio { background: #e6f9fb; color: #0891b2; }
.type-file { background: #fef0f0; color: #dc2626; }
.type-mixed { background: #f0f0f0; color: #555; }

/* ===== 登录页 ===== */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}
.login-box {
  background: #fff; border-radius: 14px; padding: 36px 32px;
  width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.login-logo {
  text-align: center; margin-bottom: 24px;
}
.login-logo .icon {
  width: 56px; height: 56px; border-radius: 14px; margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--primary), #7c9bff);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #fff;
}
.login-logo h2 { font-size: 20px; font-weight: 700; }
.login-logo p { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.login-tabs {
  display: flex; gap: 0; margin-bottom: 20px; border-bottom: 2px solid var(--border);
}
.login-tab {
  flex: 1; text-align: center; padding: 10px; cursor: pointer;
  font-size: 14px; color: var(--text-secondary); border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.login-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ===== 创建码双栏 ===== */
.create-layout { display: flex; gap: 16px; flex-wrap: wrap; }
.create-form { flex: 1; min-width: 320px; }
.create-preview {
  width: 320px; flex-shrink: 0; position: sticky; top: 80px; align-self: flex-start;
}
.type-tabs {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px;
}
.type-tab {
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border);
  cursor: pointer; font-size: 13px; background: #fff; transition: all .15s;
}
.type-tab:hover { border-color: var(--primary); }
.type-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.qr-preview-box {
  background: #fff; border-radius: 10px; padding: 20px; text-align: center;
  border: 1px solid var(--border);
}
.qr-preview-box img { max-width: 100%; border-radius: 8px; }
.qr-preview-placeholder {
  width: 200px; height: 200px; margin: 0 auto;
  border: 2px dashed var(--border); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 13px;
}

/* ===== 上传区域 ===== */
.upload-area {
  border: 2px dashed var(--border); border-radius: 10px; padding: 24px;
  text-align: center; cursor: pointer; transition: all .15s;
  background: #fafbff;
}
.upload-area:hover { border-color: var(--primary); background: var(--primary-light); }
.upload-area .up-icon { font-size: 32px; margin-bottom: 8px; }
.upload-area .up-text { font-size: 13px; color: var(--text-secondary); }
.upload-list { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.upload-item {
  width: 72px; height: 72px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border); position: relative;
}
.upload-item img { width: 100%; height: 100%; object-fit: cover; }
.upload-item .remove {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px;
  background: rgba(0,0,0,0.5); color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; cursor: pointer;
}

/* ===== 分页 ===== */
.pagination {
  display: flex; gap: 6px; justify-content: center; margin-top: 16px;
}
.pagination button {
  min-width: 32px; height: 32px; border: 1px solid var(--border);
  background: #fff; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* ===== 弹窗 ===== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal-box {
  background: #fff; border-radius: 12px; padding: 24px;
  width: 90%; max-width: 480px; max-height: 80vh; overflow-y: auto;
}
.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ===== 提示 ===== */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  padding: 10px 20px; border-radius: 8px; color: #fff; font-size: 13px;
  z-index: 2000; animation: slideDown .3s;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--primary); }
@keyframes slideDown { from { opacity: 0; transform: translate(-50%, -20px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ===== 工具卡片 ===== */
.tool-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.tool-card {
  background: #fff; border-radius: 10px; padding: 22px 18px;
  text-align: center; cursor: pointer; border: 1px solid var(--border);
  transition: all .15s;
}
.tool-card:hover { border-color: var(--primary); box-shadow: 0 4px 12px rgba(74,108,247,0.1); transform: translateY(-2px); }
.tool-card .tool-icon {
  width: 48px; height: 48px; border-radius: 12px; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.tool-card .tool-name { font-size: 14px; font-weight: 600; }
.tool-card .tool-desc { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* ===== 会员卡片 ===== */
.member-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.member-card {
  background: #fff; border-radius: 12px; padding: 22px;
  border: 2px solid var(--border); text-align: center; position: relative;
}
.member-card.recommended { border-color: var(--primary); }
.member-card .tag {
  position: absolute; top: -1px; right: 16px;
  background: var(--primary); color: #fff; font-size: 11px;
  padding: 3px 10px; border-radius: 0 0 6px 6px;
}
.member-card .name { font-size: 16px; font-weight: 700; }
.member-card .price { font-size: 32px; font-weight: 700; color: var(--primary); margin: 8px 0; }
.member-card .price small { font-size: 14px; color: var(--text-secondary); font-weight: 400; }
.member-card .features { text-align: left; font-size: 13px; color: var(--text-secondary); margin: 14px 0; }
.member-card .features li { list-style: none; padding: 4px 0; }
.member-card .features li::before { content: "✓ "; color: var(--success); font-weight: 700; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-logo span, .nav-item span { display: none; }
  .main { margin-left: 60px; }
  .create-preview { width: 100%; position: static; }
  .topbar-search { display: none; }
}
