/* 颜色变量 */
:root {
  --bg-color: #ffffff;
  --text-color: #333333;
  --nav-bg-color: #f8f8f8;
  --nav-link-color: #555555;
  --nav-link-hover-color: #55b2f5;
  --border-color: #ddd;
  --username-color: #555555;
  --ping-color: #999999;

  --notify-bg-color: #fff;
  --notify-text-color: #333;
  --notify-border-color: #ccc;
  --notify-close-hover-bg: #eee;

  --save-button-bg: #4caf50;
  --save-button-bg-hover: #43a047;

  --edit-button-bg: #2196f3;
  --edit-button-bg-hover: #1976d2;

  --delete-button-bg: #f44336;
  --delete-button-bg-hover: #e53935;

  --button-text-color: #fff;

  --title-color: #007cf0;
  --title-color-right: #00dfd8;
}

[data-theme="dark"] {
  --bg-color: #121212;
  --text-color: #eeeeee;
  --nav-bg-color: #1e1e1e;
  --nav-link-color: #bbbbbb;
  --nav-link-hover-color: #7abaff;
  --border-color: #444;
  --username-color: #bbbbbb;
  --ping-color: #777777;

  --notify-bg-color: #222;
  --notify-text-color: #eee;
  --notify-border-color: #555;
  --notify-close-hover-bg: #444;

  --save-button-bg: #388e3c;
  --save-button-bg-hover: #2e7d32;

  --edit-button-bg: #1976d2;
  --edit-button-bg-hover: #1565c0;

  --delete-button-bg: #d32f2f;
  --delete-button-bg-hover: #c62828;

  --title-color: #bbbbbb;
  --title-color-right: #7abaff;
}

[data-theme="pink"] {
  --bg-color: #fff0f5;
  --text-color: #4a154b;
  --nav-bg-color: #ffe4f0;
  --nav-link-color: #d81b60;
  --nav-link-hover-color: #f06292;
  --border-color: #f8bbd0;
  --username-color: #ad1457;
  --ping-color: #ec407a;

  --notify-bg-color: #fff0f5;
  --notify-text-color: #4a154b;
  --notify-border-color: #f48fb1;
  --notify-close-hover-bg: #fce4ec;

  --save-button-bg: #ec407a;
  --save-button-bg-hover: #d81b60;

  --edit-button-bg: #f06292;
  --edit-button-bg-hover: #e91e63;

  --delete-button-bg: #f44336;
  --delete-button-bg-hover: #e53935;

  --button-text-color: #fff;

  --title-color: #ec407a;
  --title-color-right: #f48fb1;
}

[data-theme="blue"] {
  --bg-color: #e3f2fd;
  --text-color: #0d47a1;
  --nav-bg-color: #bbdefb;
  --nav-link-color: #1976d2;
  --nav-link-hover-color: #64b5f6;
  --border-color: #90caf9;
  --username-color: #0d47a1;
  --ping-color: #42a5f5;

  --notify-bg-color: #e3f2fd;
  --notify-text-color: #0d47a1;
  --notify-border-color: #64b5f6;
  --notify-close-hover-bg: #bbdefb;

  --save-button-bg: #42a5f5;
  --save-button-bg-hover: #1e88e5;

  --edit-button-bg: #2196f3;
  --edit-button-bg-hover: #1976d2;

  --delete-button-bg: #f44336;
  --delete-button-bg-hover: #e53935;

  --button-text-color: #fff;

  --title-color: #007cf0;
  --title-color-right: #00dfd8;
}

[data-theme="green"] {
  --bg-color: #e8f5e9;
  --text-color: #1b5e20;
  --nav-bg-color: #c8e6c9;
  --nav-link-color: #388e3c;
  --nav-link-hover-color: #81c784;
  --border-color: #a5d6a7;
  --username-color: #2e7d32;
  --ping-color: #66bb6a;

  --notify-bg-color: #e8f5e9;
  --notify-text-color: #1b5e20;
  --notify-border-color: #a5d6a7;
  --notify-close-hover-bg: #c8e6c9;

  --save-button-bg: #43a047;
  --save-button-bg-hover: #2e7d32;

  --edit-button-bg: #66bb6a;
  --edit-button-bg-hover: #43a047;

  --delete-button-bg: #f44336;
  --delete-button-bg-hover: #e53935;

  --button-text-color: #fff;

  --title-color: #43a047;
  --title-color-right: #66bb6a;
}

[data-theme="dark-blue"] {
  --bg-color: #0d1117; /* 主背景深蓝 */
  --text-color: #dbe9f9; /* 主文本淡蓝白 */
  --nav-bg-color: #161b22; /* 导航背景 */
  --nav-link-color: #4ea1f3; /* 链接颜色 */
  --nav-link-hover-color: #90caf9; /* 链接悬停 */
  --border-color: #30363d; /* 边框颜色 */
  --username-color: #58a6ff; /* 用户名颜色 */
  --ping-color: #79c0ff; /* @提及颜色 */

  --notify-bg-color: #161b22; /* 通知背景 */
  --notify-text-color: #dbe9f9; /* 通知文字 */
  --notify-border-color: #30363d; /* 通知边框 */
  --notify-close-hover-bg: #1e2530; /* 通知关闭悬停 */

  --save-button-bg: #238636; /* 保存按钮：绿色 */
  --save-button-bg-hover: #2ea043; /* 保存按钮悬停 */

  --edit-button-bg: #2d6cdf; /* 编辑按钮：亮蓝 */
  --edit-button-bg-hover: #1f4fbf; /* 编辑按钮悬停 */

  --delete-button-bg: #da3633; /* 删除按钮：红色 */
  --delete-button-bg-hover: #b62324; /* 删除按钮悬停 */

  --button-text-color: #ffffff;

  --title-color: #58a6ff; /* 渐变起始：亮蓝 */
  --title-color-right: #a5d6ff; /* 渐变结束：更浅的亮蓝 */
  --clear-button-color: rgba(0, 238, 255, 0.123);
}

