/*
Theme Name: 好体育 Haotiyu
Theme URI: https://hty.name
Author: Chen Xiang
Author URI: https://hty.name
Description: 一款专为综合体育资讯门户设计的 WordPress 主题。瀑布流多栏布局、分类内容块、移动端响应式、Rank Math SEO 兼容、结构化数据与 Open Graph 支持。
Version: 1.4.0
Requires at least: 5.8
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: haotiyu
Tags: news, sports, blog, grid-layout, custom-colors, custom-menu, featured-images, responsive, rtl-language-support
*/

:root {
  --hty-primary: #d72631;
  --hty-primary-dark: #a81d26;
  --hty-ink: #15171c;
  --hty-ink-soft: #3c4049;
  --hty-muted: #8a909c;
  --hty-line: #e8eaee;
  --hty-bg: #f5f6f8;
  --hty-card: #ffffff;
  --hty-accent: #0b6e99;
  --hty-radius: 10px;
  --hty-shadow: 0 1px 3px rgba(21,23,28,.06), 0 8px 24px rgba(21,23,28,.05);
  --hty-shadow-hover: 0 4px 12px rgba(21,23,28,.10), 0 16px 40px rgba(21,23,28,.10);
  --hty-font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  --hty-font-head: "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
  --hty-maxw: 1240px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--hty-font);
  color: var(--hty-ink);
  background: var(--hty-bg);
  line-height: 1.7;
  font-size: 15px;
}
a { color: inherit; text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--hty-primary); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.hty-wrap { max-width: var(--hty-maxw); margin: 0 auto; padding: 0 16px; }

/* ---------- Top bar ---------- */
.hty-topbar {
  background: var(--hty-ink);
  color: #c7cbd2;
  font-size: 12.5px;
}
.hty-topbar .hty-wrap { display: flex; justify-content: space-between; align-items: center; height: 36px; }
.hty-topbar a { color: #c7cbd2; }
.hty-topbar a:hover { color: #fff; }
.hty-topbar-date { letter-spacing: .03em; }
.hty-topbar-links { display: flex; gap: 18px; }

/* ---------- Header ---------- */
.hty-header { background: var(--hty-card); border-bottom: 3px solid var(--hty-primary); position: sticky; top: 0; z-index: 200; }
.hty-header-inner { display: flex; align-items: center; justify-content: space-between; height: 78px; gap: 24px; }
.hty-logo { display: flex; align-items: center; gap: 10px; }
.hty-logo-mark {
  width: 42px; height: 42px; border-radius: 9px;
  background: linear-gradient(135deg, var(--hty-primary), var(--hty-primary-dark));
  color: #fff; display: grid; place-items: center;
  font-family: var(--hty-font-head); font-weight: 700; font-size: 22px; flex: none;
  box-shadow: 0 4px 12px rgba(215,38,49,.32);
}
.hty-logo-text b { font-family: var(--hty-font-head); font-size: 24px; font-weight: 700; color: var(--hty-ink); display: block; line-height: 1.1; }
.hty-logo-text span { font-size: 11px; color: var(--hty-muted); letter-spacing: .28em; text-transform: uppercase; }
.hty-header-search { flex: 1; max-width: 360px; }
.hty-search-form { display: flex; background: var(--hty-bg); border: 1px solid var(--hty-line); border-radius: 999px; overflow: hidden; }
.hty-search-form input[type=search] { flex: 1; border: 0; background: transparent; padding: 0 18px; font-size: 14px; color: var(--hty-ink); outline: none; height: 42px; }
.hty-search-form button { border: 0; background: var(--hty-primary); color: #fff; padding: 0 20px; cursor: pointer; font-size: 14px; }
.hty-search-form button:hover { background: var(--hty-primary-dark); }

/* ---------- Primary nav ---------- */
.hty-nav { background: var(--hty-card); border-bottom: 1px solid var(--hty-line); position: sticky; top: 78px; z-index: 190; }
.hty-nav-inner { display: flex; align-items: center; gap: 4px; }
.hty-menu { display: flex; flex-wrap: wrap; }
.hty-menu > li > a { display: block; padding: 14px 18px; font-size: 15.5px; font-weight: 500; position: relative; }
.hty-menu > li > a::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 8px; height: 2px; background: var(--hty-primary); transform: scaleX(0); transform-origin: left; transition: transform .2s ease; }
.hty-menu > li:hover > a, .hty-menu > li.current-menu-item > a { color: var(--hty-primary); }
.hty-menu > li:hover > a::after, .hty-menu > li.current-menu-item > a::after { transform: scaleX(1); }
.hty-menu .sub-menu { position: absolute; background: var(--hty-card); box-shadow: var(--hty-shadow-hover); border-radius: var(--hty-radius); min-width: 180px; padding: 8px 0; opacity: 0; visibility: hidden; transform: translateY(6px); transition: all .18s ease; z-index: 50; }
.hty-menu li { position: relative; }
.hty-menu li:hover > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.hty-menu .sub-menu a { display: block; padding: 9px 18px; font-size: 14px; }
.hty-menu .sub-menu a:hover { background: var(--hty-bg); }

.hty-burger { display: none; background: none; border: 0; cursor: pointer; padding: 10px; }
.hty-burger span { display: block; width: 22px; height: 2px; background: var(--hty-ink); margin: 4px 0; transition: .25s; }

/* ---------- Section heading ---------- */
.hty-sec-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 16px; border-bottom: 2px solid var(--hty-line); padding-bottom: 10px; }
.hty-sec-head h2 { font-family: var(--hty-font-head); font-size: 21px; margin: 0; position: relative; padding-left: 14px; }
.hty-sec-head h2::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 5px; height: 20px; background: var(--hty-primary); border-radius: 3px; }
.hty-sec-head .more { font-size: 13px; color: var(--hty-muted); }
.hty-sec-head .more:hover { color: var(--hty-primary); }

