/* ========================================================
   宜英训练网 - 落叶色主题
   palette inspired by autumn leaves
   ====================================================== */
:root {
  --leaf-bg:         #FFF8EE;
  --leaf-bg-soft:    #FBEFD9;
  --leaf-card:       #FFFDF7;
  --leaf-border:     #E8D2A6;

  --leaf-orange:     #E07A1F; /* primary */
  --leaf-orange-dk:  #B85F11;
  --leaf-amber:      #D4A12C;
  --leaf-ochre:      #B8732E; /* 赭石 */
  --leaf-brown:      #6E3A14;
  --leaf-red:        #B23A1E;
  --leaf-green:      #7B8A3F;

  --text-main:       #4A2E16;
  --text-dim:        #8A6A48;
  --text-light:      #FFF6E9;

  --shadow-sm: 0 2px 6px rgba(110, 58, 20, 0.08);
  --shadow-md: 0 6px 18px rgba(110, 58, 20, 0.12);
  --radius:    10px;
  --radius-sm: 6px;
  --max-width: 1200px;
  --header-h:  76px;

  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-stack);
  color: var(--text-main);
  background: linear-gradient(180deg, var(--leaf-bg) 0%, var(--leaf-bg-soft) 100%);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--leaf-orange-dk); text-decoration: none; }
a:hover { color: var(--leaf-red); text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* ---------- boot loading ---------- */
.boot-loading {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}
.boot-leaf {
  font-size: 56px;
  animation: leaf-spin 3s linear infinite;
  margin-bottom: 12px;
}
@keyframes leaf-spin {
  0%   { transform: rotate(0)    translateY(0); }
  50%  { transform: rotate(180deg) translateY(-10px); }
  100% { transform: rotate(360deg) translateY(0); }
}

/* ---------- layout ---------- */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(135deg, var(--leaf-orange) 0%, var(--leaf-ochre) 100%);
  color: var(--text-light);
  box-shadow: var(--shadow-md);
}
.header-inner {
  display: flex;
  align-items: center;
  height: var(--header-h);
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text-light);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--text-light); text-decoration: none; }
.brand-logo { height: 32px; width: auto; display: block; }

/* 导航栏两端的二维码 */
.header-qr {
  flex: none;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.header-qr img {
  width: 66px;
  height: 66px;
  object-fit: contain;
  background: #fff;
  padding: 3px;
  border-radius: var(--radius-sm);
  transition: transform .2s ease;
}
.header-qr:hover img { transform: scale(3.2); z-index: 60; position: relative; }
.header-qr-left:hover img  { transform-origin: left top; }
.header-qr-right:hover img { transform-origin: right top; }

.nav-main {
  flex: 1;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.nav-main a {
  color: var(--text-light);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  transition: background .15s;
}
.nav-main a:hover { background: rgba(255,255,255,.18); text-decoration: none; }
.nav-main a.active { background: rgba(0,0,0,.18); font-weight: 600; }

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,.5);
  color: var(--text-light);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  font-size: 20px;
  cursor: pointer;
}

/* ---------- main ---------- */
.site-main {
  flex: 1;
  padding: 24px 0 40px;
}

.page-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--leaf-brown);
  margin: 8px 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-title::before {
  content: "🍁";
  font-size: 22px;
}
.page-summary {
  color: var(--text-dim);
  margin-bottom: 24px;
}

/* ---------- cards & grids ---------- */
/* 网格项约束在自身轨道内：内容过长时卡片可自然变宽，
   但不会撑破网格，宽度始终不超过所在分区（容器）宽度 */
.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.grid > * {
  min-width: 0;
}

/* 反馈页双栏布局；窄屏下堆叠为单列 */
.feedback-grid {
  grid-template-columns: 1.4fr 1fr;
}

.card {
  background: var(--leaf-card);
  border: 1px solid var(--leaf-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
  /* 长英文 / 数字 / 下划线 / URL 等不可断行字符串强制换行，
     保证文字完整显示在卡片内部，不截断、不溢出 */
  min-width: 0;
  overflow-wrap: anywhere;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.card h3 { margin: 0 0 8px; color: var(--leaf-brown); font-size: 17px; }
.card p  { margin: 0 0 12px; color: var(--text-dim); }

/* 卡片内可能出现的长链接：限制最大宽度，超长时优先按标点换行 */
.card a:not(.btn) {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--leaf-orange) 0%, var(--leaf-red) 100%);
  color: var(--text-light);
  padding: 40px 28px;
  border-radius: var(--radius);
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}
.hero h1 { margin: 0 0 8px; font-size: 28px; }
.hero p  { margin: 0; opacity: .92; max-width: 640px; }
.hero::after {
  content: "🍂";
  position: absolute;
  right: -10px; bottom: -20px;
  font-size: 160px;
  opacity: .15;
  pointer-events: none;
}

.hero.ai { background: linear-gradient(135deg, var(--leaf-ochre) 0%, var(--leaf-brown) 100%); }
.hero.ai::after { content: "🤖"; }

.hero-actions {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--leaf-orange);
  color: var(--text-light) !important;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none !important;
  transition: background .15s, transform .1s;
}
.btn:hover  { background: var(--leaf-orange-dk); }
.btn:active { transform: scale(.97); }
.btn.ghost {
  background: transparent;
  color: var(--text-light) !important;
  border-color: rgba(255,255,255,.6);
}
.btn.ghost:hover { background: rgba(255,255,255,.15); }
.btn.outline {
  background: transparent;
  color: var(--leaf-orange-dk) !important;
  border-color: var(--leaf-orange);
}
.btn.outline:hover { background: var(--leaf-bg-soft); }

