/* ==========================================================================
   云帆民航词典 · cadict.net 首页样式（纯 CSS · Apple 风格）
   页面模型：无参数 = 官网首页；html.searching（?wd= 或发起检索）= 查词态。
   两态共用一套页面，无感切换。
   配色以 LOGO 为源：CA 蓝 #3460cb / Dict 黄 #ffcb1f；
   中性色沿用 Apple 规范（#1d1d1f / #86868b / #f5f5f7）。无任何贴图装饰。
   ========================================================================== */

:root {
    --blue: #3460cb;
    --blue-dark: #2950ac;
    --blue-tint: rgba(52, 96, 203, 0.08);
    --blue-ring: rgba(52, 96, 203, 0.14);
    --yellow: #ffcb1f;
    --ink: #1d1d1f;
    --ink-2: #4b4b50;
    --ink-3: #86868b;
    --line: rgba(0, 0, 0, 0.06);
    --card: #ffffff;
    --bubble: #f5f5f7;
    --bg: #f5f5f7;
    --radius: 18px;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.06), 0 18px 44px rgba(0, 0, 0, 0.08);
    --track: rgba(120, 120, 128, 0.12);
    --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- Reset ---------- */
html, body, div, span, h1, h2, h3, h4, p, a, img, ol, ul, li, svg {
    margin: 0;
    padding: 0;
    border: 0;
    font: inherit;
    vertical-align: baseline;
}
*, *::before, *::after { box-sizing: border-box; }
ol, ul { list-style: none; }
img { max-width: 100%; }
body { line-height: 1; }

/* ---------- 基础 ---------- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
                 "Segoe UI", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    color: var(--ink-2);
    line-height: 1.65;
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    letter-spacing: 0.01em;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 22px; }

.clear { clear: both; }
.clearfix::after { content: ""; display: table; clear: both; }

a { color: var(--blue); text-decoration: none; transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease; }
a:hover { color: var(--blue-dark); }

::selection { background: var(--blue); color: #fff; }

/* ==========================================================================
   吸顶导航（毛玻璃）
   ========================================================================== */
.topnav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(245, 245, 247, 0.85);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--line);
}
.topnav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 54px;
}
.nav-brand { display: inline-flex; align-items: center; line-height: 0; }
.nav-brand img { height: 36px; width: auto; }
.nav-links { display: flex; gap: 28px; transition: opacity 0.2s ease; }
.nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-2);
    cursor: pointer;
}
.nav-links a:hover { color: var(--ink); }

/* ==========================================================================
   Hero：标题 + tagline + 搜索舱
   ========================================================================== */
.hero { padding: 56px 0 12px; text-align: center; }

.hero-logo { margin: 0 0 18px; }
.hero-logo a { display: inline-block; line-height: 0; }
.hero-logo img { width: min(300px, 72vw); height: auto; vertical-align: bottom; transition: width 0.25s ease; }

.hero-tagline {
    font-size: 17px;
    color: var(--ink-3);
    letter-spacing: 0.02em;
    margin: 0 0 30px;
}
.hero-tagline b { font-weight: 600; color: var(--ink-2); }

/* 查词态：hero 收缩 */
html.searching .hero { padding-top: 30px; }
html.searching .hero-logo { margin-bottom: 12px; }
html.searching .hero-logo img { width: 150px; }
html.searching .hero-tagline { display: none; }
html.searching .search-capsule { max-width: 780px; }

/* ---------- 搜索舱 ---------- */
.search-capsule { max-width: 680px; margin: 0 auto; }
.search-box {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--card);
    border-radius: 26px;
    box-shadow: var(--shadow);
    padding: 9px 9px 9px 4px;
    transition: box-shadow 0.2s ease;
}
.search-box:has(.inputField:focus) { box-shadow: 0 0 0 4px var(--blue-ring), var(--shadow-hover); }

.inputField {
    order: 1;
    flex: 1;
    min-width: 0;
    height: 52px;
    padding: 0 16px 0 46px;
    font-size: 17px;
    font-family: inherit;
    color: var(--ink);
    background: transparent;
    border: 0;
    outline: none;
}
.btn { order: 2; display: flex; flex: none; }
.btn input#searchButton {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    cursor: pointer;
    height: 48px;
    padding: 0 28px;
    border-radius: 980px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 4px;
    text-indent: 4px;
    font-family: inherit;
    color: #fff;
    background: var(--blue);
    transition: background 0.18s ease, transform 0.1s ease;
}
.btn input#searchButton:hover { background: var(--blue-dark); }
.btn input#searchButton:active { transform: scale(0.96); }

