/* ========================
   仿商视网网址导航 - 静态版 Demo
   样式表
   ======================== */

/* CSS Variables */
:root {
  --bg-color: #F2F2F2;
  --text-color: #333333;
  --link-color: #2c2c2c;
  --accent-color: #2196f3;
  --accent-hover: #2386ea;
  --muted-color: #999999;
  --border-color: #e0e0e0;
  --card-bg: rgba(255, 255, 255, 0.85);
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --search-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  --radius-sm: 4px;
  --radius-md: 7px;
  --radius-lg: 8px;
  --radius-xl: 10px;
  --font-stack: "Microsoft YaHei", "PingFang SC", Tahoma, Arial, Helvetica, sans-serif;
  --overlay-opacity: 0.1;
  --overlay-blur: 0px;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font-stack);
  font-size: 14px;
  color: var(--text-color);
  background: var(--bg-color) no-repeat center center fixed;
  background-size: cover;
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: var(--link-color);
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

input, select {
  font-family: inherit;
  outline: none;
}

img {
  max-width: 100%;
  vertical-align: middle;
}

/* Main Container */
#main  {
   width: 100%;
  max-width: 1200px;
  margin: 0px auto 0px;
  text-align: center;

  position: relative;
  min-height: 100vh;
  padding-bottom: 40px;
  z-index: 1;
}

.bg-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, var(--overlay-opacity));
  backdrop-filter: blur(var(--overlay-blur));
  -webkit-backdrop-filter: blur(var(--overlay-blur));
  z-index: -1;
  pointer-events: none;
}

/* Header */
#top-nav {
  text-align: center;
  padding-top: 0px;
  margin-bottom: 12px;
}

.my-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.my-logo img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
}

.logo-text {
  font-size: 32px;
  font-weight: 600;
  color: var(--accent-color);
  letter-spacing: 2px;
}

.clock-box {
  text-align: center;
  margin-top: 30px;
}

.clock-time {
  font-size: 64px;
  font-weight: 300;
  line-height: 1;
  color: var(--text-color);
}

.clock-date {
  font-size: 14px;
  color: var(--muted-color);
  margin-top: 6px;
}

/* Search */
#search {
  position: relative;
  width: 90%;
  max-width: 720px;
  margin: 0 auto;
  z-index: 100;
}

#search-box {
  position: relative;
  width: 100%;
  height: 40px;
  background: #fff;
  border-radius: var(--radius-sm);
  box-shadow: var(--search-shadow);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.search-engine-icon {
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  font-size: 18px;
  cursor: pointer;
  z-index: 2;
}

.search-engine-icon:hover {
  background: rgba(0, 0, 0, 0.03);
}

.s-key {
  flex: 1;
  width: 100%;
  height: 50px;
  padding: 2px 90px 2px 50px;
  border: none;
  font-size: 16px;
  color: var(--text-color);
  background: transparent;
}

.s-key::placeholder {
  color: #aaa;
}

.s-del {
  position: absolute;
  right: 54px;
  top: 0;
  width: 36px;
  height: 50px;
  display: none;
  align-items: center;
  justify-content: center;
  color: #D5D5D5;
  font-size: 16px;
  cursor: pointer;
}

.s-del:hover {
  color: #999;
}

.s-btn {
  position: absolute;
  right: 0;
  top: 0;
  width: 40px;
  height: 40px;
  background: transparent;
  color: #888;
  font-size: 18px;
}

.s-btn:hover {
  color: var(--accent-hover);
}

/* Search Engine Panel */
.search-engine {
  position: absolute;
  top: 60px;
  left: 0;
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  padding: 12px;
  display: none;
}

.search-engine.active {
  display: block;
}

.engine-title {
  font-size: 12px;
  color: #999;
  margin-bottom: 8px;
  padding-left: 4px;
}

.engine-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.engine-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: #f9f9f9;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: #555;
}

.engine-list li:hover,
.engine-list li.active {
  background: #e3f2fd;
  color: var(--accent-color);
}

.engine-list li img,
.engine-list li i {
  width: 16px;
  height: 16px;
  font-size: 14px;
  text-align: center;
}

