/* ===== 全局重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --primary: #667eea;
  --secondary: #764ba2;
  --success: #43e97b;
  --warning: #fa709a;
  --info: #4facfe;
  --orange: #ff9a44;
  --bg: #f5f7fa;
  --white: #ffffff;
  --text: #2d3748;
  --text-light: #718096;
  --border: #e2e8f0;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 16px;
  --sidebar-width: 240px;
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  font-size: 15px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { opacity: 0.85; }

/* ===== 容器 ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ===== 顶部导航（前台） ===== */
.navbar {
  background: var(--white);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.navbar-brand { font-size: 1.3rem; font-weight: 700; background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.navbar-nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.navbar-nav a { color: var(--text); font-weight: 500; padding: 8px 14px; border-radius: 8px; transition: all 0.2s; font-size: 0.9rem; }
.navbar-nav a:hover { background: var(--bg); color: var(--primary); }

/* ===== 前台 Hero ===== */
.hero {
  text-align: center;
  padding: 50px 20px 36px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--white);
  margin-bottom: 32px;
}
.hero h1 { font-size: 2.2rem; margin-bottom: 10px; font-weight: 800; }
.hero p { font-size: 1rem; opacity: 0.9; max-width: 600px; margin: 0 auto; }

/* ===== 前台卡片网格 ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 0 20px 50px;
  max-width: 1200px;
  margin: 0 auto;
}
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--primary), var(--secondary)); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; margin-bottom: 14px; color: var(--white); }
.card h3 { font-size: 1.15rem; margin-bottom: 8px; font-weight: 700; }
.card p { color: var(--text-light); font-size: 0.9rem; margin-bottom: 16px; min-height: 42px; }
.card-btn { display: inline-block; padding: 10px 20px; border-radius: 10px; color: var(--white); font-weight: 600; font-size: 0.9rem; border: none; cursor: pointer; transition: all 0.2s; width: 100%; text-align: center; }
.card-btn:hover { transform: scale(1.01); opacity: 0.95; color: var(--white); }

/* 卡片颜色 */
.card.c1::before, .card.c1 .card-icon, .card.c1 .card-btn { background: linear-gradient(135deg, #667eea, #764ba2); }
.card.c2::before, .card.c2 .card-icon, .card.c2 .card-btn { background: linear-gradient(135deg, #f093fb, #f5576c); }
.card.c3::before, .card.c3 .card-icon, .card.c3 .card-btn { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.card.c4::before, .card.c4 .card-icon, .card.c4 .card-btn { background: linear-gradient(135deg, #43e97b, #38f9d7); }
.card.c5::before, .card.c5 .card-icon, .card.c5 .card-btn { background: linear-gradient(135deg, #fa709a, #fee140); }
.card.c6::before, .card.c6 .card-icon, .card.c6 .card-btn { background: linear-gradient(135deg, #ff9a44, #fc6076); }

/* ===== 访问验证弹窗 ===== */
.access-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(4px); padding: 16px; }
.access-modal { background: var(--white); border-radius: 20px; padding: 32px 24px; max-width: 400px; width: 100%; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.2); animation: modalIn 0.3s ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
.access-modal h2 { font-size: 1.3rem; margin-bottom: 6px; }
.access-modal p { color: var(--text-light); margin-bottom: 20px; font-size: 0.9rem; }
.access-modal input { width: 100%; padding: 12px 16px; border: 2px solid var(--border); border-radius: 10px; font-size: 1rem; margin-bottom: 14px; outline: none; transition: border-color 0.2s; }
.access-modal input:focus { border-color: var(--primary); }
.access-modal .btn-submit { width: 100%; padding: 12px; border: none; border-radius: 10px; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: var(--white); font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.access-error { color: #e53e3e; font-size: 0.85rem; margin-bottom: 14px; }

/* ============================================
   后台布局
   ============================================ */
.admin-layout { display: flex; min-height: 100vh; position: relative; }

/* 侧边栏遮罩 */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99; opacity: 0; transition: opacity 0.3s ease; }
.sidebar-overlay.active { display: block; opacity: 1; }

/* 侧边栏 */
.admin-sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
  color: var(--white);
  padding: 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-overflow-scrolling: touch;
}
.sidebar-brand { padding: 20px 20px; font-size: 1.15rem; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 8px; white-space: nowrap; }
.sidebar-nav { padding: 8px 0; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: rgba(255,255,255,0.65);
  transition: all 0.2s;
  border-left: 3px solid transparent;
  white-space: nowrap;
  font-size: 0.92rem;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  color: var(--white);
  background: rgba(255,255,255,0.08);
  border-left-color: var(--primary);
}
.nav-icon { font-size: 1.1rem; width: 24px; text-align: center; flex-shrink: 0; }
.nav-text { flex: 1; }
.nav-logout { margin-top: 16px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 16px !important; }

/* 主内容区 */
.admin-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 24px;
  background: var(--bg);
  min-height: 100vh;
}

/* 移动端顶栏 */
.mobile-topbar {
  display: none;
  align-items: center;
  background: var(--white);
  padding: 12px 16px;
  margin: -24px -24px 20px -24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 90;
}
.hamburger-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-right: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
}
.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}
.mobile-title { font-weight: 600; font-size: 1rem; flex: 1; }

/* 后台页头 */
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.admin-header h1 { font-size: 1.4rem; font-weight: 700; }

/* ===== 统计卡片 ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stats-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.stats-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat-card .stat-label { color: var(--text-light); font-size: 0.82rem; margin-bottom: 6px; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 800; }
.stat-card .stat-icon { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 2.2rem; opacity: 0.12; }

/* ===== 表格卡片 ===== */
.table-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 20px; }
.table-card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.table-card-header h3 { font-size: 1.05rem; font-weight: 700; }
.table-card-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th, td { padding: 12px 18px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: #f8fafc; font-weight: 600; font-size: 0.78rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; }
tr:last-child td { border-bottom: none; }
tr:hover { background: #f8fafc; }
td.wrap { white-space: normal; word-break: break-word; }

/* ===== 按钮 ===== */
.btn { display: inline-block; padding: 9px 18px; border-radius: 10px; font-weight: 600; font-size: 0.88rem; border: none; cursor: pointer; transition: all 0.2s; text-align: center; white-space: nowrap; line-height: 1.4; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: var(--white); }
.btn-success { background: linear-gradient(135deg, #43e97b, #38f9d7); color: var(--white); }
.btn-danger { background: linear-gradient(135deg, #fa709a, #fee140); color: var(--white); }
.btn-warning { background: linear-gradient(135deg, #ff9a44, #fc6076); color: var(--white); }
.btn-info { background: linear-gradient(135deg, #4facfe, #00f2fe); color: var(--white); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-outline { background: transparent; border: 2px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); transform: none; }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* ===== 表单 ===== */
.form-card { background: var(--white); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); max-width: 700px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.88rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 11px 14px; border: 2px solid var(--border); border-radius: 10px;
  font-size: 0.92rem; font-family: inherit; transition: border-color 0.2s; outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { min-height: 90px; resize: vertical; }
.form-group .hint { font-size: 0.78rem; color: var(--text-light); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ===== 徽章 ===== */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 600; }
.badge-free { background: #d4edda; color: #155724; }
.badge-password { background: #fff3cd; color: #856404; }
.badge-key { background: #f8d7da; color: #721c24; }
.badge-used { background: #e2e3e5; color: #383d41; }
.badge-active { background: #d1ecf1; color: #0c5460; }

/* ===== 登录页 ===== */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 20px; }
.login-card { background: var(--white); border-radius: 24px; padding: 40px 32px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.login-card h1 { text-align: center; font-size: 1.6rem; margin-bottom: 6px; }
.login-card .subtitle { text-align: center; color: var(--text-light); margin-bottom: 28px; font-size: 0.9rem; }

/* ===== 提示 ===== */
.alert { padding: 12px 18px; border-radius: 10px; margin-bottom: 16px; font-size: 0.88rem; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeaa7; }

/* ===== 空状态 ===== */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-light); }
.empty-state .icon { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.3; }

/* ===== 分页 ===== */
.pagination { padding: 14px 20px; text-align: center; border-top: 1px solid var(--border); display: flex; justify-content: center; gap: 5px; flex-wrap: wrap; }

/* ===== 代码 ===== */
code { background: #f0f0f0; padding: 2px 8px; border-radius: 4px; font-size: 0.82rem; font-family: Consolas, Monaco, monospace; word-break: break-all; }

/* ===== Tab标签 ===== */
.tabs { display: flex; gap: 2px; margin-bottom: 20px; border-bottom: 2px solid var(--border); flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tab-btn { padding: 10px 20px; background: none; border: none; cursor: pointer; font-size: 0.9rem; font-weight: 600; color: var(--text-light); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s; white-space: nowrap; flex-shrink: 0; }
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== 页面信息栏 ===== */
.page-info-bar { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; }
.page-info-bar h2 { font-size: 1.25rem; margin-bottom: 4px; }
.page-info-bar .page-url { font-size: 0.85rem; color: var(--text-light); margin-bottom: 6px; }
.page-info-bar .page-url code { font-size: 0.8rem; }

/* ===== 后台双列 ===== */
.admin-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ============================================
   精致UI组件
   ============================================ */

/* 页面信息大卡片 */
.page-hero-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px 28px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}
.page-hero-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
}
.page-hero-left { flex: 1; min-width: 280px; }
.page-hero-title { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.page-hero-icon { font-size: 1.6rem; width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg, var(--primary), var(--secondary)); display: flex; align-items: center; justify-content: center; }
.page-hero-title h2 { font-size: 1.35rem; font-weight: 700; margin: 0; }
.page-hero-url { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.url-label { font-size: 0.82rem; color: var(--text-light); font-weight: 600; }
.page-hero-url code { font-size: 0.85rem; background: #f0f4ff; color: var(--primary); padding: 3px 10px; }
.copy-btn { background: #f0f4ff; border: none; border-radius: 6px; padding: 4px 8px; cursor: pointer; font-size: 0.85rem; transition: all 0.2s; }
.copy-btn:hover { background: #e0e8ff; transform: scale(1.1); }
.page-hero-desc { font-size: 0.9rem; color: var(--text-light); background: #f8fafc; padding: 8px 14px; border-radius: 8px; border-left: 3px solid var(--border); }
.page-hero-right { display: flex; gap: 8px; flex-wrap: wrap; }

/* 小方块统计卡片 */
.mini-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
.mini-stat {
    background: var(--white);
    border-radius: 14px;
    padding: 18px 16px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.25s;
    border-left: 3px solid var(--accent);
}
.mini-stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.mini-stat-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.mini-stat-num { font-size: 1.6rem; font-weight: 800; color: var(--text); line-height: 1.2; }
.mini-stat-label { font-size: 0.78rem; color: var(--text-light); font-weight: 500; }

/* 精致Tab导航 */
.ui-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 18px;
    background: var(--white);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.ui-tab {
    flex: 1;
    min-width: 120px;
    padding: 10px 18px;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}
.ui-tab:hover { color: var(--primary); background: #f5f7fa; }
.ui-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    box-shadow: 0 4px 12px rgba(102,126,234,0.3);
}
.ui-tab-count {
    background: rgba(0,0,0,0.1);
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
}
.ui-tab.active .ui-tab-count { background: rgba(255,255,255,0.25); }
.ui-tab-content { display: none; }
.ui-tab-content.active { display: block; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================
   简约风格组件 (m- prefix)
   ============================================ */

/* 页面头部 */
.m-page-header { margin-bottom: 20px; }
.m-breadcrumb { font-size: 0.82rem; color: #999; margin-bottom: 6px; }
.m-breadcrumb a { color: #667eea; text-decoration: none; }
.m-breadcrumb a:hover { text-decoration: underline; }
.m-breadcrumb span { margin: 0 6px; color: #ccc; }
.m-page-title { font-size: 1.4rem; font-weight: 700; color: #1a1a1a; margin: 0 0 12px 0; }
.m-page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 按钮 */
.m-btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 18px; border-radius: 6px; font-size: 0.88rem; font-weight: 500; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: all 0.15s; white-space: nowrap; }
.m-btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.m-btn-primary { background: #667eea; color: #fff; border-color: #667eea; }
.m-btn-primary:hover { background: #5a6fd8; }
.m-btn-outline { background: #fff; color: #555; border-color: #ddd; }
.m-btn-outline:hover { border-color: #667eea; color: #667eea; }
.m-btn-danger { background: #fff; color: #e74c3c; border-color: #f5c6cb; }
.m-btn-danger:hover { background: #fdf0ef; }
.m-btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* 提示框 */
.m-alert { padding: 10px 16px; border-radius: 6px; font-size: 0.88rem; margin-bottom: 16px; border: 1px solid; }
.m-alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.m-alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.m-alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }

/* 信息栏 */
.m-info-bar { background: #fff; border: 1px solid #eee; border-radius: 8px; padding: 14px 20px; margin-bottom: 16px; display: flex; gap: 32px; flex-wrap: wrap; }
.m-info-item { display: flex; flex-direction: column; gap: 4px; }
.m-info-label { font-size: 0.75rem; color: #999; text-transform: uppercase; letter-spacing: 0.5px; }
.m-info-value { font-size: 0.9rem; color: #333; }
.m-info-value code { background: #f5f5f5; padding: 2px 8px; border-radius: 4px; font-size: 0.82rem; color: #667eea; }
.m-desc { color: #666; font-size: 0.85rem; max-width: 400px; }
.m-copy-btn { background: none; border: 1px solid #ddd; border-radius: 4px; padding: 2px 8px; font-size: 0.75rem; cursor: pointer; color: #666; margin-left: 4px; }
.m-copy-btn:hover { border-color: #667eea; color: #667eea; }

/* 统计卡片 */
.m-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.m-stat { background: #fff; border: 1px solid #eee; border-radius: 8px; padding: 16px 18px; text-align: left; }
.m-stat-num { font-size: 1.6rem; font-weight: 700; color: #1a1a1a; line-height: 1.2; margin-bottom: 2px; }
.m-stat-label { font-size: 0.8rem; color: #999; }

/* Tab导航 */
.m-tabs { display: flex; gap: 0; border-bottom: 2px solid #eee; margin-bottom: 16px; }
.m-tab { background: none; border: none; padding: 10px 20px; font-size: 0.9rem; font-weight: 500; color: #888; cursor: pointer; position: relative; transition: all 0.15s; display: flex; align-items: center; gap: 6px; }
.m-tab:hover { color: #667eea; }
.m-tab.active { color: #667eea; font-weight: 600; }
.m-tab.active::after { content: ''; position: absolute; bottom: -2px; left: 0; right: 0; height: 2px; background: #667eea; }
.m-tab-count { background: #f0f0f0; color: #888; padding: 1px 7px; border-radius: 10px; font-size: 0.72rem; font-weight: 600; }
.m-tab.active .m-tab-count { background: #eef0ff; color: #667eea; }
.m-tab-content { display: none; }
.m-tab-content.active { display: block; }

/* 表格卡片 */
.m-table-card { background: #fff; border: 1px solid #eee; border-radius: 8px; overflow: hidden; margin-bottom: 14px; }
.m-table-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-bottom: 1px solid #f0f0f0; font-size: 0.88rem; color: #666; }

/* 表格 */
.m-table { width: 100%; border-collapse: collapse; }
.m-table thead th { background: #fafafa; padding: 10px 14px; text-align: left; font-size: 0.8rem; font-weight: 600; color: #888; border-bottom: 1px solid #eee; white-space: nowrap; }
.m-table tbody td { padding: 10px 14px; font-size: 0.85rem; color: #444; border-bottom: 1px solid #f5f5f5; }
.m-table tbody tr:last-child td { border-bottom: none; }
.m-table tbody tr:hover { background: #fafbfc; }
.m-table .m-empty { text-align: center; padding: 36px 20px; color: #bbb; font-size: 0.9rem; }
.m-mono { font-family: 'Courier New', monospace; font-size: 0.8rem; }
.m-muted { color: #999; font-size: 0.82rem; }
.m-wrap { max-width: 180px; word-break: break-all; }
.m-link { color: #667eea; text-decoration: none; }
.m-link:hover { text-decoration: underline; }

/* 分页 */
.m-pagination { display: flex; gap: 4px; padding: 12px 18px; border-top: 1px solid #f0f0f0; justify-content: center; }
.m-page-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 0.82rem; color: #666; text-decoration: none; }
.m-page-btn:hover { border-color: #667eea; color: #667eea; }
.m-page-btn.active { background: #667eea; border-color: #667eea; color: #fff; }

/* ============================================
   卡片式UI组件 (c- prefix)
   ============================================ */
.c-page-head { margin-bottom: 18px; }
.c-breadcrumb { font-size: 0.8rem; color: #aaa; margin-bottom: 10px; }
.c-breadcrumb a { color: #667eea; text-decoration: none; }
.c-breadcrumb a:hover { text-decoration: underline; }
.c-breadcrumb span { margin: 0 5px; color: #ddd; }
.c-head-card { background: #fff; border-radius: 14px; padding: 22px 26px; box-shadow: 0 2px 12px rgba(0,0,0,0.05); display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.c-head-left { display: flex; gap: 16px; align-items: flex-start; flex: 1; min-width: 280px; }
.c-head-icon { width: 56px; height: 56px; border-radius: 14px; background: linear-gradient(135deg, #667eea, #764ba2); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; flex-shrink: 0; }
.c-head-info { flex: 1; }
.c-head-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.c-head-title-row h1 { font-size: 1.35rem; font-weight: 700; margin: 0; color: #1a1a1a; }
.c-head-url { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.c-head-url code { background: #f5f7fa; padding: 3px 10px; border-radius: 6px; font-size: 0.82rem; color: #667eea; }
.c-copy-btn { background: #f0f4ff; border: none; border-radius: 5px; padding: 3px 10px; font-size: 0.75rem; cursor: pointer; color: #667eea; }
.c-copy-btn:hover { background: #e0e8ff; }
.c-head-desc { font-size: 0.85rem; color: #888; background: #fafafa; padding: 6px 12px; border-radius: 6px; display: inline-block; }
.c-head-right { display: flex; gap: 8px; flex-wrap: wrap; }
.c-btn { display: inline-flex; align-items: center; justify-content: center; padding: 9px 18px; border-radius: 8px; font-size: 0.88rem; font-weight: 500; text-decoration: none; cursor: pointer; border: none; transition: all 0.18s; white-space: nowrap; }
.c-btn-sm { padding: 5px 12px; font-size: 0.8rem; border-radius: 6px; }
.c-btn-primary { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; box-shadow: 0 2px 8px rgba(102,126,234,0.3); }
.c-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(102,126,234,0.4); }
.c-btn-ghost { background: #f5f7fa; color: #555; }
.c-btn-ghost:hover { background: #eef0f5; }
.c-btn-danger { background: #fef2f2; color: #e74c3c; }
.c-btn-danger:hover { background: #fde8e8; }
.c-btn-group { display: flex; gap: 6px; flex-wrap: wrap; }
.c-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.c-badge-key { background: #fef3c7; color: #92400e; }
.c-badge-password { background: #e0e7ff; color: #4338ca; }
.c-badge-free { background: #d1fae5; color: #065f46; }
.c-badge-used { background: #fee2e2; color: #991b1b; }
.c-badge-active { background: #d1fae5; color: #065f46; }
.c-alert { padding: 10px 16px; border-radius: 8px; font-size: 0.88rem; margin-bottom: 14px; }
.c-alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.c-alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.c-alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.c-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.c-stat-card { background: #fff; border-radius: 12px; padding: 18px; box-shadow: 0 2px 10px rgba(0,0,0,0.04); display: flex; align-items: center; gap: 14px; transition: all 0.2s; }
.c-stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.c-stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.c-stat-num { font-size: 1.5rem; font-weight: 700; color: #1a1a1a; line-height: 1.2; }
.c-stat-label { font-size: 0.78rem; color: #999; margin-top: 2px; }
.c-tabs { display: flex; gap: 6px; margin-bottom: 16px; background: #fff; padding: 6px; border-radius: 10px; box-shadow: 0 1px 6px rgba(0,0,0,0.04); overflow-x: auto; }
.c-tab { flex: 1; min-width: 110px; background: none; border: none; padding: 9px 16px; border-radius: 7px; font-size: 0.88rem; font-weight: 500; color: #888; cursor: pointer; transition: all 0.18s; display: flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.c-tab:hover { color: #667eea; background: #f5f7fa; }
.c-tab.active { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; box-shadow: 0 2px 8px rgba(102,126,234,0.3); }
.c-tab-count { background: rgba(0,0,0,0.08); padding: 1px 7px; border-radius: 10px; font-size: 0.7rem; font-weight: 600; }
.c-tab.active .c-tab-count { background: rgba(255,255,255,0.25); }
.c-tab-content { display: none; }
.c-tab-content.active { display: block; animation: cFadeIn 0.25s ease; }
@keyframes cFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.c-card { background: #fff; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.04); overflow: hidden; margin-bottom: 14px; }
.c-card-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid #f5f5f5; }
.c-card-head h3 { font-size: 0.95rem; font-weight: 600; margin: 0; color: #333; }
.c-card-body { padding: 18px 20px; }
.c-muted { color: #aaa; font-size: 0.82rem; }
.c-table-wrap { overflow-x: auto; }
.c-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.c-table thead th { background: #fafbfc; padding: 11px 14px; text-align: left; font-size: 0.78rem; font-weight: 600; color: #999; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
.c-table tbody td { padding: 11px 14px; font-size: 0.85rem; color: #444; border-bottom: 1px solid #f8f8f8; }
.c-table tbody tr:last-child td { border-bottom: none; }
.c-table tbody tr:hover { background: #fafbfc; }
.c-table .c-empty { text-align: center; padding: 40px 20px; color: #bbb; }
.c-empty-icon { font-size: 2rem; margin-bottom: 8px; }
.c-mono { font-family: 'Courier New', monospace; font-size: 0.8rem; }
.c-wrap { max-width: 180px; word-break: break-all; }
.c-preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.c-preview-item { display: flex; flex-direction: column; gap: 10px; }
.c-preview-card { background: #fff; border-radius: 14px; padding: 24px 20px; text-align: center; box-shadow: 0 4px 16px rgba(0,0,0,0.08); border: 1px solid #f0f0f0; position: relative; overflow: hidden; }
.c-preview-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.c-preview-card.c1::before { background: linear-gradient(90deg, #667eea, #764ba2); }
.c-preview-card.c2::before { background: linear-gradient(90deg, #f093fb, #f5576c); }
.c-preview-card.c3::before { background: linear-gradient(90deg, #4facfe, #00f2fe); }
.c-preview-card.c4::before { background: linear-gradient(90deg, #43e97b, #38f9d7); }
.c-preview-card.c5::before { background: linear-gradient(90deg, #fa709a, #fee140); }
.c-preview-card.c6::before { background: linear-gradient(90deg, #ff9a44, #fc6076); }
.c-preview-icon { font-size: 2rem; margin-bottom: 10px; }
.c-preview-card h4 { font-size: 1rem; font-weight: 600; margin: 0 0 8px 0; color: #1a1a1a; }
.c-preview-card p { font-size: 0.82rem; color: #888; margin: 0 0 14px 0; line-height: 1.5; min-height: 40px; }
.c-preview-btn { display: inline-block; padding: 8px 24px; border-radius: 20px; color: #fff; font-size: 0.85rem; font-weight: 500; }
.c-preview-actions { display: flex; justify-content: space-between; align-items: center; padding: 0 4px; }
.c-gen-row { margin-bottom: 16px; }
.c-gen-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.c-field { display: flex; flex-direction: column; gap: 5px; }
.c-field label { font-size: 0.8rem; color: #666; font-weight: 500; }
.c-field input, .c-field textarea { padding: 8px 12px; border: 1px solid #e0e0e0; border-radius: 7px; font-size: 0.88rem; font-family: inherit; width: 100%; box-sizing: border-box; }
.c-field input:focus, .c-field textarea:focus { outline: none; border-color: #667eea; box-shadow: 0 0 0 3px rgba(102,126,234,0.1); }
.c-field input[type="number"] { width: 100px; }
.c-import-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.c-hint { font-size: 0.75rem; color: #aaa; margin-top: 4px; }
.c-gen-result { margin-top: 14px; padding: 12px 16px; background: #f9fafb; border-radius: 8px; }
.c-gen-result-title { font-size: 0.82rem; color: #666; margin-bottom: 8px; font-weight: 500; }
.c-gen-keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 5px; }
.c-gen-keys code { background: #fff; padding: 3px 8px; border-radius: 4px; font-size: 0.76rem; border: 1px solid #eee; text-align: center; }
.c-pagination { display: flex; gap: 4px; padding: 12px 20px; border-top: 1px solid #f5f5f5; justify-content: center; }
.c-page-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid #e0e0e0; border-radius: 6px; font-size: 0.82rem; color: #666; text-decoration: none; }
.c-page-btn:hover { border-color: #667eea; color: #667eea; }
.c-page-btn.active { background: #667eea; border-color: #667eea; color: #fff; }


@media (max-width: 1024px) {
  .stats-4 { grid-template-columns: repeat(2, 1fr); }
  .admin-header h1 { font-size: 1.3rem; }
}

/* ============================================
   响应式 - 手机 (≤768px)
   ============================================ */
@media (max-width: 768px) {
  body { font-size: 14px; }

  /* 侧边栏抽屉式 */
  .admin-sidebar { transform: translateX(-100%); width: 260px; box-shadow: 4px 0 20px rgba(0,0,0,0.15); }
  .admin-sidebar.active { transform: translateX(0); }

  /* 主内容区 */
  .admin-main { margin-left: 0; padding: 16px; }

  /* 移动端顶栏 */
  .mobile-topbar { display: flex; margin: -16px -16px 16px -16px; padding: 10px 14px; }

  /* 页头 */
  .admin-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .admin-header h1 { font-size: 1.2rem; }
  .admin-header .btn-group { width: 100%; }
  .admin-header .btn-group .btn { flex: 1; text-align: center; }

  /* 统计卡片 */
  .stats-grid, .stats-3, .stats-4 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-card { padding: 16px; }
  .stat-card .stat-value { font-size: 1.5rem; }
  .stat-card .stat-icon { font-size: 1.8rem; right: 12px; }

  /* 表格 */
  .table-card-header { padding: 14px 16px; flex-direction: column; align-items: flex-start; }
  .table-card-header h3 { font-size: 1rem; }
  th, td { padding: 10px 14px; font-size: 0.8rem; }
  table { min-width: 480px; }

  /* 表单 */
  .form-card { padding: 20px 16px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .form-group input, .form-group select, .form-group textarea { padding: 10px 12px; font-size: 0.9rem; }

  /* 按钮 */
  .btn { padding: 8px 14px; font-size: 0.84rem; }
  .btn-sm { padding: 5px 10px; font-size: 0.76rem; }
  .btn-group { gap: 5px; }

  /* 前台 */
  .hero { padding: 36px 16px 28px; }
  .hero h1 { font-size: 1.6rem; }
  .hero p { font-size: 0.9rem; }
  .card-grid { grid-template-columns: 1fr; gap: 14px; padding: 0 16px 40px; }
  .card { padding: 20px; }
  .card h3 { font-size: 1.05rem; }
  .navbar .container { padding: 0 14px; }
  .navbar-brand { font-size: 1.1rem; }
  .navbar-nav a { padding: 6px 10px; font-size: 0.82rem; }

  /* 弹窗 */
  .access-modal { padding: 24px 18px; }
  .access-modal h2 { font-size: 1.15rem; }

  /* 登录 */
  .login-card { padding: 32px 24px; }

  /* Tab */
  .tab-btn { padding: 8px 14px; font-size: 0.82rem; }

  /* 页面信息栏 */
  .page-info-bar { padding: 16px; }
  .page-info-bar h2 { font-size: 1.1rem; }

  /* 双列变单列 */
  .admin-two-col { grid-template-columns: 1fr; gap: 16px; }

  /* 精致UI组件 - 移动端 */
  .page-hero-card { padding: 18px 16px; gap: 12px; }
  .page-hero-title h2 { font-size: 1.15rem; }
  .page-hero-icon { width: 36px; height: 36px; font-size: 1.3rem; }
  .page-hero-right { width: 100%; }
  .page-hero-right .btn { flex: 1; text-align: center; }
  .mini-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .mini-stat { padding: 14px 12px; gap: 10px; }
  .mini-stat-icon { width: 38px; height: 38px; font-size: 1.1rem; }
  .mini-stat-num { font-size: 1.3rem; }
  .mini-stat-label { font-size: 0.72rem; }
  .ui-tab { padding: 8px 12px; font-size: 0.82rem; min-width: 100px; }

  /* 简约组件 - 移动端 */
  .m-page-title { font-size: 1.2rem; }
  .m-page-actions { width: 100%; }
  .m-page-actions .m-btn { flex: 1; }
  .m-info-bar { flex-direction: column; gap: 12px; padding: 14px 16px; }
  .m-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .m-stat { padding: 12px 14px; }
  .m-stat-num { font-size: 1.3rem; }
  .m-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .m-tab { padding: 8px 14px; font-size: 0.82rem; white-space: nowrap; }
  .m-table { min-width: 600px; }
  .m-table-card { overflow-x: auto; }

  /* 卡片式UI - 移动端 */
  .c-head-card { padding: 16px; flex-direction: column; }
  .c-head-left { flex-direction: column; gap: 10px; }
  .c-head-icon { width: 44px; height: 44px; font-size: 1.3rem; }
  .c-head-title-row h1 { font-size: 1.15rem; }
  .c-head-right { width: 100%; }
  .c-head-right .c-btn { flex: 1; }
  .c-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .c-stat-card { padding: 14px; gap: 10px; }
  .c-stat-icon { width: 40px; height: 40px; font-size: 1.1rem; }
  .c-stat-num { font-size: 1.3rem; }
  .c-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .c-tab { padding: 8px 14px; font-size: 0.82rem; white-space: nowrap; min-width: 100px; }
  .c-card-head { padding: 12px 16px; }
  .c-card-body { padding: 14px 16px; }
  .c-preview-grid { grid-template-columns: 1fr; }
  .c-import-grid { grid-template-columns: 1fr; }
}

/* ============================================
   响应式 - 小屏手机 (≤480px)
   ============================================ */
@media (max-width: 480px) {
  .stats-grid, .stats-3, .stats-4 { grid-template-columns: 1fr; }
  .mini-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-sidebar { width: 82%; max-width: 280px; }
  .hero h1 { font-size: 1.4rem; }
  .card h3 { font-size: 1rem; }
  .btn-group .btn { flex: 1 1 auto; }
  table { min-width: 420px; }
  th, td { padding: 8px 10px; font-size: 0.76rem; }
  .mobile-title { font-size: 0.9rem; }
}
