:root{
  --qy-primary:#2b7be4;
  --qy-primary-dark:#1a5cb5;
  --qy-text:#2c3e50;
  --qy-muted:#6b7a8f;
  --qy-border:#e0ecf5;
  --qy-surface:#fff;
  --qy-shadow:0 8px 24px rgba(25,65,110,.12);
  --primary:var(--qy-primary);
  --primary-light:#ebf3ff;
  --primary-dark:var(--qy-primary-dark);
  --primary-bg:#f0f7ff;
  --accent:#ff7c4d;
  --green:#2e7d32;
  --green-light:#e8f5e9;
  --green-bright:#66bb6a;
  --orange:#e65100;
  --orange-light:#fff3e0;
  --red:#c62828;
  --red-light:#ffebee;
  --purple:#6a1b9a;
  --purple-light:#f3e5f5;
  --text:var(--qy-text);
  --text-light:var(--qy-muted);
  --border:var(--qy-border);
  --white:var(--qy-surface);
  --shadow:var(--qy-shadow);
  --radius:10px;
}

/* width/height attributes act as an aspect-ratio hint, not a fixed height. */
img{
  max-width:100%;
  height:auto;
}

body > header:not(.qy-site-header),
body > .top-bar,
body > .mobile-nav{
  display:none !important;
}

.qy-skip-link{
  position:fixed;
  top:10px;
  left:12px;
  z-index:1200;
  padding:9px 14px;
  border-radius:8px;
  background:var(--qy-primary);
  color:#fff !important;
  font-size:.86rem;
  font-weight:700;
  transform:translateY(-160%);
  transition:transform .18s ease;
}

.qy-skip-link:focus{
  transform:translateY(0);
}

.qy-site-header{
  position:sticky;
  top:0;
  z-index:1000;
  background:rgba(255,255,255,.97);
  border-bottom:1px solid var(--qy-border);
  box-shadow:0 2px 12px rgba(31,73,125,.07);
  backdrop-filter:blur(12px);
}

.qy-header-inner{
  width:min(1200px,calc(100% - 40px));
  min-height:64px;
  margin:0 auto;
  display:flex;
  align-items:center;
  gap:20px;
  flex-wrap:nowrap;
}

.qy-logo{
  display:flex;
  align-items:center;
  gap:10px;
  flex:0 1 auto;
  min-width:0;
  color:var(--qy-primary) !important;
  font-size:1.08rem;
  font-weight:800;
  line-height:1.25;
}

