.hidden { display: none !important; }

/* ===== 登录框（Ant Design Card 居中） ===== */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-box {
  width: 100%; max-width: 360px;
  background: var(--bg-container);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  padding: 32px 28px;
  display: flex; flex-direction: column; gap: 16px;
}
.auth-box h2 { font-size: 20px; font-weight: 600; text-align: center; color: var(--text); }
.auth-box .hint { color: var(--text-tertiary); font-size: 13px; text-align: center; }

/* ===== Ant Design 输入框 ===== */
.auth-box input, .modal-box input, .modal-box select, .sitename-input {
  height: 36px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-container);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-box input { height: 40px; }
.auth-box input:hover, .modal-box input:hover, .modal-box select:hover, .sitename-input:hover {
  border-color: var(--primary-hover);
}
.auth-box input:focus, .modal-box input:focus, .modal-box select:focus, .sitename-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

/* ===== Ant Design 按钮 ===== */
.btn {
  height: 36px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
  background: var(--bg-container);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { color: var(--primary-hover); border-color: var(--primary-hover); }
.btn:active { color: var(--primary-active); border-color: var(--primary-active); }
.btn.primary {
  color: #fff; background: var(--primary); border-color: var(--primary);
  box-shadow: 0 2px 0 rgba(5, 145, 255, 0.1);
}
.btn.primary:hover { color: #fff; background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.primary:active { background: var(--primary-active); border-color: var(--primary-active); }
.btn.small { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--fill-hover); color: var(--primary-hover); }
.btn.danger { color: #ff4d4f; }
.btn.danger:hover { color: #ff7875; border-color: transparent; background: rgba(255, 77, 79, 0.06); }

.err { color: #ff4d4f; font-size: 13px; min-height: 1em; text-align: center; }

/* ===== 管理面板 ===== */
.panel { max-width: 1000px; margin: 0 auto; padding: 0 0 80px; }
.panel-top {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
  padding: 16px 24px;
  background: var(--bg-container);
  border-bottom: 1px solid var(--border-split);
  margin-bottom: 24px;
  position: sticky; top: 0; z-index: 10;
}
.panel-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-title strong { font-size: 16px; font-weight: 600; }
.sitename-input { width: 180px; }
.panel-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 12px; margin: 0 24px 16px; flex-wrap: wrap; }

/* 外观 / 主题切换条 */
.theme-bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin: 0 24px 20px;
  padding: 12px 16px;
  background: var(--bg-container);
  border: 1px solid var(--border-split);
  border-radius: var(--radius);
}
.theme-group { display: flex; align-items: center; gap: 10px; }
.theme-group > .label { font-size: 13px; color: var(--text-secondary); }
.swatches { display: flex; gap: 8px; }
.swatch {
  width: 22px; height: 22px; border-radius: 50%;
  cursor: pointer; border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
  position: relative;
}
.swatch:hover { transform: scale(1.15); }
.swatch.active { border-color: var(--text); }
.swatch.active::after {
  content: "✓"; position: absolute; inset: 0;
  display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700;
}
/* 自定义取色器 */
.custom-color { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; color: var(--text-secondary); }
.custom-color input[type="color"] {
  width: 26px; height: 26px; padding: 0; border: 1px solid var(--border); border-radius: 50%;
  background: none; cursor: pointer; overflow: hidden;
}
.custom-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.custom-color input[type="color"]::-webkit-color-swatch { border: none; border-radius: 50%; }

/* 导入预览 */
.import-drop {
  border: 1px dashed var(--border); border-radius: var(--radius-sm);
  padding: 20px; text-align: center; color: var(--text-tertiary); font-size: 13px; cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.import-drop:hover { border-color: var(--primary); color: var(--primary); }
.import-preview { max-height: 220px; overflow: auto; font-size: 13px; color: var(--text-secondary); }
.import-preview .ip-cat { font-weight: 600; color: var(--text); margin: 8px 0 4px; }
.import-preview .ip-link { padding-left: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 暗/亮分段切换 */
.seg { display: inline-flex; background: var(--fill-hover); border-radius: var(--radius-sm); padding: 2px; }
.seg button {
  border: none; background: transparent; cursor: pointer;
  padding: 5px 14px; font-size: 13px; border-radius: 4px;
  color: var(--text-secondary); transition: background 0.2s, color 0.2s;
  display: inline-flex; align-items: center; gap: 5px;
}
.seg button.active { background: var(--bg-elevated); color: var(--text); box-shadow: var(--shadow); }

/* 分类卡片（Ant Design Card） */
.cat-list { padding: 0 24px; }
.cat {
  background: var(--bg-container);
  border: 1px solid var(--border-split);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0;
  margin-bottom: 16px;
  overflow: hidden;
}
.cat-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-split);
}
.cat-head .cat-name { font-size: 15px; font-weight: 600; color: var(--text); }
.cat-head .ops { display: flex; gap: 4px; }
.cat-links { padding: 8px 12px; display: flex; flex-direction: column; }

/* 链接行（Ant Design List item） */
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.2s, opacity 0.2s;
}
.row:hover { background: var(--fill-hover); }
/* 拖拽排序 */
.drag-handle { cursor: grab; color: var(--text-tertiary); flex: 0 0 16px; font-size: 14px; user-select: none; }
.drag-handle:active { cursor: grabbing; }
.row.dragging { opacity: 0.4; }
.cat-links.drop-active { outline: 2px dashed var(--primary); outline-offset: -4px; border-radius: var(--radius-sm); }
.row .ricon {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: var(--radius-sm);
  display: grid; place-items: center; font-size: 0.85rem; font-weight: 600; color: #fff;
  background: var(--primary); overflow: hidden;
}
.row .ricon img { width: 100%; height: 100%; object-fit: cover; }
.row .rinfo { flex: 1; min-width: 0; }
.row .rinfo .rt { font-weight: 500; font-size: 14px; color: var(--text); }
.row .rinfo .ru { color: var(--text-tertiary); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .rops { display: flex; gap: 4px; opacity: 0; transition: opacity 0.2s; }
.row:hover .rops { opacity: 1; }
.cat-empty { color: var(--text-tertiary); font-size: 13px; padding: 12px; }

/* ===== Ant Design Modal ===== */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); display: grid; place-items: center; padding: 20px; z-index: 50; }
.modal-box {
  width: 100%; max-width: 460px;
  background: var(--bg-container);
  border-radius: var(--radius);
  box-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
  padding: 24px;
  display: flex; flex-direction: column; gap: 16px; max-height: 90vh; overflow: auto;
}
.modal-box h3 { font-size: 16px; font-weight: 600; color: var(--text); }
.modal-box label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

@media (max-width: 600px) {
  .row .rops { opacity: 1; }
  .panel-top { padding: 12px 16px; }
  .toolbar, .cat-list { margin-left: 16px; margin-right: 16px; padding: 0; }
}