/* ---------- tables ---------- */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--leaf-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.table th, .table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--leaf-border);
  font-size: 14px;
  /* 防止长文件名 / URL 撑破表格与页面 */
  overflow-wrap: anywhere;
}
/* 窄屏下表格整体可横向滚动，不产生页面级横向滚动条 */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table th {
  background: var(--leaf-bg-soft);
  color: var(--leaf-brown);
  font-weight: 600;
}
.table tr:last-child td { border-bottom: none; }

/* 多行描述文本：保留 \n 换行 */
.desc {
  white-space: pre-line;
}

/* compatibility status pill */
.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.pill.supported   { background: #DFEBC4; color: #4F6620; }
.pill.partial     { background: #FBE3B6; color: #8A5A12; }
.pill.unsupported { background: #F2C9C0; color: #8A2E1A; }

/* ---------- forms ---------- */
.form-row { margin-bottom: 14px; }
.form-row label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--leaf-brown);
  font-weight: 500;
}
.form-row input,
.form-row textarea,
.form-row select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--leaf-border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-main);
  transition: border-color .15s, box-shadow .15s;
}
.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  outline: none;
  border-color: var(--leaf-orange);
  box-shadow: 0 0 0 3px rgba(224,122,31,.18);
}
.form-row textarea { min-height: 130px; resize: vertical; }

/* ---------- contact list ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.contact-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: var(--leaf-card);
  border: 1px solid var(--leaf-border);
  border-radius: var(--radius);
}
.contact-item .label {
  font-size: 13px;
  color: var(--leaf-orange-dk);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.contact-item .value { font-size: 15px; word-break: break-all; }
.contact-item a.value { color: var(--leaf-orange); text-decoration: none; }
.contact-item a.value:hover { text-decoration: underline; }

/* ---------- friend links ---------- */
.friend-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 13px;
  color: var(--text-dim);
}
.friend-links a { color: var(--text-dim); }
.friend-links a:hover { color: var(--leaf-orange-dk); }

/* ---------- footer ---------- */
.site-footer {
  background: var(--leaf-brown);
  color: var(--leaf-bg);
  padding: 28px 0 20px;
  margin-top: 30px;
}
.site-footer a { color: var(--leaf-bg); }
.site-footer a:hover { color: var(--leaf-amber); }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 28px;
  margin-bottom: 18px;
}
.footer-grid h4 {
  color: var(--leaf-amber);
  margin: 0 0 10px;
  font-size: 15px;
}
.footer-grid ul {
  list-style: none;
  padding: 0; margin: 0;
}
.footer-grid li { margin-bottom: 6px; font-size: 13px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 14px;
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,.6);
}
.footer-beian {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
}
.footer-beian a { color: rgba(255,255,255,.6); }
.footer-beian a:hover { color: var(--leaf-amber); }
.footer-beian a,
.footer-beian span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.beian-icp::before,
.beian-police::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: none;
  background: no-repeat center / contain;
}
.beian-icp::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,.6)' stroke-width='2'%3E%3Cpath d='M7 3h7l5 5v13H7z'/%3E%3Cpath d='M14 3v5h5'/%3E%3C/svg%3E");
}
.beian-police::before {
  background-image: url("../img/gwab.png");
}

/* ---------- alert ---------- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 14px;
}
.alert.success {
  background: #DCEBC0;
  color: #3E5818;
  border: 1px solid #9FBF62;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  padding: 16px 20px;
  box-shadow: 0 4px 14px rgba(110, 140, 60, .25);
  animation: alert-pop .4s ease;
}
.alert.success::before { content: "✅ "; }
@keyframes alert-pop {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
.alert.error   { background: #F8D9D0; color: #8A2E1A; border: 1px solid #E8B0A0; }
.alert.info    { background: var(--leaf-bg-soft); color: var(--leaf-brown); border: 1px solid var(--leaf-border); }

.loading-block {
  padding: 40px 0;
  text-align: center;
  color: var(--text-dim);
}

/* ---------- section heading ---------- */
.section-h {
  font-size: 20px;
  color: var(--leaf-brown);
  margin: 28px 0 14px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--leaf-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-main {
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--leaf-orange-dk);
    flex-direction: column;
    padding: 8px;
    gap: 0;
    box-shadow: var(--shadow-md);
    display: none;
  }
  .nav-main.open { display: flex; }
  .nav-main a {
    width: 100%;
    border-radius: 0;
    padding: 12px 16px;
  }
  .footer-grid { grid-template-columns: 1fr; }
  .feedback-grid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); }
  .hero { padding: 28px 20px; }
  .hero h1 { font-size: 22px; }
  .page-title { font-size: 22px; }
}

@media (max-width: 500px) {
  body { font-size: 14px; }
  .container { padding: 0 14px; }
  .header-qr img { width: 54px; height: 54px; }
  .header-inner { gap: 12px; }
  .card { padding: 14px 16px; }
  .table th, .table td { padding: 9px 8px; font-size: 13px; }
}

/* 防止任何内容导致页面级横向滚动 */
html { overflow-x: hidden; }
body { overflow-wrap: break-word; }