/* ---------- Hero ---------- */
.hty-hero { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin: 24px 0; }
.hty-hero-main { position: relative; border-radius: var(--hty-radius); overflow: hidden; min-height: 420px; box-shadow: var(--hty-shadow); }
.hty-hero-main img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; transition: transform .5s ease; }
.hty-hero-main:hover img { transform: scale(1.04); }
.hty-hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(10,12,16,.85)); display: flex; flex-direction: column; justify-content: flex-end; padding: 28px; }
.hty-hero-main h2 { font-family: var(--hty-font-head); color: #fff; font-size: 28px; margin: 10px 0 6px; line-height: 1.35; }
.hty-hero-main p { color: rgba(255,255,255,.82); margin: 0; font-size: 14px; }
.hty-hero-side { display: flex; flex-direction: column; gap: 16px; }
.hty-hero-card { position: relative; flex: 1; border-radius: var(--hty-radius); overflow: hidden; min-height: 130px; box-shadow: var(--hty-shadow); }
.hty-hero-card img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; transition: transform .5s ease; }
.hty-hero-card:hover img { transform: scale(1.06); }
.hty-hero-card .hty-hero-overlay { padding: 16px; }
.hty-hero-card h3 { color: #fff; font-size: 16px; margin: 0; line-height: 1.4; }

.hty-cat-tag { display: inline-block; background: var(--hty-primary); color: #fff; font-size: 11.5px; padding: 3px 10px; border-radius: 4px; font-weight: 500; align-self: flex-start; }

/* ---------- Layout grid ---------- */
.hty-layout { display: grid; grid-template-columns: 1fr 320px; gap: 32px; margin: 32px 0; }
@media (max-width: 980px) { .hty-layout { grid-template-columns: 1fr; } }

/* ---------- Waterfall / masonry grid ---------- */
.hty-grid { columns: 2; column-gap: 20px; }
@media (max-width: 600px) { .hty-grid { columns: 1; } }
.hty-card {
  background: var(--hty-card); border-radius: var(--hty-radius); overflow: hidden;
  box-shadow: var(--hty-shadow); margin: 0 0 20px; break-inside: avoid;
  transition: transform .2s ease, box-shadow .2s ease;
}
.hty-card:hover { transform: translateY(-3px); box-shadow: var(--hty-shadow-hover); }
.hty-card-thumb { position: relative; display: block; overflow: hidden; }
.hty-card-thumb img { width: 100%; transition: transform .5s ease; }
.hty-card:hover .hty-card-thumb img { transform: scale(1.05); }
.hty-card-thumb .hty-cat-tag { position: absolute; top: 12px; left: 12px; }
.hty-card-body { padding: 16px 18px 18px; }
.hty-card-body h3 { font-family: var(--hty-font-head); font-size: 18px; line-height: 1.45; margin: 0 0 8px; }
.hty-card-body .excerpt { color: var(--hty-ink-soft); font-size: 14px; margin: 0 0 12px; }
.hty-card-meta { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--hty-muted); }
.hty-card-meta .dot { width: 3px; height: 3px; background: var(--hty-muted); border-radius: 50%; }

/* ---------- Category block (multi-column portal) ---------- */
.hty-catblock { margin: 32px 0; }
.hty-catblock-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 880px) { .hty-catblock-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .hty-catblock-grid { grid-template-columns: 1fr; } }

