:root {
  --primary-color: #3b82f6;
  --secondary-color: #60a5fa;
  --text-color: #1f2937;
  --card-background: rgba(255, 255, 255, 0.9);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --background-light: linear-gradient(-45deg, #e6f2ff, #fff0f5, #f0f7ff, #fff5e6);
  --background-dark: linear-gradient(-45deg, #1a202c, #2d3748, #4a5568, #2d3748);
  --success-color: #4caf50;
  --error-color: #f44336;
  --warning-color: #ff9800;
  --checking-color: #9ca3af;
  --animation-duration: 0.3s;
  --transition-timing: cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-mode {
  --primary-color: #60a5fa;
  --secondary-color: #3b82f6;
  --text-color: #e2e8f0;
  --card-background: rgba(26, 32, 44, 0.9);
}

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

body {
  font-family: "HarmonyOS Sans SC", sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--background-light);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  overflow-x: hidden;
  font-size: 16px;
  transition: var(--transition);
}

body.dark-mode {
  background: var(--background-dark);
}

@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.wrapper {
  padding: 2rem;
  width: 100%;
  max-width: 660px;
  position: relative;
}

.main {
  background-color: var(--card-background);
  border-radius: 20px;
  box-shadow: 1px 3px 6px 3px rgba(0, 0, 0, 0.1);
  padding: 2.5rem;
  backdrop-filter: blur(10px);
  transition: var(--transition);
}

.main:hover {
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

h1 {
  font-size: 2.5rem;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 1.5rem;
  font-weight: 700;
}

ul {
  list-style-type: none;
  margin-bottom: 1.5rem;
}

li {
  margin-bottom: 1rem;
  padding: 1rem;
  background-color: rgba(248, 250, 252, 0.8);
  border-radius: 10px;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  padding-top: 1.5rem;
}

.dark-mode li {
  background-color: rgba(26, 32, 44, 0.8);
}

li:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

li a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
  transition: var(--transition);
  display: flex;
  align-items: center;
}

li a:hover {
  color: var(--secondary-color);
}

li a i {
  margin-right: 0.5rem;
  font-size: 1.2em;
}

.notice {
  background-color: rgba(230, 242, 255, 0.8);
  /* border-left: 4px solid var(--primary-color); */
  padding: 1rem;
  margin-top: 1rem;
  border-radius: 10px;
  transition: var(--transition);
}

.dark-mode .notice {
  background-color: rgba(44, 55, 72, 0.8);
}

.notice:hover {
  background-color: rgba(230, 242, 255, 1);
}

.dark-mode .notice:hover {
  background-color: rgba(44, 55, 72, 1);
}

.footer {
  margin-top: 2rem;
  text-align: center;
  color: var(--text-color);
  font-weight: 300;
  opacity: 0.8;
  transition: var(--transition);
}

.footer:hover {
  opacity: 1;
}

.bookmark-btn {
  display: inline-flex;
  align-items: center; /* 垂直居中对齐 */
  justify-content: center; /* 水平居中对齐 */
  gap: 8px; /* 图标和文字之间的间距 */
  width: 100%;
  padding: 1rem;
  background-color: var(--primary-color);
  color: white;
  text-align: center;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.bookmark-btn:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.bookmark-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

.bookmark-btn:focus:not(:active)::after {
  animation: ripple 1s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 1;
  }

  20% {
    transform: scale(25, 25);
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: scale(40, 40);
  }
}

.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.bg-animation span {
  position: absolute;
  display: block;
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.2);
  animation: move 25s infinite linear;
}

.dark-mode .bg-animation span {
  background: rgba(255, 255, 255, 0.1);
}

.bg-animation span:nth-child(1) {
  top: 20%;
  left: 20%;
  animation-duration: 15s;
}

.bg-animation span:nth-child(2) {
  top: 60%;
  left: 80%;
  animation-duration: 17s;
  width: 40px;
  height: 40px;
}

.bg-animation span:nth-child(3) {
  top: 40%;
  left: 40%;
  animation-duration: 19s;
}

.bg-animation span:nth-child(4) {
  top: 80%;
  left: 10%;
  animation-duration: 21s;
}

@keyframes move {
  0% {
    transform: translateX(0) translateY(0) rotate(0);
    opacity: 1;
    border-radius: 0;
  }

  100% {
    transform: translateX(-1000px) translateY(-1000px) rotate(720deg);
    opacity: 0;
    border-radius: 50%;
  }
}

.ms-display {
  position: absolute;
  top: 0;
  left: 0;
  font-size: 0.7em;
  padding: 2px 5px;
  border-top-left-radius: 10px;
  border-bottom-right-radius: 10px;
  color: white;
  transition: background-color 0.3s ease;
}

.ms-checking {
  background-color: #ffeb3b;
  color: black;
}

.ms-normal {
  background-color: #4caf50;
}

.ms-error {
  background-color: #f44336;
}

.status-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.8em;
  margin-left: 10px;
  color: white;
}

.status-normal {
  background-color: #4caf50;
}

.status-error {
  background-color: #f44336;
}

.status-checking {
  background-color: #ffeb3b;
  color: black;
}

li.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

li.disabled a {
  pointer-events: none;
}

.mode-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  z-index: 10;
}

.mode-toggle:hover {
  color: var(--primary-color);
}

#stats-container {
  background-color: var(--card-background);
  border-radius: 10px;
  padding: 15px;
  margin-top: 20px;
  box-shadow: 1px 3px 6px 2px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
}

#stats-container:hover {
  box-shadow: 1px 5px 6px 2px rgba(0, 0, 0, 0.15);
}

#last-checked-time {
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.stats-row {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-top: 10px;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 1.5em;
  font-weight: bold;
}

