/* ==========================================================================
   yfamily design system
   Neutral, quiet, refined. One ink colour, hairline borders, soft depth.
   ========================================================================== */

:root {
    color-scheme: light dark;

    /* Palette — text >= 4.5:1, form-field edges >= 3:1 (WCAG 2.2 AA).
       Card edges stay hairline: they are decoration, the label identifies the control. */
    --page: #f7f7f5;
    --surface: #ffffff;
    --surface-soft: #f2f2ef;
    --surface-hover: #fcfcfb;
    --surface-active: #eeeeeb;
    --text: #18181b;            /* 16.5:1 */
    --text-soft: #3f3f46;       /*  9.7:1 */
    --muted: #62626a;           /*  5.6:1 */
    --subtle: #8a8a91;          /*  3.4:1 – chevrons, dots */
    --accent: #18181b;
    --accent-hover: #3f3f46;
    --accent-soft: #f2f2ef;
    --on-accent: #ffffff;
    --signal: #c2410c;
    --ok: #15803d;
    --live: #16a34a;            /*  3.3:1 – status dot */
    --border: rgb(24 24 27 / 8%);
    --border-strong: rgb(24 24 27 / 16%);
    --border-input: #8a8a90;    /*  3.4:1 – form fields */
    --focus: #18181b;
    --ring: 0 0 0 4px rgb(24 24 27 / 7%);
    --glass: rgb(247 247 245 / 84%);
    --highlight: 0 0 #0000;

    /* Depth */
    --shadow-sm: 0 1px 2px rgb(24 24 27 / 4%);
    --shadow-md: 0 1px 2px rgb(24 24 27 / 4%), 0 10px 24px -12px rgb(24 24 27 / 14%);
    --shadow-popover: 0 1px 2px rgb(24 24 27 / 6%), 0 18px 40px -12px rgb(24 24 27 / 22%);

    /* Shape & rhythm */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --content: 1080px;
    --prose: 720px;
    --ease: cubic-bezier(.2, .7, .2, 1);

    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    --font-mono: ui-monospace, "SF Mono", "SFMono-Regular", "JetBrains Mono", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Cards sit clearly above the page; edges and hover are visible, still quiet */
        --page: #08080a;
        --surface: #19191c;         /* 1.14:1 vs page */
        --surface-soft: #202024;
        --surface-hover: #222226;
        --surface-active: #2b2b30;
        --text: #f4f4f5;            /* 16.1:1 on card */
        --text-soft: #d4d4d8;       /* 12.0:1 */
        --muted: #a1a1aa;           /*  6.8:1 */
        --subtle: #7c7c85;          /*  4.2:1 */
        --accent: #f4f4f5;
        --accent-hover: #ffffff;
        --accent-soft: #202024;
        --on-accent: #08080a;
        --signal: #fb923c;
        --ok: #4ade80;
        --live: #4ade80;
        --border: #3a3a41;          /*  1.55:1 vs card, 1.77:1 vs page */
        --border-strong: #56565f;   /*  2.4:1 – hover */
        --border-input: #71717a;    /*  3.6:1 – form fields */
        --focus: #f4f4f5;
        --ring: 0 0 0 4px rgb(255 255 255 / 10%);
        --glass: rgb(8 8 10 / 84%);
        --highlight: inset 0 1px 0 rgb(255 255 255 / 5%);
        --shadow-sm: inset 0 1px 0 rgb(255 255 255 / 5%), 0 1px 2px rgb(0 0 0 / 50%);
        --shadow-md: inset 0 1px 0 rgb(255 255 255 / 7%), 0 1px 2px rgb(0 0 0 / 50%), 0 16px 32px -14px rgb(0 0 0 / 80%);
        --shadow-popover: inset 0 1px 0 rgb(255 255 255 / 7%), 0 1px 2px rgb(0 0 0 / 60%), 0 24px 48px -12px rgb(0 0 0 / 85%);
    }
}

/* Users who ask for more contrast get crisper lines and darker secondary text */
@media (prefers-contrast: more) {
    :root {
        --muted: var(--text-soft);
        --subtle: var(--muted);
        --border: var(--border-input);
        --border-strong: var(--text-soft);
    }
}

/* Base ---------------------------------------------------------------- */

html {
    background: var(--page);
    color: var(--text);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: 88px;
}

