:root {
  --primary-color: #007bff;
  --bg: #0f172a;
  --card: #111827a8; /* 半透明卡片基色 */
  --card-plain: #1e293b;
  --muted: #9aa6bf;
  --text: #e2e8f0;
  --accent: #28a745;
  --border: #334155;
  --glass: rgba(255, 255, 255, 0.04);
}

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

html,
body {
  height: 100%;
}

body {
  font-family: 'Poppins', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(180deg, #071024 0%, #0f172a 60%);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.25s ease;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('img/cser.png') right bottom no-repeat;
  background-size: contain;
  opacity: 0.1; /* Adjust opacity as needed */
  pointer-events: none;
  z-index: -1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* header / nav */
header.hero {
  background: linear-gradient(rgba(7, 16, 36, 0.72), rgba(7, 16, 36, 0.9)), url('https://images.unsplash.com/photo-1582738412147-383a836b6b78?q=80&w=2070&auto=format&fit=crop') center/cover no-repeat;
  padding: 64px 20px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1200px;
  margin: 12px auto 0;
  padding: 0 24px;
}

/* 将 nav-actions 移动到 brand 左侧 */
.topbar .nav-actions {
  order: -1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-color), #5cc0ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 6px 24px rgba(2, 6, 23, 0.5);
}

.brand h3 {
  font-size: 1.05rem;
  margin: 0;
}

.nav-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* hamburger and about button */
.action-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--glass);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  backdrop-filter: blur(6px);
  color: var(--text);
  font-size: 1.2rem;
}

.action-button:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}

.action-button svg {
  width: 22px;
  height: 22px;
  fill: var(--text);
}


/* hero main */
.hero-inner {
  max-width: 980px;
  margin: 8px auto 0;
}

.hero h1 {
  font-size: 2.6rem;
  margin-bottom: 8px;
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.6);
}

.hero p {
  color: var(--muted);
  margin-bottom: 18px;
}

.cta-group {
  display: inline-flex;
  gap: 12px;
  align-items: center;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--primary-color);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 8px 30px rgba(0, 123, 255, 0.14);
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.18s;
  transform-origin: center;
}

.cta:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 18px 40px rgba(0, 123, 255, 0.2);
}

.cta svg {
  width: 18px;
  height: 18px;
}

.cta.secondary {
  background: linear-gradient(90deg, var(--accent), #50d26a);
  box-shadow: 0 8px 30px rgba(40, 167, 69, 0.12);
}

/* cards & features */
.section {
  padding: 56px 0;
}

.section-title {
  text-align: center;
  font-size: 1.9rem;
  margin-bottom: 8px;
}

.section-desc {
  text-align: center;
  color: var(--muted);
  max-width: 900px;
  margin: 0 auto 36px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.015));
  border-radius: 12px;
  padding: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.45);
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.2, 1), box-shadow 0.22s, backdrop-filter 0.22s;
  transform-origin: center;
  backdrop-filter: blur(6px) saturate(120%);
}

/* hover 放大 + 云母 (mica) 光泽边 */
.card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 24px 56px rgba(2, 6, 23, 0.6);
}

.card h3 {
  margin-bottom: 8px;
}

.card p {
  color: var(--muted);
  font-size: 0.95rem;
}

.full-list {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.02), transparent);
  padding: 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.full-list ul {
  list-style: disc;
  padding-left: 20px;
}

.full-list li {
  margin: 8px 0;
  color: var(--muted);
}

.comparison {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 12px 14px;
  border: 1px solid var(--border);
  text-align: center;
}

thead th {
  background: #07102a;
  color: var(--text);
}

td:first-child {
  text-align: left;
  font-weight: 600;
}

.highlight {
  background: linear-gradient(90deg, rgba(0, 123, 255, 0.05), transparent);
  border-left: 3px solid var(--primary-color);
  border-right: 3px solid var(--primary-color);
}

footer {
  padding: 28px 0;
  text-align: center;
  background: transparent;
  color: var(--muted);
  margin-top: 40px;
}

/* settings panel in dropdown (左上角) */
.menu {
  position: fixed;
  left: 12px; /* 移到左边 */
  top: 64px;
  z-index: 2000;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.015));
  border-radius: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  min-width: 260px;
  box-shadow: 0 14px 44px rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(8px);
  transform-origin: left top; /* 调整变换原点 */
  display: none;
}

.menu a {
  display: block;
  color: var(--text);
  padding: 8px;
  border-radius: 8px;
  text-decoration: none;
}

.menu a:hover {
  background: rgba(255, 255, 255, 0.02);
}

.menu .section-title {
  font-size: 1rem;
  margin: 6px 0 8px;
}

.menu .setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 6px;
  color: var(--muted);
}

/* About 浮窗样式 */
.about-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.about-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.about-modal {
  background: var(--card-plain);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.6);
  width: 90%;
  max-width: 400px;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.about-modal-overlay.active .about-modal {
  transform: translateY(0);
}