.qy-logo-mark{
  flex-shrink:0;
  width:36px;
  height:36px;
  display:grid;
  place-items:center;
  border-radius:8px;
  background:linear-gradient(135deg,var(--qy-primary),#5b9ef4);
  color:#fff;
  font-size:1.15rem;
}

.qy-logo-copy{
  display:flex;
  flex-direction:column;
  min-width:0;
  overflow:hidden;
}

.qy-logo-name{
  display:block;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.qy-logo-copy small{
  display:block;
  margin-top:1px;
  max-width:100%;
  color:var(--qy-muted);
  font-size:.68rem;
  font-weight:500;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.qy-nav{
  display:flex !important;
  align-items:center;
  gap:clamp(14px,1.8vw,30px);
  margin-left:auto;
  flex:0 0 auto;
  min-width:0;
}

.qy-nav a{
  position:relative;
  padding:21px 0 19px;
  color:var(--qy-text);
  font-size:.88rem;
  font-weight:600;
  white-space:nowrap;
}

.qy-nav a::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:14px;
  height:2px;
  border-radius:2px;
  background:var(--qy-primary);
  transform:scaleX(0);
  transform-origin:center;
  transition:transform .2s ease;
}

.qy-nav a:hover,
.qy-nav a.active{
  color:var(--qy-primary);
}

.qy-nav a.active{
  font-weight:700;
  background-image:linear-gradient(180deg,rgba(43,123,228,.12),rgba(43,123,228,.12));
  background-repeat:no-repeat;
  background-size:calc(100% + 18px) 38px;
  background-position:center 58%;
  border-radius:9px;
}

.qy-nav a:hover::after,
.qy-nav a.active::after{
  transform:scaleX(1);
}

.qy-nav a.active::after{
  height:3px;
  bottom:12px;
}

.qy-lang-switch,
.qy-menu-toggle{
  flex-shrink:0;
  border:1px solid var(--qy-border);
  background:var(--qy-surface);
  color:var(--qy-primary);
  font:inherit;
  cursor:pointer;
}

.qy-lang{
  display:flex;
  align-items:center;
  gap:8px;
  flex-shrink:0;
}

.qy-lang-hint{
  color:var(--qy-muted);
  font-size:.72rem;
  font-weight:600;
  white-space:nowrap;
}

.qy-lang-select{
  position:relative;
}

.qy-lang-switch{
  display:inline-flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  min-width:104px;
  padding:7px 10px;
  border-radius:8px;
  font-size:.79rem;
  font-weight:700;
}

.qy-lang-switch:hover,
.qy-lang-switch[aria-expanded="true"]{
  border-color:var(--qy-primary);
  background:#f2f7ff;
}

.qy-lang-caret{
  width:0;
  height:0;
  border-left:4px solid transparent;
  border-right:4px solid transparent;
  border-top:5px solid currentColor;
  transition:transform .18s ease;
}

.qy-lang-switch[aria-expanded="true"] .qy-lang-caret{
  transform:rotate(180deg);
}

.qy-lang-menu{
  position:absolute;
  top:calc(100% + 6px);
  right:0;
  z-index:60;
  min-width:140px;
  margin:0;
  padding:5px;
  list-style:none;
  border:1px solid var(--qy-border);
  border-radius:8px;
  background:var(--qy-surface);
  box-shadow:0 14px 30px rgba(15,40,80,.16);
}

.qy-lang-menu[hidden]{
  display:none;
}

.qy-lang-menu li{
  margin:0;
}

.qy-lang-option{
  display:block;
  width:100%;
  padding:8px 10px;
  border:0;
  border-radius:6px;
  background:transparent;
  color:var(--qy-text,#1f2937);
  font:inherit;
  font-size:.83rem;
  text-align:left;
  cursor:pointer;
}

.qy-lang-option:hover,
.qy-lang-option:focus-visible{
  background:#f2f7ff;
  color:var(--qy-primary);
}

.qy-lang-option.is-current{
  background:#eef4ff;
  color:var(--qy-primary);
  font-weight:700;
}

.qy-menu-toggle{
  display:none;
  width:42px;
  height:42px;
  padding:9px;
  border-radius:8px;
}

.qy-menu-toggle span{
  display:block;
  height:2px;
  margin:4px 0;
  border-radius:2px;
  background:var(--qy-text);
}

.qy-menu-toggle[aria-expanded="true"] span:nth-child(1){
  transform:translateY(6px) rotate(45deg);
}

.qy-menu-toggle[aria-expanded="true"] span:nth-child(2){
  opacity:0;
}

.qy-menu-toggle[aria-expanded="true"] span:nth-child(3){
  transform:translateY(-6px) rotate(-45deg);
}

.qy-mobile-menu{
  display:block;
  position:fixed;
  top:64px;
  right:0;
  bottom:auto;
  left:0;
  height:calc(100vh - 64px);
  height:calc(100dvh - 64px);
  z-index:999;
  padding:18px 20px 32px;
  overflow:auto;
  background:rgba(255,255,255,.99);
}

.qy-mobile-menu[hidden]{
  display:none;
}

.qy-mobile-menu a{
  display:block;
  padding:14px 4px;
  border-bottom:1px solid var(--qy-border);
  color:var(--qy-text);
  font-size:1rem;
  font-weight:700;
}

.qy-mobile-menu a.active{
  color:var(--qy-primary);
  background:var(--primary-light,#ebf3ff);
  border-radius:8px;
  font-weight:800;
}

.qy-search{
  position:relative;
  width:min(720px,100%);
  margin:0 auto -12px;
  z-index:5;
}

.qy-search-input{
  width:100%;
  padding:14px 46px 14px 18px;
  border:1px solid var(--qy-border);
  border-radius:10px;
  background:#fff;
  color:var(--qy-text);
  font:inherit;
  box-shadow:0 8px 24px rgba(25,65,110,.1);
}

.qy-search-input:focus{
  outline:3px solid rgba(43,123,228,.18);
  border-color:var(--qy-primary);
}

.qy-search-icon{
  position:absolute;
  top:50%;
  right:16px;
  color:var(--qy-muted);
  transform:translateY(-50%);
  pointer-events:none;
}

.qy-search-results{
  position:absolute;
  top:calc(100% + 8px);
  left:0;
  right:0;
  max-height:420px;
  overflow:auto;
  padding:8px;
  border:1px solid var(--qy-border);
  border-radius:10px;
  background:#fff;
  box-shadow:var(--qy-shadow);
}

.qy-search-result{
  display:block;
  padding:12px 13px;
  border-radius:8px;
  color:var(--qy-text);
}

.qy-search-result:hover,
.qy-search-result:focus{
  background:#f3f8ff;
}

.qy-search-result strong{
  display:block;
  color:var(--qy-primary);
  font-size:.92rem;
}

.qy-search-result span{
  display:block;
  margin-top:2px;
  color:var(--qy-muted);
  font-size:.78rem;
  line-height:1.5;
}

.qy-search-empty{
  padding:14px;
  color:var(--qy-muted);
  font-size:.86rem;
  text-align:center;
}

/* 英语 / 菲律宾语标签更长：收紧字距与字号，保证语言选择区始终留在导航栏内。 */
html[lang="fil"] .qy-nav,
html[lang="en"] .qy-nav{
  gap:clamp(12px,1.35vw,20px);
}

html[lang="fil"] .qy-nav a,
html[lang="en"] .qy-nav a{
  font-size:.82rem;
}

/* 长标签语言在导航放不下之前就先收进汉堡菜单，语言选择区因此永远可见。 */
@media(max-width:1199px){
  html[lang="fil"] .qy-nav,
  html[lang="en"] .qy-nav{
    display:none !important;
  }

  html[lang="fil"] .qy-lang,
  html[lang="en"] .qy-lang{
    margin-left:auto;
  }

  html[lang="fil"] .qy-menu-toggle,
  html[lang="en"] .qy-menu-toggle{
    display:block;
  }
}

@media(max-width:1080px){
  .qy-header-inner{
    gap:12px;
  }

  .qy-nav{
    gap:14px;
  }

  .qy-nav a{
    font-size:.82rem;
  }
}

@media(max-width:899px){
  .qy-header-inner{
    width:min(100% - 28px,1200px);
  }

  .qy-logo-copy small{
    display:none;
  }

  .qy-nav{
    display:none !important;
  }

  .qy-lang{
    margin-left:auto;
  }

  .qy-menu-toggle{
    display:block;
  }
}

@media(max-width:560px){
  .qy-lang{
    gap:6px;
  }

  .qy-lang-hint{
    font-size:.68rem;
  }

  .qy-lang-switch{
    min-width:92px;
    padding:6px 9px;
  }
}

@media(prefers-reduced-motion:reduce){
  .qy-skip-link,
  .qy-nav a::after{
    transition:none;
  }
}

/* 共享：下载列表（resources.html / thinktank.html） */
.dl-list{display:grid;gap:10px}
@media(min-width:640px){.dl-list{grid-template-columns:1fr 1fr}}
.dl-item{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 16px;border:1px solid var(--border);border-radius:10px;background:var(--white);transition:border-color .2s,box-shadow .2s}
.dl-item:hover{border-color:var(--primary);box-shadow:var(--shadow)}
.dl-name{font-size:.85rem;color:var(--text);font-weight:600}
.dl-size{font-size:.74rem;color:var(--text-light);white-space:nowrap}
