/* ===== 基础 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #050810;
  color: #e2e8f0;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* 星空 Canvas 背景 */
#starfield {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(59, 130, 246, .15) 0%, transparent 55%),
    radial-gradient(circle at 15% 15%, rgba(59, 130, 246, .12) 0, transparent 35%),
    radial-gradient(circle at 85% 25%, rgba(168, 85, 247, .1) 0, transparent 35%),
    #050810;
}
/* 星云光晕层 */
body::after {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(circle at 50% 100%, rgba(34, 211, 238, .06) 0, transparent 45%);
  pointer-events: none;
  z-index: 0;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: 100px 24px 80px;
  text-align: center;
  overflow: hidden;
  z-index: 1;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(59, 130, 246, .25) 0%, transparent 60%),
    linear-gradient(180deg, #0a1020 0%, #050810 100%);
  border-bottom: 1px solid rgba(56, 189, 248, .15);
}
.hero-bg {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 30% 40%, rgba(56, 189, 248, .12) 0, transparent 35%),
    radial-gradient(circle at 70% 30%, rgba(168, 85, 247, .1) 0, transparent 30%);
  pointer-events: none;
  animation: pulse 6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: .7; }
  50% { opacity: 1; }
}
.hero-content { position: relative; z-index: 1; }
.hero-title {
  font-size: 48px; font-weight: 800; letter-spacing: 4px;
  background: linear-gradient(135deg, #22d3ee 0%, #60a5fa 40%, #a78bfa 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 20px rgba(56, 189, 248, .35));
}
.hero-subtitle {
  margin-top: 14px; font-size: 17px;
  color: #94a3b8; letter-spacing: 2px;
}
.hero-tag {
  display: inline-block; margin-top: 22px;
  padding: 6px 18px;
  background: rgba(56, 189, 248, .08);
  border: 1px solid rgba(56, 189, 248, .3);
  border-radius: 999px;
  font-size: 12px; color: #67e8f9;
  letter-spacing: 2px; text-transform: uppercase;
  box-shadow: 0 0 20px rgba(56, 189, 248, .15) inset;
}

/* ===== 容器 ===== */
.container { max-width: 1280px; margin: 0 auto; padding: 50px 24px 70px; position: relative; z-index: 1; }
.loading, .empty-tip {
  text-align: center; color: #64748b; padding: 80px 0; font-size: 15px;
  letter-spacing: 1px;
}

/* ===== 应用网格 ===== */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}

/* ===== 卡片 ===== */
.app-card {
  position: relative;
  background: linear-gradient(160deg, rgba(15, 23, 42, .85) 0%, rgba(10, 15, 30, .9) 100%);
  border-radius: 16px;
  overflow: hidden;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
  display: flex; flex-direction: column;
  border: 1px solid rgba(56, 189, 248, .15);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, .4);
}
.app-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0) 0%, rgba(56, 189, 248, .08) 50%, rgba(56, 189, 248, 0) 100%);
  opacity: 0; transition: opacity .4s ease;
  pointer-events: none; z-index: 1;
}
.app-card:hover {
  transform: translateY(-8px);
  border-color: rgba(56, 189, 248, .5);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, .5),
    0 0 30px rgba(56, 189, 248, .2);
}
.app-card:hover::before { opacity: 1; }

.card-image-wrap {
  position: relative; aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #0a0f1f, #050810);
  overflow: hidden;
  border-bottom: 1px solid rgba(56, 189, 248, .1);
}
.card-image {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease, filter .3s ease;
  filter: brightness(.9) saturate(1.1);
}
.app-card:hover .card-image { transform: scale(1.06); filter: brightness(1) saturate(1.2); }
.card-status-tag {
  position: absolute; top: 12px; right: 12px;
  background: rgba(34, 211, 238, .15);
  color: #67e8f9;
  font-size: 11px; padding: 4px 12px; border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, .4);
  backdrop-filter: blur(8px);
  letter-spacing: 1px;
}

.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; position: relative; z-index: 2; }
.card-name {
  font-size: 20px; font-weight: 700; color: #f1f5f9;
  letter-spacing: .5px;
}
.card-model {
  display: inline-block; margin: 8px 0 12px;
  font-size: 11px; color: #67e8f9; font-weight: 600;
  background: rgba(34, 211, 238, .1);
  padding: 4px 12px; border-radius: 6px; width: fit-content;
  border: 1px solid rgba(34, 211, 238, .25);
  letter-spacing: 1px;
}
.card-desc {
  font-size: 14px; color: #94a3b8; margin-bottom: 12px;
}
.card-author-words {
  font-size: 13px; color: #7dd3fc; font-style: italic;
  border-left: 2px solid rgba(56, 189, 248, .5);
  padding: 10px 14px; margin-bottom: 16px;
  background: rgba(56, 189, 248, .05);
  border-radius: 0 8px 8px 0;
}
.card-stats {
  display: flex; gap: 18px; margin-bottom: 16px; flex-wrap: wrap;
  font-size: 13px; color: #64748b;
}
.stat-item b {
  color: #22d3ee; font-weight: 700;
  text-shadow: 0 0 12px rgba(34, 211, 238, .4);
}