.about-modal h3 {
  font-size: 1.5rem;
  margin-bottom: 12px;
  color: var(--text);
}

.about-modal p {
  color: var(--muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

.about-modal .close-button {
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease;
}

.about-modal .close-button:hover {
  background: #0056b3;
}


/* floating music player (左下角) */
.music-player {
  position: fixed;
  left: 16px;
  bottom: 16px;
  width: 84px;
  height: 84px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--border);
  backdrop-filter: blur(8px) saturate(120%);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.disc {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #0b1220, #1b2a3a);
  position: relative;
  transition: transform 0.3s;
}

.disc img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.disc::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
  mix-blend-mode: overlay;
}

.needle {
  position: absolute;
  left: 84px;
  top: -20px;
  width: 40px;
  height: 40px;
  opacity: 0.95;
  transform-origin: 6px 6px;
  transition: transform 0.35s;
}

.needle svg {
  width: 100%;
  height: 100%;
}

/* rotating when playing */
@keyframes spin {
  from {
    transform: rotate(0);
  }
  to {
    transform: rotate(360deg);
  }
}

.disc.playing {
  animation: spin 4.6s linear infinite;
}

.player-controls {
  position: fixed;
  left: 16px;
  bottom: 110px;
  background: var(--card-plain);
  border-radius: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.6);
  display: none;
  z-index: 3001;
  /* flex 布局 for new controls */
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-controls button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 8px;
  border-radius: 8px;
  margin-right: 8px;
  cursor: pointer;
}

.player-controls .progress-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-controls .progress {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}

.player-controls .progress > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), #5cc0ff);
  width: 0%;
}

/* 新增的音量滑块样式 */
.player-controls .volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-control input[type="range"] {
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  height: 6px;
  cursor: pointer;
  flex: 1;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: var(--primary-color);
  box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.2);
  transition: background 0.3s ease-in-out;
}

/* autoplay modal styles */
.autoplay-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.autoplay-modal {
  background: var(--card-plain);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.6);
  width: 90%;
  max-width: 400px;
  text-align: center;
}

/* responsive adjustments & mobile */
@media (max-width: 840px) {
  .hero {
    padding: 46px 12px 28px;
  }
  .topbar {
    padding: 0 12px;
  }
  .hero h1 {
    font-size: 1.8rem;
  }
  .hero-inner {
    padding: 0 8px;
  }
  table {
    min-width: 600px;
  }
  .menu {
    left: 8px; /* 移动端也靠左 */
    top: 56px;
  }
  .player-controls {
    left: 8px;
    bottom: 104px;
  }
  .music-player {
    left: 12px;
    bottom: 12px;
  }
}

/* prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .card,
  .cta,
  .action-button,
  .disc {
    transition: none !important;
    animation: none !important;
  }
}

/* mobile special - make hero compact and stack CTA */
body.mobile .hero {
  padding: 34px 12px 20px;
}

body.mobile .cta-group {
  flex-direction: column;
}

body.mobile .cta {
  padding: 12px 16px;
  width: 200px;
  justify-content: center;
}

/* small helper */
.small {
  font-size: 0.9rem;
  color: var(--muted);
}

/* 废弃项目样式 */
.legacy-item {
    color: #555 !important;
    text-decoration: line-through !important; /* 划线 */
    filter: grayscale(1); /* 灰色 */
    cursor: help !important; 
    transition: all 0.2s;
}

.legacy-item:hover {
    background: rgba(255, 0, 0, 0.05) !important;
    color: #777 !important;
}

/* 独立设置 DearMacro 的高亮感 */
.menu a[href*="DearMacro"]:hover {
    background: rgba(0, 123, 255, 0.2) !important;
    transform: translateX(4px);
}

/* 容器边框呼吸动画 */
.experimental-container {
    position: relative;
    border: 1px solid rgba(255, 193, 7, 0.3) !important;
    animation: border-pulse 3s infinite ease-in-out;
}

@keyframes border-pulse {
    0%, 100% { border-color: rgba(255, 193, 7, 0.2); box-shadow: 0 6px 18px rgba(2, 6, 23, 0.45); }
    50% { border-color: rgba(255, 193, 7, 0.6); box-shadow: 0 0 15px rgba(255, 193, 7, 0.15); }
}

/* 提示横幅样式 */
.port-notice {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.2);
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.notice-icon {
    font-size: 1.5rem;
    animation: bounce 2s infinite;
}

.notice-content strong {
    color: #ffc107;
    display: block;
    margin-bottom: 2px;
}

.notice-content span {
    font-size: 0.9rem;
    color: var(--text);
    opacity: 0.9;
}

/*Nextgen */

/* 重点文字高亮动画 */
.glitch-text {
    background: none;
    color: #ffc107;
    font-weight: bold;
    text-decoration: underline;
    animation: text-flash 1.5s infinite;
}

@keyframes text-flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-3px); }
}