/* ui-modern.css - Minimalist & Premium V5 (Enhanced Modal) */
:root {
  --primary: #007aff;
  --bg-body: #f5f5f7;
  --bg-card: #ffffff;
  --text-main: #1d1d1f;
  --text-sub: #86868b;
  --radius-l: 24px;
  --radius-m: 16px;
  --shadow-card: 0 10px 30px rgba(0,0,0,0.04);
  --trans: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

.wrap {
  width: 100%; max-width: 920px; margin: 0 auto;
  padding: 40px 20px; flex: 1; display: flex; flex-direction: column; justify-content: center;
}

/* 顶部导航 */
.nav-bar { position: absolute; top: 0; left: 0; right: 0; padding: 20px; display: flex; justify-content: flex-end; z-index: 100; }
.brand-logo { font-size: 24px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; color: var(--text-main); }

/* 通用卡片 */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-card);
  padding: 40px; margin-bottom: 24px;
  transition: var(--trans);
  border: 1px solid rgba(0,0,0,0.02);
}
@media (max-width: 600px) { .card { padding: 24px 20px; } }

h1 { font-size: 32px; font-weight: 700; margin: 0 0 10px; letter-spacing: -1px; }
h2 { font-size: 24px; font-weight: 600; margin: 0 0 20px; }
.sub-text { color: var(--text-sub); font-size: 15px; }

/* 首页输入框 */
.hero-section { text-align: center; max-width: 600px; margin: 0 auto; }
.hero-input-group { position: relative; margin-top: 30px; }
.hero-input {
  width: 100%; height: 64px; border-radius: 99px;
  border: 1px solid #d2d2d7; padding: 0 24px 0 54px;
  font-size: 18px; outline: none; transition: var(--trans);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'%3E%3C/path%3E%3C/svg%3E") no-repeat 20px center;
}
.hero-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(0,122,255,0.15); }
.hero-btn {
  margin-top: 20px; height: 54px; padding: 0 48px;
  background: var(--text-main); color: #fff;
  border: none; border-radius: 99px;
  font-size: 17px; font-weight: 600; cursor: pointer; transition: var(--trans);
}
.hero-btn:hover { background: #000; transform: scale(1.02); }

/* 软件选择 Grid */
.soft-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.soft-item {
  position: relative; background: #f9f9fa;
  border-radius: var(--radius-m); padding: 20px;
  display: flex; align-items: center; gap: 16px;
  cursor: pointer; border: 2px solid transparent; transition: var(--trans);
}
.soft-item:hover { background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,0.06); transform: translateY(-2px); }
.soft-item.active { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(0,122,255,0.1); }
.soft-icon {
  width: 56px; height: 56px; object-fit: contain;
  border-radius: 14px; background: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05); flex-shrink: 0;
}
.soft-info .name { font-weight: 600; font-size: 16px; margin-bottom: 2px; }
.soft-info .meta { font-size: 13px; color: var(--text-sub); }
.check-badge {
  position: absolute; top: 10px; right: 10px;
  width: 20px; height: 20px; background: var(--primary); color: #fff;
  border-radius: 50%; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; scale: 0.5; transition: var(--trans);
}
.soft-item.active .check-badge { opacity: 1; scale: 1; }