/* ===== 按钮 ===== */
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.btn {
  border: none; cursor: pointer; font-size: 13px; font-weight: 600;
  padding: 9px 16px; border-radius: 8px;
  transition: all .25s ease;
  display: inline-flex; align-items: center; justify-content: center;
  letter-spacing: .5px; font-family: inherit;
}
.btn-access {
  flex: 1; min-width: 110px;
  background: linear-gradient(135deg, #0891b2, #2563eb);
  color: #fff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, .35);
}
.btn-access:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(37, 99, 235, .5);
  filter: brightness(1.1);
}
.btn-like {
  background: rgba(244, 63, 94, .1); color: #fb7185;
  border: 1px solid rgba(244, 63, 94, .3);
}
.btn-like:hover {
  background: rgba(244, 63, 94, .2);
  box-shadow: 0 0 16px rgba(244, 63, 94, .2);
}
.btn-like.liked {
  background: linear-gradient(135deg, #e11d48, #be123c);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 20px rgba(244, 63, 94, .4);
}
.btn-msg-toggle {
  background: rgba(148, 163, 184, .08); color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, .2);
}
.btn-msg-toggle:hover {
  background: rgba(148, 163, 184, .15);
  border-color: rgba(148, 163, 184, .4);
}
.btn-msg-submit {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: #fff; margin-top: 10px; align-self: flex-start;
  box-shadow: 0 4px 14px rgba(6, 182, 212, .3);
}
.btn-msg-submit:hover { filter: brightness(1.15); }

/* ===== 留言区 ===== */
.msg-section {
  margin-top: 16px;
  border-top: 1px dashed rgba(56, 189, 248, .15);
  padding-top: 16px;
}
.msg-list {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 280px; overflow-y: auto; margin-bottom: 14px;
  padding-right: 4px;
}
.msg-list::-webkit-scrollbar { width: 6px; }
.msg-list::-webkit-scrollbar-track { background: rgba(15, 23, 42, .5); border-radius: 3px; }
.msg-list::-webkit-scrollbar-thumb { background: rgba(56, 189, 248, .3); border-radius: 3px; }
.msg-list::-webkit-scrollbar-thumb:hover { background: rgba(56, 189, 248, .5); }
.msg-item {
  background: rgba(15, 23, 42, .6);
  padding: 10px 14px; border-radius: 8px; font-size: 13px;
  border: 1px solid rgba(56, 189, 248, .08);
}
.msg-item .msg-nick {
  font-weight: 700; color: #67e8f9;
  text-shadow: 0 0 10px rgba(103, 232, 249, .3);
}
.msg-item .msg-time { color: #475569; font-size: 11px; margin-left: 8px; }
.msg-item .msg-text { color: #cbd5e1; margin-top: 4px; word-break: break-word; }
.msg-empty {
  color: #475569; font-size: 13px; text-align: center; padding: 14px 0;
  letter-spacing: 1px;
}
.msg-form { display: flex; flex-direction: column; gap: 8px; }
.msg-nick-input, .msg-content {
  background: rgba(15, 23, 42, .6);
  border: 1px solid rgba(56, 189, 248, .2);
  border-radius: 8px; padding: 10px 12px;
  font-size: 13px; font-family: inherit; resize: vertical;
  color: #e2e8f0;
}
.msg-nick-input::placeholder, .msg-content::placeholder { color: #475569; }
.msg-nick-input:focus, .msg-content:focus {
  outline: none;
  border-color: rgba(34, 211, 238, .6);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, .12);
}
.msg-nick-input { width: 50%; }
.msg-content { min-height: 64px; }

/* ===== 语言切换按钮 ===== */
.lang-toggle {
  position: fixed; right: 20px; top: 20px; z-index: 50;
  background: rgba(15, 23, 42, .7); color: #67e8f9;
  border: 1px solid rgba(56, 189, 248, .35); border-radius: 8px;
  padding: 7px 14px; font-size: 12px; font-weight: 700; letter-spacing: 1px;
  cursor: pointer; backdrop-filter: blur(8px); font-family: inherit;
  transition: all .25s ease;
  box-shadow: 0 0 16px rgba(56, 189, 248, .15);
}
.lang-toggle:hover {
  background: rgba(56, 189, 248, .18); color: #a5f3fc;
  box-shadow: 0 0 24px rgba(56, 189, 248, .35);
}

/* ===== 管理员入口 ===== */
.admin-entry {
  position: fixed; right: 24px; bottom: 24px;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(15, 23, 42, .8);
  color: #67e8f9;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; backdrop-filter: blur(10px);
  transition: all .3s ease; z-index: 100;
  border: 1px solid rgba(56, 189, 248, .3);
  box-shadow: 0 0 24px rgba(56, 189, 248, .15);
}
.admin-entry:hover {
  background: linear-gradient(135deg, #0891b2, #2563eb);
  color: #fff;
  transform: rotate(60deg) scale(1.08);
  box-shadow: 0 0 32px rgba(56, 189, 248, .5);
}

/* ===== Footer ===== */
.footer {
  text-align: center; padding: 28px;
  color: #475569; font-size: 13px;
  letter-spacing: 1px;
  border-top: 1px solid rgba(56, 189, 248, .08);
  position: relative; z-index: 1;
}

/* ===== 提示气泡 ===== */
.toast {
  position: fixed; left: 50%; top: 32px; transform: translateX(-50%);
  background: rgba(2, 6, 23, .92); color: #67e8f9;
  padding: 12px 22px; border-radius: 10px;
  font-size: 14px; z-index: 9999;
  animation: toastIn .25s ease;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, .3);
  box-shadow: 0 0 32px rgba(56, 189, 248, .2);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
}

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  .hero { padding: 64px 20px 56px; }
  .hero-title { font-size: 34px; letter-spacing: 2px; }
  .hero-subtitle { font-size: 14px; }
  .apps-grid { grid-template-columns: 1fr; gap: 20px; }
  .container { padding: 32px 16px 50px; }
  .msg-nick-input { width: 100%; }
}
