* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #0a0a0f;
  --bg-elevated: #12121a;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c27;
  --bg-input: #1e1e2a;
  --bg-input-hover: #242432;
  --border: #232330;
  --border-light: #2e2e3d;
  --text: #eef0f5;
  --text-secondary: #a0a3b0;
  --text-muted: #6c6f7e;
  --primary: #5b7cff;
  --primary-hover: #7390ff;
  --primary-active: #4a68e6;
  --primary-light: rgba(91, 124, 255, 0.12);
  --primary-glow: rgba(91, 124, 255, 0.3);
  --success: #22c55e;
  --danger: #ef4444;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 7px;
}

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(ellipse 80% 40% at 50% -10%, rgba(91, 124, 255, 0.07), transparent);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }

/* ========== Header ========== */
.header {
  background: rgba(18, 18, 26, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.logo-icon {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.search-box {
  flex: 1;
  min-width: 0;
}

.search-box form {
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 9px 42px 9px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 400;
}

.search-box input::placeholder { color: var(--text-muted); font-weight: 400; }
.search-box input:hover { background: var(--bg-input-hover); border-color: var(--border-light); }
.search-box input:focus {
  background: var(--bg-input-hover);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light), 0 0 20px rgba(91, 124, 255, 0.1);
}

.search-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--text-muted);
  transition: all 0.15s;
  background: transparent;
  border: none;
  cursor: pointer;
}

.search-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.search-btn svg {
  display: block;
}

/* ========== Main ========== */
.main {
  max-width: 1300px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  gap: 18px;
  min-height: calc(100vh - 56px);
}

/* ========== Sidebar (Desktop) ========== */
.sidebar {
  width: 200px;
  flex-shrink: 0;
}

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 10px;
  position: sticky;
  top: 72px;
}

.sidebar-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
  padding: 0 10px;
}

.category-list { list-style: none; }

.category-list li a {
  display: flex;
  align-items: center;
  padding: 9px 12px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 450;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 2px;
  position: relative;
}

.category-list li a:hover { background: var(--bg-card-hover); color: var(--text); }

.category-list li a.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 500;
}

.category-list li a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

/* ========== Content ========== */
.content { flex: 1; min-width: 0; }

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  padding: 0 2px;
}

.content-title { font-size: 16px; font-weight: 600; color: var(--text); }
.content-count { color: var(--text-muted); font-size: 13px; }

/* ========== Resource List ========== */
.resource-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.resource-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.resource-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
}



.resource-item:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.resource-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.resource-code {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff;
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  letter-spacing: 0.2px;
  box-shadow: 0 2px 6px var(--primary-glow);
  position: relative;
  overflow: hidden;
}

.resource-code::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.3s;
}

.resource-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  line-height: 1.4;
  word-break: break-word;
}

.resource-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.resource-category {
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid rgba(34, 197, 94, 0.15);
}

.resource-item p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 12px;
  line-height: 1.6;
}

/* URL + 按钮行 */
.action-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.url-box {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-muted);
  font-family: "SF Mono", "JetBrains Mono", Monaco, Consolas, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all 0.15s;
}

.url-box {
  position: relative;
}

.url-box:hover { color: var(--text-secondary); border-color: var(--border-light); }

/* ========== Buttons ========== */
.btn {
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.1px;
  min-height: 36px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #7390ff);
  color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover), #8ba6ff);
  box-shadow: 0 4px 14px var(--primary-glow);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn {
  user-select: none;
  -webkit-user-select: none;
  letter-spacing: 0.2px;
  text-decoration: none !important;
  outline: none;
}

.btn:visited,
.btn:hover,
.btn:active {
  text-decoration: none !important;
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-input-hover); color: var(--text); border-color: var(--border-light); }
.btn-secondary:active { transform: scale(0.97); }

.btn-success {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #fff;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}
.btn-success:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-danger {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}
.btn-danger:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-sm { padding: 7px 14px; font-size: 12px; border-radius: 6px; min-height: auto; }
.btn-block { width: 100%; }

/* ========== Pagination ========== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13px;
  background: var(--bg-card);
  transition: all 0.15s;
  font-weight: 450;
}

.pagination .current {
  background: linear-gradient(135deg, var(--primary), #7390ff);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.pagination a:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* ========== Footer ========== */
.footer {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--border);
}

/* ========== Empty ========== */
.empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.empty-icon { font-size: 36px; margin-bottom: 10px; opacity: 0.4; }
.empty p { font-size: 13px; color: var(--text-muted); }

