/* ============================================
   全是人才宝藏群工具箱 - 腾讯风UI样式
   配色参考：腾讯设计体系 TDesign
   主色：#0052D9（腾讯蓝）
   ============================================ */

:root {
  --primary: #0052D9;
  --primary-light: #e8f0ff;
  --primary-dark: #003C9E;
  --success: #00A870;
  --success-light: #e8f9f1;
  --warning: #ED7B2F;
  --warning-light: #fdf2ea;
  --danger: #D54941;
  --danger-light: #fde8e8;
  --text-primary: #1a1a1a;
  --text-secondary: #595959;
  --text-placeholder: #8c8c8c;
  --bg-page: #f3f4f6;
  --bg-card: #ffffff;
  --border: #e7e7e7;
  --border-light: #f0f0f0;
  --radius: 6px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.04);
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ====== 布局 ====== */
.page-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.page-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.page-header .logo {
  font-size: 18px; font-weight: 600; color: var(--primary);
  display: flex; align-items: center; gap: 8px;
}
.page-header .nav-actions { display: flex; gap: 12px; align-items: center; }
.page-content { flex: 1; padding: 24px; max-width: 1400px; margin: 0 auto; width: 100%; }
.page-footer {
  text-align: center; padding: 24px; color: var(--text-placeholder);
  font-size: 12px; border-top: 1px solid var(--border);
}

/* ====== 卡片 ====== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  font-weight: 600; font-size: 15px;
  display: flex; align-items: center; justify-content: space-between;
}
.card-body { padding: 20px; }

/* ====== 表单 ====== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; margin-bottom: 6px; font-weight: 500;
  color: var(--text-secondary); font-size: 13px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-input, .form-select, .form-textarea {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; color: var(--text-primary);
  background: #fff; transition: all 0.2s;
  outline: none;
}
.form-textarea { height: auto; min-height: 80px; padding: 8px 12px; resize: vertical; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0,82,217,0.1);
}
.form-input::placeholder { color: var(--text-placeholder); }

/* ====== 按钮 ====== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 20px; border: none; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s;
  background: var(--border); color: var(--text-secondary);
  white-space: nowrap; gap: 6px;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-outline {
  background: transparent; border: 1px solid var(--border); color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ====== 标签 ====== */
.tag {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 3px; font-size: 12px; font-weight: 500; gap: 4px;
}
.tag-primary { background: var(--primary-light); color: var(--primary); }
.tag-success { background: var(--success-light); color: var(--success); }
.tag-warning { background: var(--warning-light); color: var(--warning); }
.tag-danger  { background: var(--danger-light); color: var(--danger); }
.tag-default { background: var(--border-light); color: var(--text-secondary); }

/* ====== 表格 ====== */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; padding: 10px 12px; background: var(--bg-page);
  color: var(--text-secondary); font-weight: 500; border-bottom: 1px solid var(--border);
}
.table td {
  padding: 12px; border-bottom: 1px solid var(--border-light); vertical-align: middle;
}
.table tr:hover td { background: #fafbfc; }

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

/* ====== 弹窗 ====== */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.4); z-index: 999; display: none;
  align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius-lg); width: 90%;
  max-width: 600px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border-light);
  font-weight: 600; font-size: 16px; display: flex; justify-content: space-between; align-items: center;
}
.modal-close { cursor: pointer; color: var(--text-placeholder); font-size: 20px; }
.modal-body { padding: 20px; }
.modal-footer {
  padding: 12px 20px; border-top: 1px solid var(--border-light);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ====== 提示消息 ====== */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 10px 20px; z-index: 9999; display: none; font-size: 14px;
  min-width: 200px; text-align: center;
}
.toast.show { display: block; animation: toastIn 0.3s ease; }
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
@keyframes toastIn { from { opacity: 0; top: 0; } to { opacity: 1; top: 20px; } }

/* ====== 空状态 ====== */
.empty-state {
  text-align: center; padding: 40px 20px; color: var(--text-placeholder);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

/* ====== 网格 ====== */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ====== 插件卡片 ====== */
.plugin-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; cursor: pointer; transition: all 0.2s; position: relative;
}
.plugin-card:hover {
  border-color: var(--primary); box-shadow: 0 4px 12px rgba(0,82,217,0.1);
  transform: translateY(-2px);
}
.plugin-card .plugin-name { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.plugin-card .plugin-desc { color: var(--text-secondary); font-size: 12px; line-height: 1.5; }

/* ====== 结果展示 ====== */
.result-box {
  background: var(--bg-page); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-top: 16px;
}
.result-row {
  display: flex; padding: 8px 0; border-bottom: 1px solid var(--border-light);
}
.result-row:last-child { border-bottom: none; }
.result-label { width: 120px; color: var(--text-secondary); font-size: 13px; flex-shrink: 0; }
.result-value { flex: 1; font-weight: 500; word-break: break-all; }
.result-value.success { color: var(--success); }
.result-value.danger { color: var(--danger); }

/* ====== 统计卡片 ====== */
.stat-card {
  background: #fff; border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-label { color: var(--text-secondary); font-size: 13px; margin-bottom: 8px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: var(--text-primary); }
.stat-card .stat-extra { font-size: 12px; color: var(--text-placeholder); margin-top: 4px; }

/* ====== Tab 选项卡 ====== */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab-item {
  padding: 10px 20px; cursor: pointer; font-size: 14px; color: var(--text-secondary);
  border-bottom: 2px solid transparent; transition: all 0.2s;
}
.tab-item:hover { color: var(--primary); }
.tab-item.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

/* ====== 搜索栏 ====== */
.search-bar {
  display: flex; gap: 12px; margin-bottom: 16px; align-items: center; flex-wrap: wrap;
}
.search-bar .form-input { max-width: 240px; }

/* ====== 手机适配 ====== */
@media (max-width: 768px) {
  .page-header { padding: 0 12px; height: 48px; }
  .page-header .logo { font-size: 16px; }
  .page-content { padding: 12px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .table { font-size: 12px; }
  .table th, .table td { padding: 8px 6px; }
  .modal { width: 95%; }
  .search-bar .form-input { max-width: 100%; }
  .search-bar { flex-direction: column; align-items: stretch; }
  .stat-card .stat-value { font-size: 22px; }
  .btn { height: 36px; font-size: 13px; padding: 0 16px; }
}

@media (max-width: 480px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .card-body { padding: 12px; }
  .tab-item { padding: 8px 12px; font-size: 13px; }
  .result-label { width: 80px; font-size: 12px; }
}