/* ---------- Sidebar ---------- */
.hty-sidebar .widget { background: var(--hty-card); border-radius: var(--hty-radius); padding: 20px; margin-bottom: 24px; box-shadow: var(--hty-shadow); }
.hty-sidebar .widget-title { font-family: var(--hty-font-head); font-size: 17px; margin: 0 0 16px; padding-bottom: 10px; border-bottom: 2px solid var(--hty-line); position: relative; }
.hty-sidebar .widget-title::before { content: ""; position: absolute; left: 0; bottom: -2px; width: 48px; height: 2px; background: var(--hty-primary); }
.hty-rank-list li { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--hty-line); }
.hty-rank-list li:last-child { border-bottom: 0; }
.hty-rank-num { width: 22px; height: 22px; flex: none; border-radius: 5px; background: var(--hty-bg); color: var(--hty-muted); font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.hty-rank-list li:nth-child(1) .hty-rank-num { background: var(--hty-primary); color: #fff; }
.hty-rank-list li:nth-child(2) .hty-rank-num { background: #ff7a45; color: #fff; }
.hty-rank-list li:nth-child(3) .hty-rank-num { background: #ffa940; color: #fff; }
.hty-rank-list a { font-size: 14px; line-height: 1.5; }

/* ---------- Single post ---------- */
.hty-single { background: var(--hty-card); border-radius: var(--hty-radius); padding: 36px 40px; box-shadow: var(--hty-shadow); }
@media (max-width: 600px) { .hty-single { padding: 24px 20px; } }
.hty-single h1 { font-family: var(--hty-font-head); font-size: 32px; line-height: 1.35; margin: 0 0 16px; }
.hty-single-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--hty-muted); padding-bottom: 18px; margin-bottom: 24px; border-bottom: 1px solid var(--hty-line); }
.hty-content { font-size: 16.5px; line-height: 1.9; color: var(--hty-ink-soft); }
.hty-content p { margin: 0 0 1.3em; }
.hty-content h2 { font-family: var(--hty-font-head); font-size: 23px; color: var(--hty-ink); margin: 1.6em 0 .6em; }
.hty-content h3 { font-size: 19px; color: var(--hty-ink); margin: 1.4em 0 .5em; }
.hty-content img { border-radius: 8px; margin: 1.2em 0; }
.hty-content blockquote { border-left: 4px solid var(--hty-primary); background: var(--hty-bg); margin: 1.4em 0; padding: 14px 20px; color: var(--hty-ink); border-radius: 0 8px 8px 0; }
.hty-content a { color: var(--hty-accent); text-decoration: underline; }

/* ---------- Pagination ---------- */
.hty-pagination { display: flex; justify-content: center; gap: 8px; margin: 32px 0; }
.hty-pagination a, .hty-pagination span { padding: 9px 15px; background: var(--hty-card); border-radius: 7px; font-size: 14px; box-shadow: var(--hty-shadow); }
.hty-pagination .current { background: var(--hty-primary); color: #fff; }
.hty-pagination a:hover { background: var(--hty-primary); color: #fff; }

/* ---------- Footer ---------- */
.hty-footer { background: var(--hty-ink); color: #aeb4bf; margin-top: 48px; padding: 44px 0 0; }
.hty-footer-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 36px; }
@media (max-width: 760px) { .hty-footer-cols { grid-template-columns: 1fr 1fr; gap: 24px; } }
.hty-footer h4 { color: #fff; font-size: 15px; margin: 0 0 16px; }
.hty-footer a { color: #aeb4bf; font-size: 13.5px; line-height: 2.1; }
.hty-footer a:hover { color: #fff; }
.hty-footer-brand b { font-family: var(--hty-font-head); font-size: 22px; color: #fff; }
.hty-footer-brand p { font-size: 13px; line-height: 1.8; margin: 12px 0 0; max-width: 280px; }
.hty-footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 18px 0; text-align: center; font-size: 12.5px; color: #6b727f; }

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
  .hty-header-search { display: none; }
  .hty-header-inner { height: 62px; }
  .hty-logo-mark { width: 36px; height: 36px; font-size: 19px; }
  .hty-logo-text b { font-size: 20px; }
  .hty-burger { display: block; }
  .hty-nav { position: static; }
  .hty-nav-inner { position: relative; }
  .hty-menu { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: var(--hty-card); box-shadow: var(--hty-shadow-hover); max-height: 0; overflow: hidden; transition: max-height .3s ease; z-index: 195; }
  .hty-menu.open { max-height: 80vh; overflow-y: auto; }
  .hty-menu > li { width: 100%; border-bottom: 1px solid var(--hty-line); }
  .hty-menu .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; padding-left: 16px; }
  .hty-hero { grid-template-columns: 1fr; }
  .hty-hero-main { min-height: 260px; }
  .hty-hero-main h2 { font-size: 22px; }
  .hty-single h1 { font-size: 25px; }
}

.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }

/* ============================================================
   v1.1 — 栏目页 / 内容页精致化
   ============================================================ */

/* ---------- 阅读进度条 ---------- */
.hty-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--hty-primary), #ff7a45); z-index: 999; transition: width .1s linear; }

/* ---------- 内容页头部 ---------- */
.hty-single-head { margin-bottom: 22px; }
.hty-single-head .hty-cat-tag { margin-bottom: 14px; }
.hty-single-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 18px; margin-bottom: 0; border-bottom: 1px solid var(--hty-line); }
.hty-author { display: flex; align-items: center; gap: 10px; }
.hty-author .hty-avatar { border-radius: 50%; }
.hty-author-txt b { display: block; font-size: 14px; color: var(--hty-ink); line-height: 1.3; }
.hty-author-txt i { font-style: normal; font-size: 12.5px; color: var(--hty-muted); }
.hty-meta-stats { display: flex; gap: 8px; font-size: 13px; color: var(--hty-muted); }

.hty-single-thumb { margin: 0 0 28px; border-radius: 12px; overflow: hidden; box-shadow: var(--hty-shadow); }
.hty-single-thumb img { width: 100%; display: block; }

/* ---------- 内容排版增强 ---------- */
.hty-content { font-size: 17px; line-height: 1.95; color: #2b2f38; }
.hty-content > p:first-of-type { font-size: 18px; color: var(--hty-ink); }
.hty-content h2 { position: relative; padding-left: 16px; }
.hty-content h2::before { content: ""; position: absolute; left: 0; top: .15em; bottom: .15em; width: 5px; border-radius: 3px; background: var(--hty-primary); }
.hty-content figure { margin: 1.6em 0; }
.hty-content figcaption { text-align: center; font-size: 13px; color: var(--hty-muted); margin-top: 8px; }
.hty-content ul, .hty-content ol { padding-left: 1.4em; margin: 0 0 1.3em; }
.hty-content ul { list-style: disc; } .hty-content ol { list-style: decimal; }
.hty-content li { margin: .4em 0; }
.hty-linkpages { margin-top: 24px; font-size: 14px; }
.hty-linkpages a { display: inline-block; padding: 4px 12px; background: var(--hty-bg); border-radius: 6px; margin: 0 4px; }

/* ---------- 标签 ---------- */
.hty-tags { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--hty-line); display: flex; flex-wrap: wrap; gap: 8px; }
.hty-tags a { background: var(--hty-bg); color: var(--hty-ink-soft); font-size: 13px; padding: 6px 14px; border-radius: 999px; transition: all .18s; }
.hty-tags a:hover { background: var(--hty-primary); color: #fff; }

/* ---------- 分享 ---------- */
.hty-share { margin-top: 24px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hty-share-label { font-size: 14px; color: var(--hty-muted); }
.hty-share-btn { font-size: 13px; padding: 8px 18px; border-radius: 999px; border: 1px solid var(--hty-line); background: var(--hty-card); cursor: pointer; color: var(--hty-ink-soft); transition: all .18s; }
.hty-share-btn:hover { color: #fff; border-color: transparent; }
.hty-share-btn.wb:hover { background: #e6162d; }
.hty-share-btn.qz:hover { background: #f6c244; color: #15171c; }
.hty-share-btn.copy:hover { background: var(--hty-ink); }

/* ---------- 上一篇 / 下一篇 ---------- */
.hty-postnav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 28px 0; }
@media (max-width: 560px) { .hty-postnav { grid-template-columns: 1fr; } }
.hty-postnav-item { background: var(--hty-card); border-radius: var(--hty-radius); padding: 16px 20px; box-shadow: var(--hty-shadow); transition: all .2s; }
.hty-postnav-item:hover { box-shadow: var(--hty-shadow-hover); transform: translateY(-2px); }
.hty-postnav-item.next { text-align: right; }
.hty-postnav-item .dir { font-size: 12.5px; color: var(--hty-primary); display: block; margin-bottom: 6px; }
.hty-postnav-item b { font-size: 15px; line-height: 1.45; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.hty-related { margin-top: 36px; }

/* ---------- 侧边栏作者卡 ---------- */
.widget-author { text-align: center; }
.widget-author img { border-radius: 50%; margin: 0 auto 12px; }
.widget-author b { font-family: var(--hty-font-head); font-size: 17px; display: block; }
.widget-author p { font-size: 13px; color: var(--hty-muted); line-height: 1.7; margin: 8px 0 0; }

/* ---------- 侧栏迷你列表（带缩略图） ---------- */
.hty-mini-list li { padding: 10px 0; border-bottom: 1px dashed var(--hty-line); }
.hty-mini-list li:last-child { border-bottom: 0; }
.hty-mini-list a { display: flex; gap: 11px; align-items: center; }
.hty-mini-thumb { width: 72px; height: 50px; flex: none; border-radius: 7px; overflow: hidden; }
.hty-mini-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hty-mini-title { font-size: 13.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ============================================================
   栏目页头部横幅
   ============================================================ */
.hty-cat-banner { background: linear-gradient(120deg, var(--cat-c, var(--hty-primary)), color-mix(in srgb, var(--cat-c, var(--hty-primary)) 70%, #000)); color: #fff; position: relative; overflow: hidden; }
.hty-cat-banner::after { content: ""; position: absolute; right: -60px; top: -60px; width: 280px; height: 280px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hty-cat-banner::before { content: ""; position: absolute; right: 120px; bottom: -90px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.06); }
.hty-cat-banner-inner { display: flex; align-items: center; justify-content: space-between; padding: 40px 16px; position: relative; z-index: 1; }
.hty-cat-banner-label { display: inline-block; background: rgba(255,255,255,.2); font-size: 12px; padding: 4px 12px; border-radius: 999px; letter-spacing: .1em; }
.hty-cat-banner h1 { font-family: var(--hty-font-head); font-size: 38px; margin: 12px 0 8px; color: #fff; }
.hty-cat-banner p { margin: 0; font-size: 15px; color: rgba(255,255,255,.85); max-width: 600px; }
.hty-cat-banner-count { text-align: center; flex: none; }
.hty-cat-banner-count b { font-family: var(--hty-font-head); font-size: 46px; line-height: 1; display: block; }
.hty-cat-banner-count span { font-size: 13px; color: rgba(255,255,255,.8); }
@media (max-width: 600px) {
  .hty-cat-banner h1 { font-size: 28px; }
  .hty-cat-banner-count { display: none; }
  .hty-cat-banner-inner { padding: 28px 16px; }
}

/* ---------- 栏目置顶大图 ---------- */
.hty-cat-feature { display: block; background: var(--hty-card); border-radius: 12px; overflow: hidden; box-shadow: var(--hty-shadow); margin: 24px 0 32px; transition: all .2s; }
.hty-cat-feature:hover { box-shadow: var(--hty-shadow-hover); }
.hty-cat-feature-img { overflow: hidden; max-height: 360px; }
.hty-cat-feature-img img { width: 100%; transition: transform .5s ease; }
.hty-cat-feature:hover .hty-cat-feature-img img { transform: scale(1.03); }
.hty-cat-feature-body { padding: 22px 26px 24px; }
.hty-cat-feature-body h2 { font-family: var(--hty-font-head); font-size: 24px; margin: 12px 0 10px; line-height: 1.4; }
.hty-cat-feature-body p { color: var(--hty-ink-soft); font-size: 15px; margin: 0 0 14px; }

/* ---------- 栏目快捷标签 ---------- */
.hty-cat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hty-cat-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--hty-bg); padding: 7px 14px; border-radius: 999px; font-size: 13.5px; transition: all .18s; }
.hty-cat-chip span { background: var(--hty-card); color: var(--hty-muted); font-size: 11px; padding: 1px 7px; border-radius: 999px; }
.hty-cat-chip:hover { background: var(--hty-primary); color: #fff; }
.hty-cat-chip:hover span { color: var(--hty-primary); }

/* ============================================================
   v1.2 — 登录 / 注册 按钮 + 弹窗
   ============================================================ */

/* ---------- header 按钮 ---------- */
.hty-auth-btns { display: flex; gap: 10px; flex: none; }
.hty-auth-btn {
  position: relative; border: 0; cursor: pointer; font-size: 14px; font-weight: 600;
  padding: 9px 22px; border-radius: 999px; overflow: hidden;
  font-family: var(--hty-font); transition: transform .18s ease, box-shadow .18s ease;
}
.hty-auth-btn.login { background: #fff; color: var(--hty-primary); border: 1.5px solid var(--hty-primary); }
.hty-auth-btn.login:hover { background: var(--hty-primary); color: #fff; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(215,38,49,.28); }
.hty-auth-btn.register {
  color: #fff;
  background: linear-gradient(120deg, #ff4d5a, var(--hty-primary) 45%, var(--hty-primary-dark));
  background-size: 200% 100%;
  box-shadow: 0 4px 14px rgba(215,38,49,.35);
  animation: htyGradShift 4s ease infinite;
}
.hty-auth-btn.register:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(215,38,49,.5); }
/* 光泽划过 */
.hty-auth-btn.register::after {
  content: ""; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-20deg);
}
.hty-auth-btn.register:hover::after { animation: htyShine .85s ease; }
@keyframes htyShine { to { left: 140%; } }
@keyframes htyGradShift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
/* 脉冲光环吸引注意 */
.hty-auth-btn.register::before {
  content: ""; position: absolute; inset: 0; border-radius: 999px;
  box-shadow: 0 0 0 0 rgba(215,38,49,.5); animation: htyPulse 2.4s ease-out infinite;
}
@keyframes htyPulse { 0% { box-shadow: 0 0 0 0 rgba(215,38,49,.45); } 70%,100% { box-shadow: 0 0 0 12px rgba(215,38,49,0); } }

/* ---------- 弹窗遮罩 ---------- */
.hty-modal-overlay {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  background: rgba(15,17,21,.55); backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s ease; padding: 20px;
}
.hty-modal-overlay.open { opacity: 1; visibility: visible; }

.hty-modal {
  position: relative; width: 100%; max-width: 400px; background: var(--hty-card);
  border-radius: 18px; padding: 34px 32px 30px; box-shadow: 0 24px 70px rgba(0,0,0,.3);
  transform: translateY(24px) scale(.94); opacity: 0; transition: transform .35s cubic-bezier(.2,.9,.3,1.2), opacity .3s ease;
}
.hty-modal-overlay.open .hty-modal { transform: translateY(0) scale(1); opacity: 1; }
/* 顶部渐变描边光 */
.hty-modal::before {
  content: ""; position: absolute; inset: 0; border-radius: 18px; padding: 1.5px;
  background: linear-gradient(135deg, #ff4d5a, var(--hty-primary), transparent 60%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}

.hty-modal-close { position: absolute; top: 16px; right: 18px; background: var(--hty-bg); border: 0; width: 32px; height: 32px; border-radius: 50%; font-size: 20px; color: var(--hty-muted); cursor: pointer; line-height: 1; transition: all .18s; }
.hty-modal-close:hover { background: var(--hty-primary); color: #fff; transform: rotate(90deg); }

.hty-modal-brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 22px; }
.hty-modal-mark { width: 38px; height: 38px; border-radius: 9px; background: linear-gradient(135deg, var(--hty-primary), var(--hty-primary-dark)); color: #fff; display: grid; place-items: center; font-family: var(--hty-font-head); font-weight: 700; font-size: 20px; box-shadow: 0 4px 12px rgba(215,38,49,.35); }
.hty-modal-brand b { font-family: var(--hty-font-head); font-size: 21px; }

/* ---------- 选项卡 ---------- */
.hty-modal-tabs { position: relative; display: flex; background: var(--hty-bg); border-radius: 12px; padding: 5px; margin-bottom: 22px; }
.hty-modal-tab { flex: 1; border: 0; background: transparent; padding: 10px 0; font-size: 15px; font-weight: 600; color: var(--hty-muted); cursor: pointer; border-radius: 9px; position: relative; z-index: 1; transition: color .25s; font-family: var(--hty-font); }
.hty-modal-tab.active { color: #fff; }
.hty-modal-tab-ind { position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc(50% - 5px); border-radius: 9px; background: linear-gradient(120deg, #ff4d5a, var(--hty-primary-dark)); box-shadow: 0 4px 12px rgba(215,38,49,.4); transition: transform .32s cubic-bezier(.4,.1,.2,1); }
.hty-modal-tabs[data-active="register"] .hty-modal-tab-ind { transform: translateX(100%); }

/* ---------- 表单 ---------- */
.hty-modal-form { display: none; flex-direction: column; gap: 16px; animation: htyFadeUp .35s ease; }
.hty-modal-form.active { display: flex; }
@keyframes htyFadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.hty-field { display: flex; flex-direction: column; gap: 6px; }
.hty-field span { font-size: 13px; color: var(--hty-ink-soft); font-weight: 500; }
.hty-field input { height: 46px; border: 1.5px solid var(--hty-line); border-radius: 10px; padding: 0 16px; font-size: 14px; font-family: var(--hty-font); background: var(--hty-bg); transition: all .2s; }
.hty-field input:focus { outline: none; border-color: var(--hty-primary); background: #fff; box-shadow: 0 0 0 4px rgba(215,38,49,.1); }
.hty-field-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.hty-check { display: flex; align-items: center; gap: 6px; color: var(--hty-ink-soft); cursor: pointer; }
.hty-link { color: var(--hty-primary); }
.hty-modal-submit {
  height: 48px; border: 0; border-radius: 10px; color: #fff; font-size: 15.5px; font-weight: 600; cursor: pointer;
  background: linear-gradient(120deg, #ff4d5a, var(--hty-primary) 50%, var(--hty-primary-dark)); background-size: 200% 100%;
  box-shadow: 0 6px 18px rgba(215,38,49,.4); transition: all .2s; font-family: var(--hty-font); margin-top: 4px;
}
.hty-modal-submit:hover { background-position: 100% 50%; transform: translateY(-2px); box-shadow: 0 10px 26px rgba(215,38,49,.55); }
.hty-modal-submit:active { transform: translateY(0); }
.hty-modal-switch { text-align: center; font-size: 13.5px; color: var(--hty-muted); margin: 4px 0 0; }
.hty-modal-switch a { color: var(--hty-primary); font-weight: 600; }

/* ---------- 移动端 ---------- */
@media (max-width: 768px) {
  .hty-auth-btns { gap: 8px; }
  .hty-auth-btn { padding: 7px 16px; font-size: 13px; }
  .hty-modal { padding: 28px 22px 24px; border-radius: 16px; }
}
@media (max-width: 420px) {
  .hty-auth-btn.login { display: none; } /* 极窄屏只保留注册主按钮 */
}