/* 全局基础样式 */
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
}


.template_title {
  text-align: center;
  font-size: 2.8em;
  font-weight: bold;
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(90deg, var(--title-color), var(--title-color-right));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 40px 0;
  position: relative;
}

.template_title::after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background: linear-gradient(to right, var(--title-color), var(--title-color-right));
  margin: 12px auto 0;
  border-radius: 5px;
  animation: underlineFadeIn 1s ease-in-out forwards;
}

@keyframes underlineFadeIn {
  0% {
    width: 0;
    opacity: 0;
  }
  100% {
    width: 100px;
    opacity: 1;
  }
}


/* 导航栏 */
#navbar {
  background-color: var(--nav-bg-color);
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  z-index: 1000;
}

/* container 居中和宽度限制 */
#navbar .container {
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}

/* logo 样式 */
.logo {
  position: absolute;
  top: 5px;
  height: 30px;
  width: auto;
  display: block;
  margin-right: 10px;
}

/* 导航选择列表 */
#nav_select_list {
  display: flex;
  gap: 2rem;
}


/* ul 去默认样式，改成水平排列 */
#nav_select_list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* li 只用于包裹 */
#nav_select_list li {
  margin: 0;
  padding: 0;
}

/* 链接样式 */
/* 链接样式 */
.nav-link {
  text-decoration: none;
  color: var(--nav-link-color);
  font-weight: 600;
  font-size: 1rem;
  display: inline-block;
  transition:
    color 0.3s ease,
    transform 0.3s ease;
}
#nav_select_list li {
    list-style-type: none; /* 确保 li 元素没有标记 */
}
/* 悬停效果 */
.nav-link:hover {
  color: var(--nav-link-hover-color);
  transform: scale(1.15);
}

#contorl_panel {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
}
/* username 样式 */
#username {
    display: inline-block;      /* ✅ 关键：让 div 只占内容宽度 */
    color: var(--username-color);
    font-size: 1rem;
    padding-right: 1rem;
}

/* ping_ms 样式 */
#ping_ms {
  position: fixed;
  bottom: 5px;
  right: 5px;
  font-size: 0.8rem;
  color: var(--ping-color);
}

#notification-bell {
  top: 5px;
  right: 15px;
  position: absolute;
  cursor: pointer;
  font-size: 24px;
  color: var(--username-color);
    transition:
    color 0.3s ease,
    transform 0.3s ease;
}

#notification-bell:hover {
  color: var(--nav-link-hover-color);
  transform: scale(1.15);
}

#notification-count {
  position: absolute;   /* 或 fixed，但要统一上下文 */
  top: 0px;              /* 明确位置 */
  right: 0px;            /* 明确位置 */
  transform: translate(50%, -50%);  /* 细致调整 */
  background: red;
  color: white;
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 50%;
  display: none;
}


/* 弹窗动画 */
@keyframes fadeInScale {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* 弹窗容器 */
#custom-notify-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--bg-color);
    color: var(--text-color);
    min-width: 320px;
    max-width: 90vw;
    max-height: 70vh;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border-radius: 8px;
    z-index: 97;
    font-family: Arial, sans-serif;
    animation: fadeInScale 0.25s ease forwards;
}

/* 关闭按钮 */
#custom-notify-popup button.close-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 1.4rem;
    color: var(--text-color);
    cursor: pointer;
}

/* 标题 */
#custom-notify-popup h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    user-select: none;
}

/* 通知链接列表 */
#custom-notify-popup div.content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#custom-notify-popup div.content a {
    color: var(--text-color);
    text-decoration: underline;
    cursor: pointer;
}

#custom-notify-popup div.content a:hover {
    color: var(--nav-link-hover-color);
    font-size: larger;
}


/* 遮罩层 */
#custom-notify-mask {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 95;
    backdrop-filter: blur(2px);
}

#base_container{
    width: 100%;
    margin: auto;
}

  .push-popup {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background-color: var(--nav-link-hover-color);
    color: var(--bg-color);
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 99;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition:
      opacity 0.3s ease,
      transform 0.3s ease;
  }

  .push-popup.show {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    pointer-events: auto;
  }

  .push-popup.fade-out {
    opacity: 0;
    transform: translateX(-50%) scale(0.95);
  }

#status-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5); /* 半透明黑背景 */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease-out;
}

.loading-logo {
  width: 80px;
  height: 80px;
  animation: pulse 1.5s infinite ease-in-out;
  border-radius: 8px;
}

.clear-all-btn {
  background-color: var(--edit-button-bg); /* 使用变量设置背景色 */
  color: var(--button-text-color); /* 使用变量设置文本颜色 */
  border: 1px solid var(--notify-border-color); /* 使用变量设置边框颜色 */
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease; /* 平滑过渡 */
}

.clear-all-btn:hover {
  background-color: var(--edit-button-bg-hover); /* 使用变量设置悬停背景色 */
  border-color: var(--notify-border-color); /* 使用变量设置悬停时的边框颜色 */
}

.clear-all-btn:focus {
  outline: none; /* 去掉焦点时的默认蓝色边框 */
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5); /* 聚焦时的阴影效果 */
}

.clear-all-btn:active {
  background-color: var(--edit-button-bg-hover); /* 按下按钮时的背景色 */
  transform: scale(0.98); /* 按下时的轻微缩小效果 */
}


@keyframes pulse {
  0%   { transform: scale(1); opacity: 0.6; }
  50%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 0.6; }
}

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