/* 纯 CSS 放大镜 */
.input_icon {
    order: 0;
    position: absolute; /* 仅作锚点容器，实际定位见下 */
}
.search-box { position: relative; }
.search-box .input_icon {
    position: absolute;
    left: 22px;
    top: 50%;
    width: 15px;
    height: 15px;
    margin-top: -8px;
    border: 2px solid var(--ink-3);
    border-radius: 50%;
    pointer-events: none;
}
.search-box .input_icon::after {
    content: "";
    position: absolute;
    right: -6px;
    bottom: -3px;
    width: 8px;
    height: 2px;
    background: var(--ink-3);
    border-radius: 1px;
    transform: rotate(45deg);
}

/* 热门查询 chips */
.quick-words {
    margin-top: 16px;
    font-size: 13px;
    color: var(--ink-3);
}
html.searching .quick-words { display: none; }
.quick-words a {
    display: inline-block;
    margin: 3px 3px;
    padding: 3px 14px;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--blue);
    background: var(--blue-tint);
    border-radius: 980px;
}
.quick-words a:hover { background: var(--blue); color: #fff; }

/* ==========================================================================
   查词结果（仅查词态显示）
   ========================================================================== */
.results { display: none; }
html.searching .results {
    display: block;
    max-width: 780px;
    margin: 0 auto;
    padding-bottom: 40px;
}
/* 结果统计行：统计居左，「发送到手机」居右 */
.results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 14px;
}
.results-stats {
    font-size: 13.5px;
    color: var(--ink-3);
}
.results-stats b {
    font-weight: 600;
    color: var(--ink-2);
}
.send-phone {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 15px;
    font-size: 13px;
    font-weight: 500;
    color: var(--blue);
    background: var(--blue-tint);
    border-radius: 980px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: background 0.18s ease, color 0.18s ease;
}
.send-phone svg { width: 15px; height: 15px; }
.send-phone:hover { color: #fff; background: var(--blue); }

/* 点击词条内容即复制：手型光标提示可点（仅指针设备；触屏不显示光标） */
@media (hover: hover) {
    .comment-entry { cursor: pointer; }
}

/* 复制成功/失败轻提示 */
#copyToast {
    position: fixed;
    left: 50%;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    z-index: 200;
    padding: 10px 22px;
    font-size: 13.5px;
    font-weight: 500;
    color: #fff;
    background: rgba(29, 29, 31, 0.88);
    border-radius: 980px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.22);
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
#copyToast.show { opacity: 1; transform: translateX(-50%); }
#copyToast.err { background: rgba(214, 69, 69, 0.92); }

/* ---------- 词条卡片 ---------- */
.comment-list ol { list-style: none; }
li.comment {
    margin: 0 0 20px;
    background: var(--card);
    border-radius: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: entryIn 0.25s both;
}
.comment-body { padding: 22px 24px; display: flex; gap: 16px; }

.comment-avatar { flex: none; }
.avatar img {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 1px solid var(--line);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    display: block;
}

.comment-text {
    flex: 1;
    min-width: 0;
    position: relative;
    background: var(--bubble);
    border-radius: 16px;
    padding: 14px 18px;
}
/* 纯 CSS 气泡尖角 */
.comment-text::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 22px;
    width: 11px;
    height: 11px;
    background: var(--bubble);
    transform: rotate(45deg);
}
.comment-arrow { display: none; }