/* Search Hot Text / History */
.search-hot-text {
  position: absolute;
  top: 50px;
  left: 0;
  width: 100%;
  background: #fff;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  display: none;
  overflow: hidden;
}

.search-hot-text.active {
  display: block;
}

.search-hot-text li {
  padding: 0 16px;
  line-height: 36px;
  font-size: 14px;
  color: #777;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-hot-text li:hover,
.search-hot-text li.current {
  background: #f1f1f1;
  color: var(--accent-color);
}

.search-hot-text li i {
  color: #bbb;
  font-size: 12px;
}

/* Categories Navigation */
#catNavBar {
  width: 90%;
  max-width: 1000px;
  margin: 12px auto 6px;
  text-align: center;
  font-size: 16px;
  white-space: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}

#catNavBar::-webkit-scrollbar {
  display: none;
}

.itemCat {
  display: inline-block;
  min-width: 46px;
  height: 32px;
  line-height: 30px;
  color: var(--muted-color);
  border-bottom: 2px solid transparent;
  margin: 0 10px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.itemCat:hover,
.itemCat.currentCat {
  color: var(--text-color);
  border-bottom-color: #9d9d9d;
}

/* Site List Container */
#siteListBox {
  width: 90%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 0 20px;
}

/* Category Section */
.category-section {
  margin-bottom: 24px;
}