/* ========== Toast ========== */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-15px);
  padding: 10px 22px;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  z-index: 1000;
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.35);
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ========== 后台样式 ========== */
.admin-wrapper { min-height: 100vh; background: var(--bg); }

.admin-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  padding: 0 24px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-logo { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.admin-logo::before { content: "⚙️"; font-size: 14px; }

.admin-header-right { display: flex; gap: 2px; }
.admin-header-right a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.admin-header-right a:hover { background: var(--bg-input); color: var(--text); }

.admin-container { max-width: 960px; margin: 20px auto; padding: 0 16px; }

.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.admin-title { font-size: 17px; font-weight: 600; margin-bottom: 18px; }

.admin-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.admin-tab {
  padding: 10px 16px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
}
.admin-tab:hover { color: var(--text-secondary); }
.admin-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ========== Table ========== */
.table-wrapper { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }

.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 600px;
}

.admin-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-input);
  font-weight: 600;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.admin-table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.admin-table th:last-child { border-radius: 0 var(--radius-sm) 0 0; }

.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--bg-card-hover); }

.table-actions { display: flex; gap: 6px; }
.table-actions .btn-sm { padding: 5px 10px; font-size: 12px; }

.admin-table code {
  background: var(--bg-input);
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 12px;
  color: #a5b4fc;
  font-family: "SF Mono", Monaco, Consolas, monospace;
  border: 1px solid var(--border);
}

/* ========== Form ========== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 13px;
  color: var(--text-secondary);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 10px 13px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-muted); }

.form-input:hover,
.form-textarea:hover,
.form-select:hover { border-color: var(--border-light); background: var(--bg-input-hover); }

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--primary);
  background: var(--bg-input-hover);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-textarea { resize: vertical; min-height: 100px; line-height: 1.6; }

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c6f7e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-row { display: flex; gap: 14px; }
.form-row .form-group { flex: 1; }

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* ========== Login ========== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at top, rgba(91, 124, 255, 0.1), transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(139, 92, 246, 0.07), transparent 50%),
    var(--bg);
  padding: 20px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 40px 34px;
  width: 100%;
  max-width: 360px;
  box-shadow:
    0 30px 60px -15px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), #8b5cf6, transparent);
  opacity: 0.6;
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
  color: var(--text);
}

.login-subtitle {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.login-wrapper .btn-primary {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  margin-top: 6px;
}

.login-wrapper .hint {
  text-align: center;
  margin-top: 22px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ========== Alert ========== */
.alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 450;
  border: 1px solid transparent;
}

.alert-error {
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.15);
}

.alert-success {
  background: rgba(34, 197, 94, 0.08);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.15);
}

/* ========== 后台搜索/操作栏 ========== */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar form {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 260px;
  max-width: 500px;
  flex-wrap: wrap;
}

.toolbar .form-select { width: auto; min-width: 100px; }
.toolbar .form-input { flex: 1; min-width: 150px; }

.hidden { display: none !important; }

#addForm {
  margin-bottom: 18px;
  padding: 18px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ================================================================
   📱 移动端适配（核心优化）
   ================================================================ */
