/* ==========================================================
   base.css - 全局基础样式
   设计令牌 / 重置 / 公共工具类 / 共享组件
   ========================================================== */

/* ==========================================================
   JVCMS 首页模板样式 —苹果风极简设计系统
   配色 / 字体 / 间距 / 圆角 / 阴影均为统一 token
   ========================================================== */

:root {
  --blue: #0071e3;
  --blue-dark: #0066c8;
  --blue-light: #e8f1fd;
  --bg: #f5f5f7;
  --white: #ffffff;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --line: #e8e8ed;
  --orange: #ff7a18;
  --red: #e53030;
  --green: #1d9a4d;
  --dark: #161617;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.08);
  --radius: 14px;
  --radius-lg: 18px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR",
          "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
input,textarea,select { font-family:inherit; }
input::placeholder,textarea::placeholder { font-family:inherit; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }

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

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  flex-shrink: 0;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--blue);
  color: #fff;
}
.logo-img-wrap {
  display: inline-flex;
  align-items: center;
  height: 50px;
}
.logo-img {
  max-height: 50px;
  width: auto;
  display: block;
}
.logo-text-custom {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
@media (max-width: 900px) {
    .logo {
      position: absolute;
      left: 50%;
      top: 10px;
      transform: translateX(-50%);
      margin: 0;
      height: 40px;
      align-items: center;
    }
}

@media (max-width: 640px) {
    .lang-btn { padding: 0 10px; height: 32px; font-size: 13px; gap: 6px; }
    .container { padding-left: 14px; padding-right: 14px; }
}

/* ---------- 动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* ---------- 顶部语言切换 ---------- */
.lang-switch { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 13px;
  background: rgba(0,0,0,0.045); border: 1px solid transparent; border-radius: 999px;
  font-size:14px; color: var(--text); cursor: pointer;
  transition: all .2s;
}
.lang-btn:hover { background: rgba(0,0,0,0.08); }
.lang-btn .lang-flag { width: 20px; height: 15px; border-radius: 2px; object-fit: cover; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.lang-btn .chev { color: var(--text-3); transition: transform .2s; }
.lang-switch.open .lang-btn { background: #fff; border-color: var(--line); box-shadow: 0 4px 16px rgba(0,0,0,.09); }
.lang-switch.open .chev { transform: rotate(180deg); }
.lang-panel {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 380px; max-height: 430px; overflow-y: auto;
  background: #fff; border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,.18), 0 4px 14px rgba(0,0,0,.08);
  border: 1px solid var(--line);
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
  z-index: 130;
}
.lang-switch.open .lang-panel { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-panel-head { padding: 13px 18px 9px; font-size:13px; font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--line); }
.lang-list { display: grid; grid-template-columns: 1fr 1fr; padding: 8px; }
.lang-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 11px; border-radius: 10px;
  font-size:14px; color: var(--text); cursor: pointer;
  transition: background .15s, color .15s;
}
.lang-item:hover { background: var(--blue-light); color: var(--blue-dark); }
.lang-item .lang-flag { width: 22px; height: 16px; border-radius: 2px; object-fit: cover; box-shadow: 0 1px 3px rgba(0,0,0,.28); flex-shrink: 0; }
.lang-item span { flex: 1 1 auto; }
.lang-item em { font-style: normal; font-size: 11px; color: var(--text-3); font-family: ui-monospace, Consolas, monospace; }
.lang-item.active { background: var(--blue-light); color: var(--blue-dark); font-weight: 600; }
.lang-panel::-webkit-scrollbar { width: 6px; }
.lang-panel::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 3px; }

/* ---------- 通用按钮（基础定义）---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 28px;
  font-size: 15px;
  font-weight: 500;
  border-radius: 999px;
  transition: transform 0.1s, box-shadow 0.2s, background 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); box-shadow: 0 8px 20px rgba(0, 113, 227, 0.3); }
.btn-ghost {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--text-3); background: var(--white); }
.btn-lg { height: 52px; padding: 0 40px; font-size: 16px; }
.btn-warn { background: var(--orange); color: #fff; }
.btn-warn:hover { background: #e56b00; box-shadow: 0 8px 20px rgba(255, 122, 24, 0.3); }
.btn-lg { height: 50px; padding: 0 34px; font-size: 16px; }
.btn-ghost-light {
  display: inline-flex; align-items: center; justify-content: center;
  height: 50px; padding: 0 32px; font-size: 15px; font-weight: 500;
  color: #fff; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.24); border-radius: 999px;
  backdrop-filter: blur(6px); transition: all .2s;
}
.btn-ghost-light:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.42); }
/* ---------- 按钮精修（全局升级-?---------- */
.btn { transition: transform .12s ease, box-shadow .25s ease, background .2s ease, border-color .2s ease; }
.btn-primary {
  background: linear-gradient(180deg, #2b8bff 0%, #0066d6 100%);
  box-shadow: 0 4px 14px rgba(0,113,227,.35), inset 0 1px 0 rgba(255,255,255,.28);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #3d97ff 0%, #006edf 100%);
  box-shadow: 0 10px 26px rgba(0,113,227,.48), inset 0 1px 0 rgba(255,255,255,.32);
  transform: translateY(-1px);
}
.btn-ghost:hover { border-color: #a0a0a8; background: #fafafa; box-shadow: 0 6px 16px rgba(0,0,0,.06); }
.btn-warn {
  background: linear-gradient(180deg, #ff8a3d 0%, #f05f0e 100%);
  box-shadow: 0 4px 14px rgba(255,122,24,.36), inset 0 1px 0 rgba(255,255,255,.32);
}
.btn-warn:hover {
  background: linear-gradient(180deg, #ff974f 0%, #f76a1c 100%);
  box-shadow: 0 10px 26px rgba(255,122,24,.52), inset 0 1px 0 rgba(255,255,255,.38);
  transform: translateY(-1px);
}
@media (max-width: 1200px) {
    .lang-panel { right: auto; left: auto; width: 340px; }
}

@media (max-width: 900px) {
    .lang-panel { width: 320px; right: 0; left: auto; }
    .lang-list { grid-template-columns: 1fr; }
}