/* 词典来源徽章（内容之后另有「来源：xxx」灰字） */
.comment-author { margin-bottom: 9px; }
.link-author {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 3px 12px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--blue);
    letter-spacing: 0;
    background: var(--blue-tint);
    border-radius: 980px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.link-author::before {
    content: "";
    flex: none;
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--yellow);
    margin-right: 7px;
}
/* 来源：置于内容之后的灰度小字（与小程序单词卡规范一致） */
.comment-source {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--ink-3);
}
.comment-entry { font-size: 14.5px; color: var(--ink-2); }
.comment-entry p { margin: 6px 0; }
.comment-entry p:empty { display: none; }
/* 核心释义段（紧跟占位空段的第一个实体段）：加重突出 */
.comment-entry p:empty + p {
    font-size: 16px;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: 0.005em;
}
.comment-entry img { border-radius: 12px; margin: 10px 0; }
/* 无结果 / 出错的红字柔化（历史上是 <font color="#ff0000">） */
.comment-entry font[color="#ff0000"] { color: #d94f43; font-weight: 500; }

/* ==========================================================================
   官网内容（查词态隐藏）
   ========================================================================== */
#home { display: block; }
html.searching #home { display: none; }

/* ---------- 特性栏：纯排版不加卡 ---------- */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    padding: 56px 0 8px;
}
.feature-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--blue-tint);
    color: var(--blue);
    margin-bottom: 14px;
}
.feature-icon svg { width: 22px; height: 22px; }
.feature h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.01em;
    margin-bottom: 8px;
}
.feature p { font-size: 14px; }

/* ---------- 区块标题 ---------- */
.block { padding: 48px 0 0; }
.section-title {
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.02em;
}
.section-sub {
    text-align: center;
    font-size: 14.5px;
    color: var(--ink-3);
    margin: 8px 0 28px;
}

/* ---------- 卡片网格 ---------- */
.cards { display: grid; gap: 20px; }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-2 { grid-template-columns: repeat(2, 1fr); }

.card {
    background: var(--card);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 26px 26px 28px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }

.card h4 {
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.01em;
    margin: 0 0 8px;
}
.card p { margin: 6px 0; font-size: 13.5px; }

.card-image { text-align: center; margin: 0 0 16px; }
.card-image img {
    width: auto;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 0 0 1px var(--line), 0 4px 14px rgba(0, 0, 0, 0.06);
    padding: 6px;
}
#open-weapp-btn { cursor: pointer; }
#open-weapp-btn img { max-width: 200px; transition: transform 0.18s ease; }
#open-weapp-btn:hover img { transform: scale(1.03); }

/* 品牌重点卡：微信小程序（蓝渐变） */
.card.featured {
    background: linear-gradient(140deg, #2c53b4 0%, #3460cb 48%, #5d84d8 100%);
    box-shadow: 0 10px 30px rgba(52, 96, 203, 0.32);
}
.card.featured:hover { box-shadow: 0 16px 40px rgba(52, 96, 203, 0.4); }
.card.featured h4 { color: #fff; }
.card.featured p { color: rgba(255, 255, 255, 0.88); }
.card.featured .card-image img { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.24); }

/* 「立即访问 / 网盘下载」：填充胶囊 */
.see-more {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 22px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--blue);
    background: var(--blue-tint);
    border-radius: 980px;
    transition: background 0.18s ease, color 0.18s ease;
}
.see-more:hover { color: #fff; background: var(--blue); }

/* ==========================================================================
   页脚（两种状态常驻）
   ========================================================================== */
.site-foot {
    margin-top: 56px;
    border-top: 1px solid var(--line);
    padding: 44px 0 56px;
}
.foot-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 36px 48px;
}
.foot-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.01em;
    margin-bottom: 10px;
}
/* 品牌黄圆点（与词条卡一致） */
.foot-title::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--yellow);
    margin-right: 9px;
    vertical-align: 1px;
}
.foot-block p { margin: 6px 0; font-size: 13.5px; }
.foot-block a { font-weight: 500; }
.foot-block a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* 友情链接胶囊 */
.tag-link-1 {
    display: inline-block;
    margin: 0 8px 8px 0;
    padding: 6px 15px;
    font-size: 13px;
    background: var(--track);
    color: var(--ink-2);
    border-radius: 980px;
    transition: background 0.18s ease, color 0.18s ease;
}
.tag-link-1:hover { background: var(--blue); color: #fff; }
.tag-link-1 span { pointer-events: none; }

/* 第三方访问统计 */
.foot-analytics {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: 12px;
    overflow: hidden;
}
/* 版权 + 备案（页脚最后一行） */
.foot-copyright {
    margin: 12px 0 0;
    text-align: center;
    font-size: 12.5px;
    color: var(--ink-3);
}
.foot-copyright a { color: var(--ink-3); }
.foot-copyright a:hover { color: var(--blue); text-decoration: none; }
.foot-sep {
    display: inline-block;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--ink-3);
    margin: 0 10px 3px;
    vertical-align: middle;
}