body {
    box-sizing: border-box;
    width: 100%;
    max-width: var(--content);
    margin: 0 auto;
    padding: 40px 32px 56px;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6, p {
    margin-top: 0;
}

h1, h2, h3, h4, h5 {
    color: var(--text);
    font-weight: 600;
    line-height: 1.35;
}

h1 {
    margin-bottom: 12px;
    font-size: clamp(26px, 3.6vw, 32px);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

h1, h2, h3 {
    text-wrap: balance;
}

p, li {
    text-wrap: pretty;
}

h2 {
    margin-bottom: 16px;
    font-size: 22px;
    letter-spacing: -0.02em;
}

h3 {
    margin-bottom: 12px;
    font-size: 18px;
    letter-spacing: -0.015em;
}

h4, h5 {
    margin-bottom: 8px;
    font-size: 16px;
}

p {
    margin-bottom: 16px;
}

a {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: var(--border-strong);
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    transition: color 160ms var(--ease), text-decoration-color 160ms var(--ease);
}

a:hover {
    color: var(--text);
    text-decoration-color: currentColor;
}

button, input, select, textarea {
    box-sizing: border-box;
    font: inherit;
    color: inherit;
}

button, input[type="button"], select {
    cursor: pointer;
}

button, input, select, textarea, a {
    -webkit-tap-highlight-color: transparent;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

::selection {
    background: var(--text);
    color: var(--page);
}

img {
    max-width: 100%;
}

hr {
    border: 0;
}

/* Legacy <br> spacers: spacing now comes from the type scale */
:where(body, main) > br,
.content-container > br {
    display: none;
}

/* Ads: breathe only when something is actually rendered */
ins.adsbygoogle[data-ad-status="filled"] {
    margin-block: 24px;
}

/* Breadcrumb ---------------------------------------------------------- */

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 0;
    margin: 0 0 36px;
    list-style: none;
    font-size: 13px;
    line-height: 1.5;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    min-width: 0;
}

.breadcrumb a {
    display: inline-block;
    padding: 6px 0;
    color: var(--muted);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--text);
}

.breadcrumb li:not(:last-child)::after {
    content: "";
    width: 5px;
    height: 5px;
    margin: 0 12px;
    border-top: 1px solid var(--subtle);
    border-right: 1px solid var(--subtle);
    transform: rotate(45deg);
}

.breadcrumb li:last-child a,
.breadcrumb a[aria-current="page"] {
    color: var(--text);
    font-weight: 500;
}

/* Page header --------------------------------------------------------- */

.page-header {
    margin-bottom: 28px;
}

.page-header > :last-child {
    margin-bottom: 0;
}

.page-header h1 img,
:where(body, main) > h1 img {
    flex: 0 0 auto;
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    object-fit: contain;
}

/* Any page title that carries an icon lays out the same way */
.page-header h1:has(> img) {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Line icons (SVG) sit on the same soft tile as the home cards */
.page-header h1 img[src$=".svg"],
:where(body, main) > h1 img[src$=".svg"] {
    padding: 9px;
    background: var(--surface-soft);
}

/* Official App Store icons fill their tile: no inner padding, iOS-like corners */
.page-header h1 img[src*="/IMG/app-"],
:where(body, main) > h1 img[src*="/IMG/app-"] {
    padding: 0;
    border-radius: 10px;
    object-fit: cover;
}

.page-description {
    max-width: var(--prose);
    color: var(--muted);
    font-size: 15px;
    line-height: 1.75;
}

/* Section label: quiet, small, with a hairline -------------------------- */

.section-title {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 48px 0 18px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.06em;
    line-height: 1.5;
}

.section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.site-divider {
    height: 1px;
    margin: 28px 0;
    border: 0;
    background: var(--border);
}

/* "机场推荐" bell: replace the endless shake with a calm status dot */
span[style*="bellShake"] {
    flex: 0 0 auto;
    animation: none !important;
    width: 6px;
    height: 6px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--live);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 20%, transparent);
    font-size: 0;
    line-height: 0;
    vertical-align: middle;
}

/* Pill links (机场推荐, 代理规则 …) — one component, fixed height, top-aligned.
   font-size: 0 on the row swallows the &nbsp; spacers between pills. */
.page-intro:has(a),
.home-notice,
.page-header .page-description:has(> a:only-child) {
    font-size: 0;
    line-height: 0;
}

:is(.page-intro, .home-notice) a,
.page-header .page-description > a:only-child {
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    height: 30px;
    margin: 0 8px 8px 0;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 450;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: top;
    transition: border-color 160ms var(--ease), background-color 160ms var(--ease), color 160ms var(--ease);
}

:is(.page-intro, .home-notice) a:hover,
.page-header .page-description > a:only-child:hover {
    border-color: var(--border-strong);
    background: var(--surface-hover);
    color: var(--text);
}

/* Footer -------------------------------------------------------------- */

.site-contact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 64px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
}

.site-contact > a,
.site-contact > button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    box-shadow: var(--highlight);
    cursor: pointer;
    transition: border-color 160ms var(--ease), background-color 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease);
}

.site-contact > a:hover,
.site-contact > button:hover {
    border-color: var(--border-strong);
    background: var(--surface-hover);
    transform: translateY(-1px);
}

.site-contact > a,
.site-contact > button {
    color: var(--muted);
}

.site-contact > a:hover,
.site-contact > button:hover {
    color: var(--text);
}

.contact-icon {
    display: block;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    transition: color 160ms var(--ease);
}

/* Responsive ---------------------------------------------------------- */

@media (max-width: 600px) {
    body {
        padding: 24px 18px 40px;
    }

    .breadcrumb {
        margin-bottom: 24px;
    }

    .breadcrumb li:not(:last-child)::after {
        margin-inline: 10px;
    }

    .section-title {
        margin-top: 40px;
    }
}

/* Windows high-contrast / forced colours: keep every surface outlined */
@media (forced-colors: active) {
    .myButton,
    .app-card,
    .search-bar input,
    .site-contact > a,
    .site-contact > button {
        border: 1px solid CanvasText;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