@media (max-width: 768px) {
  /* ---- 主体布局 ---- */
  .main {
    flex-direction: column;
    padding: 10px 12px;
    gap: 8px;
    min-height: auto;
  }

  /* ---- 顶栏 ---- */
  .header-inner {
    padding: 8px 14px;
    gap: 10px;
  }

  .logo {
    font-size: 15px;
  }

  .logo-icon {
    width: 24px;
    height: 24px;
    font-size: 12px;
    border-radius: 6px;
    box-shadow: 0 1px 4px var(--primary-glow);
  }

  .logo-text {
    display: none;
  }

  .search-box { flex: 1; }

  .search-box input {
    padding: 7px 12px 7px 34px;
    font-size: 13px;
    border-radius: 7px;
  }

  .search-icon { left: 10px; font-size: 12px; }

  /* ---- 分类 Tab ---- */
  .sidebar {
    width: 100%;
    margin: 0 -12px;
    padding: 0 12px;
  }

  .sidebar-card {
    position: static;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .sidebar-card::-webkit-scrollbar { display: none; }

  .sidebar-title { display: none; }

  .category-list {
    display: inline-flex;
    gap: 6px;
    white-space: nowrap;
    padding: 0;
  }

  .category-list li {
    flex-shrink: 0;
    display: inline-block;
  }

  .category-list li a {
    padding: 5px 12px;
    margin-bottom: 0;
    font-size: 12px;
    font-weight: 450;
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    min-height: auto;
    display: inline-flex;
    align-items: center;
    height: 28px;
  }

  .category-list li a:hover { background: var(--bg-card-hover); border-color: var(--border-light); }

  .category-list li a.active {
    background: linear-gradient(135deg, var(--primary), #7390ff);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px var(--primary-glow), inset 0 1px 0 rgba(255,255,255,0.15);
    font-weight: 500;
  }

  .category-list li a.active::before { display: none; }

  /* ---- 内容区 ---- */
  .content-header {
    margin-bottom: 8px;
    padding: 0 2px;
  }

  .content-title { font-size: 14px; }
  .content-count { font-size: 12px; }

  /* ---- 卡片（紧凑） ---- */
  .resource-list {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .resource-item {
    padding: 12px;
    border-radius: 10px;
  }

  .resource-item:hover {
    transform: none;
    box-shadow: none;
  }

  .resource-top {
    gap: 8px;
    margin-bottom: 5px;
    align-items: center;
  }

  .resource-code {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 4px;
  }

  .resource-title {
    font-size: 14px;
    line-height: 1.35;
    font-weight: 600;
  }

  .resource-meta {
    margin-bottom: 8px;
    gap: 8px;
  }

  .resource-category {
    padding: 2px 7px;
    font-size: 10px;
  }

  .resource-item p {
    font-size: 12px;
    margin-bottom: 8px;
    line-height: 1.5;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* ---- 操作行：URL + 两个按钮一行 ---- */
  .action-row {
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
  }

  .url-box {
    flex: 1;
    min-width: 0;
    font-size: 10px;
    padding: 6px 9px;
    border-radius: 6px;
    order: 0;
  }

  .action-row .btn {
    flex: 0 0 auto;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 500;
    min-height: 28px;
    border-radius: 6px;
    box-shadow: none;
  }

  .action-row .btn-secondary { order: 0; }
  .action-row .btn-primary { order: 0; }

  /* ---- 分页 ---- */
  .pagination {
    margin-top: 18px;
    gap: 4px;
  }

  .pagination a,
  .pagination span {
    min-width: 32px;
    height: 32px;
    font-size: 12px;
    border-radius: 6px;
    padding: 0 8px;
  }

  /* ---- 后台 ---- */
  .admin-container {
    padding: 0 12px;
    margin: 10px auto;
  }

  .admin-card {
    padding: 14px;
    border-radius: 12px;
  }

  .admin-header {
    padding: 0 14px;
    height: 48px;
  }

  .admin-header-right a {
    padding: 5px 8px;
    font-size: 12px;
  }

  .admin-title { font-size: 16px; margin-bottom: 14px; }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 14px;
  }

  .toolbar form { max-width: 100%; }
  .toolbar > .btn { align-self: flex-start; }

  .form-row { flex-direction: column; gap: 0; }
  .form-group { margin-bottom: 14px; }

  .login-card {
    padding: 28px 22px;
    border-radius: 14px;
  }

  .table-wrapper { margin: 0 -14px; padding: 0 14px; }

  .admin-table th,
  .admin-table td {
    padding: 8px 10px;
    font-size: 12px;
  }

  .table-actions .btn-sm {
    padding: 5px 9px;
    font-size: 11px;
  }

  .admin-tabs {
    overflow-x: auto;
    scrollbar-width: none;
    margin-bottom: 14px;
  }
  .admin-tabs::-webkit-scrollbar { display: none; }

  .admin-tab {
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 12px;
  }

  .footer {
    padding: 18px 16px;
    margin-top: 4px;
    font-size: 11px;
  }
}

/* 小屏手机 (<= 380px) */
@media (max-width: 380px) {
  .resource-title { font-size: 13px; }
  .resource-code { font-size: 9px; padding: 2px 6px; }
  .resource-item { padding: 10px; }
  .resource-item p { font-size: 11px; }
  .category-list li a { padding: 4px 10px; height: 26px; font-size: 11px; }

  .action-row .btn { font-size: 10px; min-height: 26px; padding: 5px 8px; }
  .url-box { font-size: 9px; padding: 5px 8px; }

  .pagination a,
  .pagination span {
    min-width: 30px;
    height: 30px;
    font-size: 11px;
    padding: 0 7px;
  }
}

/* PC端直达按钮：灰底白字，弱化存在感 */
@media (min-width: 769px) {
  .action-row .btn-primary.go-btn {
    background: var(--bg-input);
    color: #ffffff;
    border: 1px solid var(--border);
    box-shadow: none;
  }
  .action-row .btn-primary.go-btn:hover {
    background: var(--bg-input-hover);
    border-color: var(--border-light);
    transform: translateY(-1px);
    box-shadow: none;
  }
}