/* ==========================================================================
   浮层（小程序推荐）
   ========================================================================== */
#mobile-popup,
#phone-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 20px;
}
.popup-content {
    position: relative;
    background: var(--card);
    border-radius: 22px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
    padding: 32px 34px 28px;
    text-align: center;
    max-width: 320px;
    width: 100%;
    animation: popIn 0.22s ease-out both;
}
.popup-content img { width: 80%; max-width: 230px; height: auto; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
.popup-content p { margin: 6px 0; font-size: 14.5px; color: var(--ink-2); }
.popup-content p:first-of-type { margin-bottom: 12px; }
/* 「发送到手机」弹窗内的二维码与当前词 */
#phoneQrImg { width: 200px; }
.phone-word {
    margin-top: 14px !important;
    font-size: 16px !important;
    font-weight: 600;
    color: var(--ink) !important;
    word-break: break-all;
}
.popup-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 24px;
    line-height: 1;
    color: #c7c7cc;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
}
.popup-close:hover { color: var(--ink); transform: scale(1.08); }

/* 「打开小程序」按钮（仅移动端由 JS 显示） */
#open-weapp { display: none; margin: 16px 0 2px; }
#open-weapp a {
    display: block;
    padding: 13px 0;
    border-radius: 980px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: var(--blue);
}
#open-weapp a:active { transform: scale(0.97); }

/* ---------- 动效 ---------- */
@keyframes entryIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#searchResult .comment { animation: entryIn 0.25s both; }
@keyframes popIn { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    li.comment, #searchResult .comment, .popup-content { animation: none; }
    .card, .nav-links { transition: none; }
}

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 900px) {
    .topnav-inner { height: 50px; }
    .nav-brand img { height: 32px; }
    .nav-links { gap: 20px; }

    .hero { padding: 36px 0 8px; }
    .hero-tagline { font-size: 15px; margin-bottom: 24px; }
    html.searching .hero { padding-top: 22px; }
    html.searching .hero-logo img { width: 130px; }

    .search-box { border-radius: 22px; padding: 8px 8px 8px 4px; }
    .search-box .input_icon { left: 19px; }
    .inputField { height: 46px; font-size: 16px; padding-left: 42px; }
    .btn input#searchButton { height: 42px; padding: 0 18px; letter-spacing: 2px; text-indent: 2px; font-size: 15px; }

    .features { grid-template-columns: 1fr; gap: 28px; padding-top: 36px; }
    .cards-3, .cards-2 { grid-template-columns: 1fr; }
    .block { padding-top: 40px; }
    .section-title { font-size: 22px; }

    .foot-grid { grid-template-columns: 1fr; gap: 28px; }
    .site-foot { margin-top: 40px; padding-bottom: 44px; }

    .comment-body { padding: 16px; gap: 12px; }
    .avatar img { width: 46px; height: 46px; }
    .comment-entry p:empty + p { font-size: 15px; }
    .popup-content { padding: 26px 24px 22px; }
}

/* 手机端（≤600px）：收紧版式 + 隐藏非必要内容 */
@media (max-width: 600px) {
    /* 统计行允许换行，避免「发送到手机」被挤压 */
    .results-bar { flex-wrap: wrap; row-gap: 8px; }

    /* 隐藏与手机无关/纯桌面向内容：
       吸顶导航、特性介绍、产品矩阵、PC 版下载卡、特别鸣谢、友情链接、第三方访问统计、
       「发送到手机」（手机上可直接长按/分享，无需扫码） */
    .topnav,
    .features,
    #products,
    .card-pc,
    .foot-thanks,
    .foot-links,
    .foot-analytics,
    .send-phone { display: none; }

    /* 页脚两栏改为紧凑单栏 */
    .foot-grid { gap: 22px; }
    .site-foot { padding-bottom: 28px; }

    /* 词条卡更省空间 */
    .comment-body { padding: 14px 14px 14px 12px; gap: 10px; }
    .avatar img { width: 38px; height: 38px; }
    .comment-text { min-width: 0; }

    /* 搜索舱贴边留白更小，结果区左右留白收紧 */
    .container { padding-left: 16px; padding-right: 16px; }
    html.searching .results { max-width: 100%; }
}

/* 触屏：去掉点击高亮闪烁 */
@media (hover: none) {
    body { -webkit-tap-highlight-color: transparent; }
}