/* 系统选择卡片 */
.os-group { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.os-card {
  flex: 1; min-width: 200px; max-width: 300px;
  background: #fff; border: 2px solid #eee;
  border-radius: var(--radius-l); padding: 30px 20px;
  text-align: center; cursor: pointer; transition: var(--trans);
}
.os-card:hover { border-color: #ccc; transform: translateY(-2px); }
.os-card.active { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(0,122,255,0.1); }
.os-icon-img { width: 80px; height: 80px; object-fit: contain; margin: 0 auto 16px auto; display: block; }
.os-name { font-weight: 700; font-size: 18px; }

/* === 确认页布局 === */
.confirm-header {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #f0f7ff; border: 1px solid rgba(0,122,255,0.1);
  padding: 30px; border-radius: 20px; margin-bottom: 30px;
}
.confirm-os-icon { width: 64px; height: 64px; object-fit: contain; margin-bottom: 12px; }
.confirm-os-title { font-size: 20px; font-weight: 700; color: #000; }
.confirm-os-sub { font-size: 14px; color: var(--text-sub); margin-top: 4px; }

.confirm-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 40px; }
.confirm-item {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; padding: 16px 20px; border-radius: 16px;
  border: 1px solid #f0f0f0;
}
.confirm-left { display: flex; align-items: center; gap: 16px; }
.confirm-icon { width: 44px; height: 44px; object-fit: contain; border-radius: 10px; background: #fff; padding: 2px; border:1px solid #f5f5f7; }
.confirm-name { font-weight: 600; font-size: 16px; }

/* === 弹窗 (Modal) 样式优化 === */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px); z-index: 999;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0; visibility: hidden; transition: opacity 0.2s;
}
.modal-mask.show { opacity: 1; visibility: visible; }
.modal-box {
  width: 90%; max-width: 420px; background: #fff;
  border-radius: 20px; padding: 30px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  transform: scale(0.9); transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-mask.show .modal-box { transform: scale(1); }

/* 弹窗内的详情框 */
.modal-preview {
  text-align: left; background: #f5f7fa; padding: 16px;
  border-radius: 16px; margin: 20px 0; font-size: 14px;
  color: var(--text-main);
}
.modal-big-os {
  font-size: 26px; font-weight: 900; color: var(--primary);
  display: block; margin-top: 4px;
}

.modal-btns { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }
.modal-btn { flex: 1; height: 48px; border-radius: 12px; font-weight: 600; border: none; cursor: pointer; font-size: 15px; }
.modal-btn.cancel { background: #f0f0f0; color: #333; }
.modal-btn.confirm { background: var(--primary); color: #fff; }

/* 通用组件 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 24px; border-radius: 99px;
  font-weight: 600; font-size: 14px; border: 1px solid #e5e5e5;
  background: #fff; color: var(--text-main); cursor: pointer; text-decoration: none; transition: var(--trans);
}
.btn:hover { background: #f5f5f7; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 4px 12px rgba(0,122,255,0.3); }

.notice-bar { background: #eef7ff; color: #0066cc; padding: 12px 20px; border-radius: 12px; font-size: 14px; margin-bottom: 24px; border: 1px solid rgba(0,122,255,0.1); }
.status-pill { display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; background: #f0f0f0; color: #666; }
.list-row { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-bottom: 1px solid #f0f0f0; gap: 16px; }
.list-actions { display: flex; gap: 10px; }
@media (max-width: 600px) {
  .list-row { flex-direction: column; align-items: flex-start; }
  .list-actions { width: 100%; justify-content: flex-end; margin-top: 10px; }
}
/* 解决按钮悬停变白/消失的终极补丁 */
.btn.btn-primary:hover {
    background-color: #005bb5 !important; /* 强制使用深蓝色 */
    color: #ffffff !important;            /* 强制文字为白色 */
    opacity: 1 !important;                /* 确保不透明 */
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3) !important;
}

/* 针对 Next 按钮的特别锁定 */
#chooseBtn:hover {
    background-color: #005bb5 !important;
    color: #ffffff !important;
}
/* 让退出按钮更明显 */
a[href*="logout=1"] {
    background: #fff0f0 !important;   /* 浅粉色背景 */
    color: #d70015 !important;        /* 红色文字 */
    border: 1px solid #ffcccc !important; /* 浅红色边框 */
    padding: 4px 12px !important;     /* 增加内边距 */
    border-radius: 8px !important;    /* 圆角 */
    font-weight: 600 !important;      /* 文字加粗 */
    transition: all 0.2s !important;
}

/* 悬停效果：颜色加深 */
a[href*="logout=1"]:hover {
    background: #d70015 !important;
    color: #ffffff !important;
    border-color: #d70015 !important;
    text-decoration: none !important;
}
/* =========================================================
   Frontend motion layer - safe CSS-only enhancement
   说明：只做前台视觉动画，不改兑换/验证/下载核心逻辑。
   ========================================================= */
body {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(0,122,255,.10), transparent 28%),
    radial-gradient(circle at 82% 14%, rgba(88,86,214,.08), transparent 26%),
    linear-gradient(180deg, #fbfcff 0%, var(--bg-body) 58%, #f7f7fb 100%);
}
body::before,
body::after {
  content: "";
  position: fixed;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
  filter: blur(10px);
  opacity: .42;
  will-change: transform;
}
body::before {
  left: -160px;
  top: 12vh;
  background: radial-gradient(circle, rgba(0,122,255,.16), transparent 68%);
  animation: bgFloatA 12s ease-in-out infinite alternate;
}
body::after {
  right: -180px;
  bottom: 10vh;
  background: radial-gradient(circle, rgba(52,199,89,.12), transparent 70%);
  animation: bgFloatB 14s ease-in-out infinite alternate;
}
.wrap,
.lang-float {
  position: relative;
  z-index: 1;
}

.wrap {
  animation: pageFadeUp .46s ease both;
}
.hero-section,
.card {
  animation: cardEnter .55s cubic-bezier(.2,.8,.2,1) both;
}
.hero-section > div:first-child {
  display: inline-block;
  animation: rocketFloat 3.2s ease-in-out infinite;
  transform-origin: 50% 80%;
}
.hero-section h1,
.hero-section .sub-text,
.hero-section .notice-bar,
.hero-input-group,
.hero-btn {
  animation: fadeUp .55s ease both;
}
.hero-section h1 { animation-delay: .04s; }
.hero-section .sub-text { animation-delay: .10s; }
.hero-section .notice-bar { animation-delay: .16s; }
.hero-input-group { animation-delay: .22s; }
.hero-btn { animation-delay: .28s; }

.notice-bar,
.status-pill,
.btn,
.hero-input,
.hero-btn,
.soft-item,
.os-card,
.confirm-item,
.modal-box {
  will-change: transform, opacity;
}
.notice-bar {
  box-shadow: 0 10px 26px rgba(0,122,255,.06);
}
.hero-input {
  box-shadow: 0 12px 30px rgba(15,23,42,.06);
}
.hero-input:focus {
  transform: translateY(-1px);
}
.hero-btn,
.btn,
.modal-btn {
  position: relative;
  overflow: hidden;
}
.hero-btn::after,
.btn::after,
.modal-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,.26) 42%, transparent 70%);
  transform: translateX(-130%);
  transition: transform .7s ease;
  pointer-events: none;
}
.hero-btn:hover::after,
.btn:hover::after,
.modal-btn:hover::after {
  transform: translateX(130%);
}
.hero-btn:active,
.btn:active,
.modal-btn:active,
.soft-item:active,
.os-card:active {
  transform: scale(.98);
}