.stat-label {
  font-size: 0.9em;
  color: var(--text-color);
  opacity: 0.8;
}

.url-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

/* 移动端响应式设计 */
@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  .wrapper {
    padding: 1rem;
  }

  .main {
    padding: 1.5rem;
  }

  h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  .bookmark-btn {
    padding: 0.75rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }

  .bookmark-btn svg {
    width: 1.4em;
    height: 1.4em;
  }

  li {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    padding-top: 1.25rem;
  }

  .url-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .url-content span:first-child {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
  }

  li a {
    font-size: 0.8rem;
  }

  .status-badge {
    font-size: 0.7em;
    padding: 1px 4px;
    margin-left: 0;
    margin-top: 0.25rem;
  }

  .ms-display {
    font-size: 0.6em;
    padding: 1px 3px;
  }

  .notice {
    padding: 0.75rem;
    font-size: 0.8rem;
  }

  #stats-container {
    padding: 10px;
    margin-top: 15px;
  }

  #last-checked-time {
    font-size: 0.9em;
  }

  .stat-value {
    font-size: 1.2em;
  }

  .stat-label {
    font-size: 0.8em;
  }

  .footer {
    margin-top: 1.5rem;
    font-size: 0.8rem;
  }

  .mode-toggle {
    font-size: 1.2rem;
  }

  .mode-toggle svg {
    width: 1.2em;
    height: 1.2em;
  }

  svg {
    width: 0.9em;
    height: 0.9em;
  }
}

/* SVG 基础样式 */
svg {
  vertical-align: middle;
  margin-right: 5px;
  width: 1em;
  height: 1em;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 特定位置的 SVG 样式调整 */
.mode-toggle svg {
  width: 1.5em;
  height: 1.5em;
  margin: 0;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.bookmark-btn svg {
  width: 1.6em;
  height: 1.6em;
  fill: white;
  transform-origin: center;
  margin: 0; /* 移除默认的右边距 */
  flex-shrink: 0; /* 防止图标被压缩 */
}

.url-content svg {
  width: 1em;
  height: 1em;
  margin-right: 0.5em;
  stroke-width: 2;
  fill: none;
  stroke: currentColor;
  transition: all 0.3s var(--transition-timing);
}

.notice svg {
  color: var(--primary-color);
}

#stats-container svg {
  width: 1.1em;
  height: 1.1em;
  stroke-width: 2;
  fill: none;
  stroke: currentColor;
}

#last-checked-time:hover svg {
  animation: spin 10s linear infinite;
}

.status-checking svg {
  animation: spin 1s linear infinite;
}

/* 状态图标样式 */
.stat-value svg {
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 暗黑模式适配 */
.dark-mode svg {
  color: var(--text-color);
}

.dark-mode .notice svg {
  color: var(--secondary-color);
}

/* 移动端适配 */

/* SVG 图标动画 */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

@keyframes ring {
  0%,
  100% {
    transform: rotate(0);
  }
  20%,
  60% {
    transform: rotate(-6deg);
  }
  40%,
  80% {
    transform: rotate(6deg);
  }
}

/* 统一的 SVG 基础样式 */
.icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

svg {
  vertical-align: middle;
  transition: transform var(--animation-duration) var(--transition-timing);
}

/* 图标尺寸类 */
.icon-sm svg {
  width: 14px;
  height: 14px;
}
.icon-md svg {
  width: 18px;
  height: 18px;
}
.icon-lg svg {
  width: 24px;
  height: 24px;
}

/* 图标颜色类 */
.icon-primary svg {
  color: var(--primary-color);
}
.icon-success svg {
  color: var(--success-color);
}
.icon-error svg {
  color: var(--error-color);
}
.icon-warning svg {
  color: var(--warning-color);
}

/* 图标动画类 */
.icon-spin svg {
  animation: spin 1s linear infinite;
}

.icon-pulse svg {
  animation: pulse 2s ease-in-out infinite;
}

.icon-ring svg {
  animation: ring 1s ease-in-out;
}

/* 特定位置的图标样式增强 */
.mode-toggle svg {
  width: 1.5em;
  height: 1.5em;
  transition: transform 0.5s var(--transition-timing);
}

.mode-toggle:hover svg {
  transform: rotate(180deg);
}

.bookmark-btn svg {
  width: 1.6em;
  height: 1.6em;
  fill: white;
  transform-origin: center;
  transition: transform 0.3s var(--transition-timing);
}

.notice svg {
  width: 1.2em;
  height: 1.2em;
  stroke: var(--primary-color);
  fill: none;
  transform-origin: top;
}

.notice:hover svg {
  animation: ring 1s ease-in-out;
}

#stats-container svg {
  width: 1.1em;
  height: 1.1em;
  stroke-width: 2;
  transition: transform 0.3s var(--transition-timing);
}

#stats-container .stat-item:hover svg {
  transform: scale(1.1);
}

/* 状态检查图标样式 */
.status-checking svg {
  animation: spin 1s linear infinite;
  color: var(--checking-color);
}

.dark-mode .notice svg {
  stroke: var(--secondary-color);
}

/* 移动端适配 */

/* 删除重复的样式，只保留一个基础定义 */
.stat-value .icon-success svg {
  fill: none;
  stroke: var(--success-color);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-value .icon-error svg {
  fill: none;
  stroke: var(--error-color);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 暗黑模式下保持状态图标颜色不变 */
.dark-mode .stat-value .icon-success svg {
  stroke: var(--success-color); /* 保持对勾颜色不变 */
}

.dark-mode .stat-value .icon-error svg {
  stroke: var(--error-color); /* 保持错误图标颜色不变 */
}