.category-title {
  font-size: 16px;
  color: #555;
  margin-bottom: 12px;
  padding-left: 6px;
  border-left: 3px solid var(--accent-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-title i {
  color: var(--accent-color);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

/* Site Item Common */
.site-item {
  position: relative;
}
.site-item.flash-new { animation: flashNew 1.8s ease-out; }
@keyframes flashNew {
  0%, 25% { box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.8); }
  100% { box-shadow: 0 0 0 0 rgba(33, 150, 243, 0); }
}

.site-item a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  transition: all 0.2s;
}

.site-item img {
  object-fit: contain;
}

/* Mode: Text */
.mode-text .category-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.mode-text .site-item a {
  height: 56px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-sm);
  padding: 0 18px;
  justify-content: flex-start;
  color: var(--link-color);
  font-size: 16px;
  overflow: hidden;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.mode-text .site-item a:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mode-text .site-icon {
  width: 28px;
  height: 28px;
  margin-right: 16px;
  border-radius: 4px;
  flex-shrink: 0;
}

.mode-text .site-name {
  padding-left: 4px;
}

.mode-text .site-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mode: Circle */
.mode-circle .category-grid,
.mode-rounded-rect .category-grid,
.mode-icon .category-grid {
  grid-template-columns: repeat(8, 1fr);
  gap: 0px 4px; /* ★ 圆点/圆角/图标模式卡片间距主控制点：上下16px 左右12px（顺序：row-gap column-gap） */
}

.mode-circle .site-item a,
.mode-rounded-rect .site-item a,
.mode-icon .site-item a {
  flex-direction: column;
  text-align: center;
}

.mode-circle .site-icon-wrap,
.mode-rounded-rect .site-icon-wrap {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px; /* 图标到下方标题的【上下间距】8px（圆点/圆角模式） */
  transition: all 0.2s;
}

.mode-circle .site-icon-wrap {
  width: 70px;
  height: 70px;
  background: #fff;
  border: 3px solid transparent;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mode-circle .site-item a:hover .site-icon-wrap {
  transform: translateY(-3px) scale(1.07);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
}

.mode-circle .site-icon {
  width: 46px;
  height: 46px;
}

/* 彩虹色环：更淡的马卡龙色（200 级），每一列一个色相 */
.mode-circle .category-grid .site-item:nth-child(8n+1) .site-icon-wrap { border-color: #ffc9c9; }
.mode-circle .category-grid .site-item:nth-child(8n+2) .site-icon-wrap { border-color: #ffe8cc; }
.mode-circle .category-grid .site-item:nth-child(8n+3) .site-icon-wrap { border-color: #fff3bf; }
.mode-circle .category-grid .site-item:nth-child(8n+4) .site-icon-wrap { border-color: #d3f9d8; }
.mode-circle .category-grid .site-item:nth-child(8n+5) .site-icon-wrap { border-color: #d0ebff; }
.mode-circle .category-grid .site-item:nth-child(8n+6) .site-icon-wrap { border-color: #e5dbff; }
.mode-circle .category-grid .site-item:nth-child(8n+7) .site-icon-wrap { border-color: #fcc2d7; }
.mode-circle .category-grid .site-item:nth-child(8n+8) .site-icon-wrap { border-color: #c5f6fa; }

/* 圆角矩形：白玻璃卡片 + 淡色徽章 */
.mode-rounded-rect .site-item a {
  padding: 2px 4px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  box-shadow: none;
  transition: transform 0.2s ease;
}

.mode-rounded-rect .site-item a:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.mode-rounded-rect .site-icon-wrap {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #eef5ff, #f9fcff);
  border: none;
  border-radius: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.mode-rounded-rect .site-icon {
  width: 40px;
  height: 40px;
}

.mode-rounded-rect .site-name {
  font-weight: 600;
  color: #666;
}

.mode-circle .site-icon,
.mode-rounded-rect .site-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

/* 全局图标清晰度增强：抗锯齿 + 锐化 + 边缘 hairline */
.site-icon,
.site-icon-wrap img,
.site-icon-wrap > img,
img.site-icon {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  filter: contrast(1.06) saturate(1.08);
}
.site-icon-wrap {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.mode-circle .site-name,
.mode-rounded-rect .site-name,
.mode-icon .site-name {
  font-size: 13px;
  color: #444;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mode: Icon —— 大图标 8 列布局 */
  .mode-icon .category-grid {
    grid-template-columns: repeat(8, 1fr);
    gap: 8px 0px;
  }

  .mode-icon .site-icon-wrap {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1px;
    transition: transform 0.15s ease;
  }

  .mode-icon .site-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
  }

  .mode-icon .site-item a:hover .site-icon-wrap {
    transform: translateY(-2px);
  }

/* 管理员内联操作：编辑 / 删除（图标右上角） */
.site-actions {
  position: absolute;
  top: -8px;
  right: -8px;
  display: none;
  gap: 4px;
  z-index: 6;
}

.site-item:hover .site-actions {
  display: flex;
}

.site-actions span {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s;
}

.site-actions span:hover {
  transform: scale(1.15);
}

.site-actions .site-edit {
  background: #3b82f6;
}

.site-actions .site-delete {
  background: #ff5252;
}

.mode-text .site-actions {
  top: -10px;
  right: -6px;
}

/* Modals */
@keyframes overlayFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes panelPop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: overlayFade .2s ease;
}

body.modal-open { overflow: hidden; }

.modal-panel {
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 86vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  animation: panelPop .2s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: #fff;
  border-bottom: 1px solid #eef1f5;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header h3 i {
  color: var(--accent-color);
}

.modal-close {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: #f0f4f8;
  color: #2196f3;
  transform: rotate(90deg);
}

.modal-panel > div:not(.modal-header) {
  overflow-y: auto;
  padding: 22px 24px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.modal-panel > div:not(.modal-header)::-webkit-scrollbar { display: none; }

/* Hot Bang Modal — 已停用（替换为注册说明弹窗） */

/* 注册说明弹窗 */
.reg-help-panel {
  max-width: 680px;
  width: 92vw;
}

.reg-help-body {
  padding: 18px 22px 22px;
  max-height: 75vh;
  overflow-y: auto;
  color: #333;
  line-height: 1.7;
}

.reg-help-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #eef6ff 0%, #f5f0ff 100%);
  border: 1px solid #e3eaff;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 18px;
}
.reg-help-hero > i {
  font-size: 24px;
  color: var(--accent-color, #3a7afe);
  flex-shrink: 0;
}
.reg-help-hero .reg-help-tip {
  margin: 0;
  color: #555;
  font-size: 14px;
}

.reg-help-h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin: 18px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #e5e5e5;
}
.reg-help-h4 > i {
  color: var(--accent-color, #3a7afe);
  font-size: 14px;
}

.reg-help-feat {
  list-style: none;
  padding: 0;
  margin: 0 0 6px;
}
.reg-help-feat li {
  position: relative;
  padding: 8px 10px 8px 28px;
  font-size: 14px;
  color: #444;
  border-radius: var(--radius-sm);
}
.reg-help-feat li:nth-child(odd) {
  background: #fafbfd;
}
.reg-help-feat li > i {
  position: absolute;
  left: 8px;
  top: 11px;
  color: #22c55e;
  font-size: 14px;
}

.reg-help-steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0 0 6px;
}
.reg-help-steps > li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 6px;
}
.reg-help-steps .step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-color, #3a7afe);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.reg-help-steps .step-body { flex: 1; min-width: 0; }
.reg-help-steps .step-body strong {
  display: block;
  font-size: 14px;
  color: #222;
  margin-bottom: 4px;
}
.reg-help-steps .step-body p {
  margin: 0;
  font-size: 13px;
  color: #666;
}
.reg-help-steps .step-body em {
  font-style: normal;
  color: var(--accent-color, #3a7afe);
  background: rgba(58, 122, 254, 0.08);
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 500;
}

.hot-heat {
  font-size: 12px;
  color: #999;
  margin-left: 10px;
}

/* Settings Modal */
.setting-group {
  margin-bottom: 18px;
}

.setting-group > label {
  display: block;
  font-size: 13px;
  color: #666;
  margin-bottom: 10px;
}

.mode-options,
.color-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mode-options span,
.color-options span {
  padding: 6px 14px;
  background: #fff;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #555;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.mode-options span:hover,
.mode-options span.active,
.color-options span:hover,
.color-options span.active {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.color-options span {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  position: relative;
}

.color-options span.active::after {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 12px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.switch-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  margin-bottom: 8px;
}

.switch-item input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-color);
}

/* Background Modal */
.bg-section {
  margin-bottom: 16px;
}

.bg-section h4 {
  font-size: 13px;
  color: #666;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bg-section h4 span {
  color: #999;
  font-weight: normal;
}

.bg-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.bg-preset {
  height: 50px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 2px solid transparent;
  background-size: cover;
  background-position: center;
  transition: all 0.2s;
}

.bg-preset:hover,
.bg-preset.active {
  border-color: var(--accent-color);
}

.bg-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #ddd;
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 13px;
  margin-bottom: 8px;
}

.bg-apply {
  width: 100%;
  height: 36px;
  background: var(--accent-color);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.bg-apply:hover {
  background: var(--accent-hover);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent-color);
}

/* Site Modal */
.site-tip {
  font-size: 13px;
  color: #8a94a6;
  margin-bottom: 14px;
  line-height: 1.5;
}

.site-form {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.site-form input,
.site-form select {
  height: 44px;
  padding: 0 14px;
  border: 1px solid #d8dee6;
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  color: #1f2937;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.site-form input:focus,
.site-form select:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.15);
}

.site-form button {
  height: 44px;
  background: linear-gradient(135deg, #2196f3, #2386ea);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(33, 150, 243, 0.32);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.site-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 22px rgba(33, 150, 243, 0.4);
}

.site-form button.btn-just-added {
  background: linear-gradient(135deg, #43a047, #2e7d32);
  box-shadow: 0 6px 16px rgba(46, 125, 50, 0.32);
}

/* 自动提取标题/图标进行中的占位灰字 */
.site-form input.meta-loading {
  color: #bbb;
  font-style: italic;
}
.site-form input.meta-loading::placeholder {
  color: #bbb;
  font-style: italic;
}

/* ===== 内容管理：Tab ===== */
.mgr-tabs {
  display: flex;
  gap: 4px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--card-bg);
}

.mgr-tab {
  padding: 13px 20px;
  font-size: 14px;
  color: var(--muted-color);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  user-select: none;
}

.mgr-tab:hover {
  color: var(--accent-color);
}

.mgr-tab.active {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
  font-weight: 600;
  border-radius: 4px 4px 0 0;
}

.mgr-pane {
  display: none;
}

.mgr-pane.active {
  display: block;
}

.form-actions {
  display: flex;
  gap: 8px;
}

.form-actions button {
  flex: 1;
}

.btn-cancel {
  background: linear-gradient(135deg, #9aa3ad, #7c8694) !important;
}

.btn-cancel:hover {
  background: linear-gradient(135deg, #868f99, #6b7480) !important;
}

/* 列表项操作按钮 */
.item-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.item-actions span {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: #f0f0f0;
  color: #666;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.item-actions span:hover {
  background: var(--accent-color);
  color: #fff;
}

.item-actions span.del:hover {
  background: #f44336;
}

.cat-manage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 13px;
  color: #555;
}

.cat-manage-item.cs-editing { border: 1px solid var(--accent-color); background: #f5faff; }

.cat-manage-item .cat-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cat-manage-item .cat-left i {
  color: var(--accent-color);
  width: 16px;
  text-align: center;
}

.cat-manage-item .cat-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cat-manage-item .cat-badge {
  font-size: 11px;
  color: #bbb;
  margin-left: 4px;
}

/* 服务器同步 */
.sync-panel {
  border: 1px solid #e6ebf2;
  border-radius: 12px;
  background: #fafcff;
  padding: 16px 18px 18px;
  margin-bottom: 8px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.sync-panel h4 {
  margin: 0 0 10px;
  font-size: 14px;
  color: #444;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sync-panel h4 i {
  color: var(--accent-color);
}

.sync-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.sync-label {
  flex-shrink: 0;
  font-size: 13px;
  color: #666;
}

.sync-row input {
  flex: 1;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #d8dee6;
  border-radius: 10px;
  font-size: 13px;
  outline: none;
  background: #fff;
  min-width: 0;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.sync-row input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.15);
}

.sync-panel .switch-item {
  font-size: 13px;
  color: #666;
  margin-bottom: 10px;
}

.sync-status {
  margin: 10px 0 0;
  font-size: 12px;
  color: #888;
  line-height: 1.6;
  word-break: break-all;
}

.sync-status.ok {
  color: #22a06b;
}

.sync-status.error {
  color: #e5484d;
}

.sync-status.syncing,
.sync-status.pending {
  color: #d9822b;
}

/* 同步状态小圆点 */
.sync-dot {
  position: fixed;
  right: 6px;
  top: calc(50% + 42px);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #bbb;
  z-index: 60;
  cursor: default;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.sync-dot.ok {
  color: #22a06b;
}

.sync-dot.error {
  color: #e5484d;
}

.sync-dot.syncing,
.sync-dot.pending {
  color: #d9822b;
  animation: syncPulse 1.2s ease-in-out infinite;
}

@keyframes syncPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* 备份导出 */
.backup-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.btn-backup {
  height: 42px;
  border: 1px solid #dbe6f3;
  border-radius: 10px;
  background: linear-gradient(135deg, #f3f9ff, #eaf3ff);
  font-size: 13px;
  color: #1f6fb8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-backup:hover {
  border-color: var(--accent-color);
  background: linear-gradient(135deg, #e8f3ff, #dcebff);
  color: #1769c4;
}

.btn-backup.danger:hover {
  border-color: #f44336;
  background: linear-gradient(135deg, #fff0f0, #ffe3e3);
  color: #d32f2f;
}

.code-out {
  width: 100%;
  height: 180px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: var(--radius-sm);
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #555;
  resize: vertical;
  background: #fafafa;
}

@media (max-width: 600px) {
  .backup-actions {
    grid-template-columns: 1fr;
  }
}

/* Login Modal */
.login-panel {
  max-width: 360px;
}

.login-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-tip {
  font-size: 12px;
  color: #999;
  text-align: center;
}

.login-body input {
  height: 42px;
  padding: 0 14px;
  border: 1px solid #ddd;
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 14px;
}

.login-submit {
  height: 42px;
  background: var(--accent-color);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-top: 4px;
}

.login-submit:hover {
  background: var(--accent-hover);
}

.login-guest {
  font-size: 12px;
  color: #999;
  text-align: center;
}

.login-guest a {
  color: var(--accent-color);
}

/* ===== 账号管理 ===== */
.account-panel {
  max-width: 400px;
}

.acct-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--link-color);
}

.acct-item .acct-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.acct-item .acct-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.acct-item .acct-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acct-item .acct-badge {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(33, 150, 243, 0.12);
  color: var(--accent-color);
  flex-shrink: 0;
}

.acct-empty {
  font-size: 13px;
  color: #999;
  padding: 6px 0;
}

/* Responsive */
@media (max-width: 1023px) {
  .category-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }

  .mode-icon .category-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 8px 6px !important;
  }

  .mode-icon .site-icon-wrap {
    width: 48px;
    height: 48px;
    margin-bottom: 6px;
  }

  .mode-icon .site-icon {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 767px) {
  #top-nav {
    padding-top: 24px;
  }

  .clock-time {
    font-size: 48px;
  }

  #search {
    width: 94%;
  }

  #catNavBar {
    width: 94%;
  }

  #siteListBox {
    width: 94%;
  }

  .category-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px;
  }

  .mode-text .category-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .mode-circle .category-grid,
  .mode-rounded-rect .category-grid,
  .mode-icon .category-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 10px 6px; /* 手机(≤767px)圆点/圆角/图标模式卡片间距：上下10 左右6 */
  }

  .mode-circle .site-icon-wrap,
  .mode-rounded-rect .site-icon-wrap {
    width: 56px;
    height: 56px;
  }

  .mode-circle .site-icon,
  .mode-rounded-rect .site-icon {
    width: 28px;
    height: 28px;
  }

  .mode-icon .site-icon-wrap {
    width: 48px;
    height: 48px;
  }

  .mode-icon .site-icon {
    width: 40px;
    height: 40px;
  }

  .bot-link span {
    margin: 0 6px;
    font-size: 12px;
  }

  .modal-panel {
    max-height: 85vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .reg-help-panel {
    max-width: 100%;
    max-height: 90vh;
  }
  .reg-help-body {
    max-height: 78vh;
    padding: 14px 16px 18px;
  }
}

@media (max-width: 374px) {
  .mode-circle .category-grid,
  .mode-rounded-rect .category-grid,
  .mode-icon .category-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* ===== 右侧浮动按钮（列表入口） ===== */
.list-fab {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-right: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  padding: 14px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  color: var(--accent-color);
  box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.25s;
  z-index: 90;
  user-select: none;
}

.list-fab:hover {
  width: 52px;
  padding-right: 10px;
  color: #fff;
  background: var(--accent-color);
}

.list-fab i {
  font-size: 16px;
  pointer-events: none;
}

.list-fab::after {
  content: '列表';
  writing-mode: vertical-rl;
  font-size: 12px;
  letter-spacing: 2px;
  color: inherit;
  pointer-events: none;
}

/* ===== 抽屉遮罩 ===== */
.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 200;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== 抽屉面板 ===== */
.drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  max-width: 90vw;
  height: 100vh;
  background: var(--card-bg);
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.15);
  z-index: 201;
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.25s ease;
  overflow: hidden;
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--accent-color);
  color: #fff;
}

.drawer-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.drawer-header h3 i {
  margin-right: 6px;
}

.drawer-close {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s;
}

.drawer-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.drawer-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.drawer-section h4 {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted-color);
  font-weight: 500;
}

.drawer-cats,
.drawer-tools {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.drawer-cats li {
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-color);
  transition: all 0.2s;
}

.drawer-cats li i {
  color: var(--accent-color);
  font-size: 14px;
}

.drawer-cats li:hover {
  background: var(--accent-color);
  color: #fff;
}

.drawer-cats li:hover i {
  color: #fff;
}

.drawer-tools {
  grid-template-columns: 1fr;
}

.drawer-tools li {
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-color);
  transition: all 0.2s;
}

.drawer-tools li i {
  color: var(--accent-color);
  font-size: 14px;
  width: 18px;
  text-align: center;
}

.drawer-tools li:hover {
  background: var(--accent-color);
  color: #fff;
}

.drawer-tools li:hover i {
  color: #fff;
}

.drawer-tools li.drawer-logout {
  margin-top: 8px;
  background: rgba(244, 67, 54, 0.06);
  color: #d34c4c;
}
.drawer-tools li.drawer-logout i {
  color: #d34c4c;
}
.drawer-tools li.drawer-logout:hover {
  background: #f44336;
  color: #fff;
}
.drawer-tools li.drawer-logout:hover i {
  color: #fff;
}

@media (max-width: 600px) {
  .drawer-panel {
    width: 280px;
  }
  .list-fab {
    width: 38px;
    padding: 12px 4px;
  }
  .list-fab:hover {
    width: 44px;
  }
}