.soft-grid .soft-item,
.confirm-list .confirm-item {
  animation: itemEnter .42s ease both;
}
.soft-grid .soft-item:nth-child(1), .confirm-list .confirm-item:nth-child(1) { animation-delay: .03s; }
.soft-grid .soft-item:nth-child(2), .confirm-list .confirm-item:nth-child(2) { animation-delay: .06s; }
.soft-grid .soft-item:nth-child(3), .confirm-list .confirm-item:nth-child(3) { animation-delay: .09s; }
.soft-grid .soft-item:nth-child(4), .confirm-list .confirm-item:nth-child(4) { animation-delay: .12s; }
.soft-grid .soft-item:nth-child(5), .confirm-list .confirm-item:nth-child(5) { animation-delay: .15s; }
.soft-grid .soft-item:nth-child(6), .confirm-list .confirm-item:nth-child(6) { animation-delay: .18s; }
.soft-grid .soft-item:nth-child(7), .confirm-list .confirm-item:nth-child(7) { animation-delay: .21s; }
.soft-grid .soft-item:nth-child(8), .confirm-list .confirm-item:nth-child(8) { animation-delay: .24s; }
.soft-grid .soft-item:nth-child(n+9), .confirm-list .confirm-item:nth-child(n+9) { animation-delay: .27s; }

.soft-item:hover,
.os-card:hover,
.confirm-item:hover {
  box-shadow: 0 14px 34px rgba(15,23,42,.08);
}
.soft-item.active,
.os-card.active {
  animation: selectedPulse .36s ease both;
}
.check-badge {
  box-shadow: 0 6px 14px rgba(0,122,255,.28);
}
.modal-mask.show .modal-box {
  animation: modalPop .28s cubic-bezier(.2,.9,.25,1.2) both;
}

@keyframes pageFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes cardEnter {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes itemEnter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes rocketFloat {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-8px) rotate(4deg); }
}
@keyframes selectedPulse {
  0% { transform: scale(.985); }
  60% { transform: scale(1.012); }
  100% { transform: scale(1); }
}
@keyframes modalPop {
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes bgFloatA {
  from { transform: translate3d(0,0,0) scale(1); }
  to { transform: translate3d(34px,22px,0) scale(1.08); }
}
@keyframes bgFloatB {
  from { transform: translate3d(0,0,0) scale(1); }
  to { transform: translate3d(-30px,-24px,0) scale(1.06); }
}

@media (max-width: 760px) {
  body::before,
  body::after {
    width: 240px;
    height: 240px;
    opacity: .32;
  }
  .wrap {
    padding: 72px 14px 28px;
    justify-content: flex-start;
  }
  .lang-float {
    top: 14px;
    right: 14px;
  }
  .hero-section {
    width: 100%;
    max-width: 100%;
  }
  .hero-section > div:first-child {
    font-size: 42px !important;
    margin-bottom: 14px !important;
  }
  h1 { font-size: 28px; }
  h2 { font-size: 21px; }
  .notice-bar {
    padding: 12px 14px;
    line-height: 1.65;
  }
  .hero-input {
    height: 58px;
    font-size: 16px;
    padding-left: 50px;
  }
  .hero-btn {
    width: 100%;
    max-width: 280px;
  }
  .soft-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .soft-item:hover,
  .os-card:hover,
  .confirm-item:hover {
    transform: none;
  }
  .os-card {
    min-width: 0;
    width: 100%;
  }
  .modal-box {
    width: 100%;
    padding: 24px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
