:root {
    --tg-blue: #3390ec;
    --tg-blue-hover: #2b7ed8;
    --tg-blue-dark: #1a6fc4;
    --tg-bg: #f0f2f5;
    --tg-card: #ffffff;
    --tg-text: #1a1a1a;
    --tg-text-secondary: #707579;
    --tg-text-tertiary: #8d9399;
    --tg-border: #e2e4e7;
    --tg-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --tg-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --tg-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
    --tg-radius-sm: 10px;
    --tg-radius: 14px;
    --tg-radius-lg: 18px;
    --tg-radius-xl: 24px;
    --glass-bg: rgba(255, 255, 255, 0.82);
    --glass-border: rgba(255, 255, 255, 0.9);
    --glass-blur: blur(18px);
    --header-height: 52px;
    --content-width: 420px;
    --font-system: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-system);
    color: var(--tg-text);
    overflow-x: hidden;
    background: linear-gradient(160deg, #eaf1f9 0%, #dce6f2 30%, #e8eef6 60%, #f2f5fa 100%);
    background-attachment: fixed;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    padding-top: var(--header-height);
    padding-bottom: 0;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(ellipse at 20% 10%, rgba(51, 144, 236, 0.06) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 20%, rgba(123, 47, 247, 0.05) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 70%, rgba(26, 111, 196, 0.04) 0%, transparent 50%);
}

body.no-scroll {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input {
    font: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: transparent;
}

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

/* ==================== 顶部导航栏 ==================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--header-height);
    background: linear-gradient(135deg, #3390ec 0%, #2b7ed8 40%, #1a6fc4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    box-shadow: 0 2px 16px rgba(26, 111, 196, 0.25), 0 1px 3px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header-inner {
    width: 100%;
    max-width: var(--content-width);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
}

.header-logo-area {
    display: flex;
    align-items: center;
    flex-shrink: 1;
    min-width: 0;
    gap: 6px;
}

.header-logo-link {
    display: flex;
    align-items: center;
}

.header-logo-img {
    height: 38px !important;
    max-height: 38px !important;
    width: auto !important;
    max-width: 140px !important;
    object-fit: contain !important;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.15);
    padding: 3px 8px;
}

.header-logo-fallback {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    font-size: 18px;
    color: #fff;
    letter-spacing: -0.4px;
    white-space: nowrap;
}

.header-logo-fallback svg {
    width: 22px;
    height: 22px;
    stroke: #fff;
    flex-shrink: 0;
}

/* ===== 七彩渐变动画分享按钮 ===== */
.header-share-btn {
    position: relative;
    max-width: min(58vw, 230px);
    padding: 7px 15px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    flex-shrink: 0;
    border: none;
    outline: none;
    background: linear-gradient(90deg, #ff0000, #ff7700, #ffdd00, #00ff00, #0088ff, #8b00ff, #ff0000);
    background-size: 400% 100%;
    animation: rainbowMove 4s linear infinite;
    box-shadow: 0 2px 14px rgba(255, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.2);
    transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1.2), box-shadow 0.2s ease;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

@keyframes rainbowMove {
    0% { background-position: 0% 50%; }
    100% { background-position: 400% 50%; }
}

.header-share-btn::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 42px;
    background: inherit;
    background-size: 400% 100%;
    animation: rainbowMove 4s linear infinite;
    z-index: -1;
    filter: blur(8px);
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.header-share-btn:active {
    transform: scale(0.94);
    box-shadow: 0 3px 18px rgba(255, 0, 0, 0.35), 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.header-share-btn:active::after {
    opacity: 0.8;
}

.header-share-btn svg {
    width: 17px;
    height: 17px;
    stroke: #fff;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.header-share-btn .btn-text {
    position: relative;
    z-index: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-share-btn .btn-emoji {
    position: relative;
    z-index: 1;
    font-size: 15px;
    line-height: 1;
}

/* ==================== 主体容器 ==================== */
.container {
    position: relative;
    z-index: 10;
    max-width: var(--content-width);
    width: 100%;
    margin: 0 auto;
    padding: 8px 8px 20px;
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

/* 标题区域 */
.title-section {
    text-align: center;
    margin: 14px 0 14px;
    padding: 0 4px;
}

.main-title {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.8px;
    margin-bottom: 6px;
    line-height: 1.18;
    display: block;
    background: linear-gradient(90deg, #3390ec, #7b2ff7, #1a6fc4, #6a1b9a, #4a90e2, #8e44ad, #1e88e5);
    background-size: 400% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientFlow 5s linear infinite;
    word-break: break-word;
}

@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.main-title .char {
    display: inline-block;
}

.sub-title {
    font-size: 13px;
    font-weight: 700;
    color: #3390ec;
    letter-spacing: 1.5px;
    display: inline-block;
    padding: 5px 18px;
    background: rgba(51, 144, 236, 0.08);
    border-radius: 40px;
    border: 1px solid rgba(51, 144, 236, 0.2);
    word-break: break-word;
    max-width: 100%;
}

/* ==================== 轮播图 ==================== */
.slider-box {
    margin: 8px 0 14px;
    border-radius: var(--tg-radius-lg);
    background: #ffffff;
    box-shadow: 0 4px 18px rgba(42, 74, 107, 0.08);
    border: 1px solid var(--tg-border);
    overflow: hidden;
}

.slider {
    overflow: hidden;
    background: #e8ecf0;
}

.slides-scroll {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    cursor: grab;
    scroll-behavior: smooth;
}

.slides-scroll::-webkit-scrollbar {
    display: none;
}

.slide-item {
    flex: 0 0 100%;
    scroll-snap-align: start;
    display: block;
    text-decoration: none;
    height: clamp(210px, 56vw, 260px);
    position: relative;
}

.slide-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #dce3ea;
}

.slide-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(135deg, #3390ec, #1a6fc4);
}

.dots-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    padding: 10px 0 11px;
    background: #ffffff;
    border-top: 1px solid #f0f3f7;
}

.dot {
    width: 7px;
    height: 7px;
    background: #cdd4db;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1.2);
    cursor: pointer;
    border: none;
    padding: 0;
}

.dot.active {
    width: 24px;
    background: var(--tg-blue);
    box-shadow: 0 0 0 3px rgba(51, 144, 236, 0.22);
}

/* ==================== 分类导航栏（纯页面内切换） ==================== */
.category-tabs-wrapper {
    position: sticky;
    top: calc(var(--header-height) + 2px);
    z-index: 50;
    margin: 6px 0 10px;
    padding: 6px 0;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--tg-radius-lg);
    border: 1px solid var(--glass-border);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.category-tabs {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 3px 8px;
    scroll-behavior: smooth;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.cat-tab {
    flex-shrink: 0;
    padding: 9px 17px;
    border-radius: 40px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    letter-spacing: -0.1px;
    background: transparent;
    color: var(--tg-text-secondary);
    border: 1.5px solid transparent;
    transition: background 0.2s cubic-bezier(0.25, 0.8, 0.25, 1.1), color 0.2s ease, box-shadow 0.2s ease;
}

.cat-tab:hover {
    color: #1a1a1a;
    background: rgba(51, 144, 236, 0.05);
}

.cat-tab:active {
    background: rgba(51, 144, 236, 0.08);
}

.cat-tab.active {
    background: var(--tg-blue);
    color: #fff;
    border-color: var(--tg-blue);
    box-shadow: 0 4px 14px rgba(51, 144, 236, 0.3);
    font-weight: 700;
}

.cat-tab.active:active {
    background: #2b7ed8;
}

/* ==================== 站点卡片区域（4列紧凑卡片网格） ==================== */
.category-grids-container {
    position: relative;
    min-height: 80px;
}

.cat-grid {
    display: none;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
    padding: 2px 0;
}

.cat-grid.active {
    display: grid;
    animation: fadeSlideIn 0.28s ease-out;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    background: var(--tg-card);
    border-radius: var(--tg-radius);
    padding: 10px 5px 10px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: var(--tg-shadow-sm);
    border: 1px solid var(--tg-border);
    transition: all 0.18s cubic-bezier(0.25, 0.8, 0.25, 1.1);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.card:active {
    transform: scale(0.96);
    box-shadow: var(--tg-shadow);
    border-color: #cdd4db;
    background: #fafbfc;
}

.card .logo {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    margin-bottom: 4px;
    object-fit: contain;
    background: #f8f9fb;
    padding: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid #eef0f4;
}

.card .name {
    font-size: 13.5px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2px;
    line-height: 1.3;
    text-align: center;
    word-break: keep-all;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    letter-spacing: -0.1px;
}

.card .promo {
    font-size: 11.5px;
    color: #e04a2d;
    font-weight: 600;
    margin-bottom: 7px;
    padding: 0 2px;
    text-align: center;
    line-height: 1.3;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    letter-spacing: -0.1px;
}

.card .btn {
    width: 100%;
    background: var(--tg-blue);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 0;
    border-radius: 40px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(51, 144, 236, 0.22);
    border: none;
    letter-spacing: 0.1px;
    margin-top: auto;
    transition: all 0.15s ease;
}

.card:active .btn {
    background: var(--tg-blue-hover);
    box-shadow: 0 3px 10px rgba(51, 144, 236, 0.3);
}

.empty-grid {
    text-align: center;
    padding: 36px 16px;
    color: #8d9399;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 14px;
    border: 1px dashed #cbd8e9;
}

/* ==================== 常用工具区域 ==================== */
.section-label {
    text-align: center;
    font-size: 16px;
    font-weight: 800;
    color: #1a1a1a;
    margin: 24px 0 14px;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 5px 0;
    text-transform: uppercase;
}

.section-label::before,
.section-label::after {
    content: "";
    height: 1.5px;
    width: 24px;
    background: #dce3ea;
    border-radius: 2px;
}

.tools-section {
    margin-top: 15px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 25px 0 13px;
    font-size: 15px;
    font-weight: 750;
    letter-spacing: 1px;
    color: var(--tg-text, #1a1a1a);
}

.section-heading::before,
.section-heading::after {
    content: "";
    width: 22px;
    height: 1px;
    background: #bfcfe1;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.tool-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 9px;
    border: 1px solid var(--tg-border, #e2e4e7);
    border-radius: 15px;
    background: linear-gradient(135deg, #fff, #f8fafd);
    box-shadow: 0 2px 8px rgba(42, 74, 107, 0.04);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.tool-card:hover {
    border-color: #a8cdf4;
}

.tool-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    object-fit: contain;
    border-radius: 10px;
    background: #eff4fc;
}

.tool-info {
    min-width: 0;
    flex: 1;
}

.tool-info strong {
    display: block;
    font-size: 12px;
    line-height: 1.4;
    overflow-wrap: anywhere;
    color: #1a1a1a;
    font-weight: 600;
}

.tool-info > span {
    display: -webkit-box;
    margin-top: 3px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    font-size: 10px;
    color: var(--tg-text-secondary, #707579);
    overflow-wrap: anywhere;
}

.tool-arrow {
    width: 13px;
    height: 13px;
    color: #97adc6;
    flex-shrink: 0;
}

/* ==================== 友情链接 ==================== */
.friend-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.friend-links a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #dfebf8;
    border-radius: 20px;
    color: #436d99;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.18s;
}

.friend-links a:hover {
    color: var(--tg-blue);
    border-color: var(--tg-blue);
    background: #fff;
}

/* ==================== 页脚（置于最底部） ==================== */
footer, .site-footer {
    width: 100%;
    max-width: var(--content-width);
    margin: auto auto 0;
    text-align: center;
    padding: 24px 12px calc(24px + env(safe-area-inset-bottom, 0px));
    font-size: 12px;
    color: var(--tg-text-tertiary);
    letter-spacing: 0.4px;
    font-weight: 500;
    border-top: 1px solid var(--tg-border);
    line-height: 1.8;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
}

.footer-domain {
    font-size: 13px;
    font-weight: 700;
    color: #2b5682;
    margin-bottom: 4px;
}

.footer-desc {
    color: var(--tg-text-secondary);
    font-size: 12px;
}

.footer-copy {
    color: var(--tg-text-tertiary);
    font-size: 11px;
}

.footer-icp {
    color: var(--tg-text-tertiary);
    font-size: 11px;
}

/* ==================== 在线客服浮动按钮 ==================== */
.floating-service-btn {
    position: fixed;
    right: 14px;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
    transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1.2), opacity 0.28s ease;
}

.floating-service-btn:active {
    transform: scale(0.9);
}

.floating-service-btn.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

.service-icon-circle {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(145deg, #3390ec 0%, #1a6fc4 100%);
    box-shadow: 0 6px 22px rgba(51, 144, 236, 0.4), 0 2px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1.2);
    animation: servicePulse 2.8s ease-in-out infinite;
    position: relative;
}

@keyframes servicePulse {
    0%, 100% {
        box-shadow: 0 6px 22px rgba(51, 144, 236, 0.4), 0 2px 6px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 8px 30px rgba(51, 144, 236, 0.55), 0 4px 12px rgba(0, 0, 0, 0.14), 0 0 0 10px rgba(51, 144, 236, 0.08);
    }
}

.service-icon-circle svg {
    width: 28px;
    height: 28px;
    pointer-events: none;
    flex-shrink: 0;
}

.service-label {
    font-size: 10.5px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 2px 9px;
    border-radius: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    white-space: nowrap;
    pointer-events: none;
}

.service-badge {
    position: absolute;
    top: -2px;
    right: 0;
    background: #ff3b30;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 12px;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(255, 59, 48, 0.4);
}

/* 客服面板抽屉 */
.service-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.32s cubic-bezier(0.22, 0.9, 0.3, 1), visibility 0s 0.32s;
}

.service-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.32s cubic-bezier(0.22, 0.9, 0.3, 1), visibility 0s 0s;
}

.service-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    background: #fff;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.18);
    padding: 0 16px 24px;
    transform: translateY(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.38s cubic-bezier(0.22, 0.9, 0.3, 1), visibility 0s 0.38s;
    display: flex;
    flex-direction: column;
    max-height: 65vh;
}

.service-panel.active {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.38s cubic-bezier(0.22, 0.9, 0.3, 1), visibility 0s 0s;
}

.service-panel-close {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f2f3f5;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.service-panel-close:active {
    background: #e2e4e7;
    transform: scale(0.9);
}

.service-panel-close svg {
    width: 16px;
    height: 16px;
    stroke: #5a5d62;
}

.service-panel-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 30px 10px;
    flex-shrink: 0;
    border-bottom: 1px solid #edf1f6;
}

.service-panel-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.service-panel-title svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.service-panel-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    padding: 10px 0 0;
}

.service-contact-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 4px;
    gap: 10px;
}

.service-contact-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.service-contact-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    object-fit: contain;
    background: #f2f5f9;
    padding: 3px;
    flex-shrink: 0;
}

.service-contact-name {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.service-contact-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--tg-blue);
    cursor: pointer;
    display: inline-block;
    word-break: break-all;
}

.service-contact-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.service-copy-btn {
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #436d99;
    background: #f0f4fa;
    border: 1px solid #dce5f0;
    cursor: pointer;
    transition: all 0.15s;
}

.service-copy-btn:active {
    background: #e2ebf6;
    transform: scale(0.96);
}

.service-contact-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--tg-blue);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 13px;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(51, 144, 236, 0.25);
    cursor: pointer;
    transition: all 0.15s;
}

.service-contact-link-btn:active {
    background: var(--tg-blue-hover);
    transform: scale(0.96);
}

.service-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    margin: 0 4px;
}

.service-panel-empty {
    text-align: center;
    padding: 30px 16px;
    color: #8d9399;
    font-size: 14px;
}

/* ==================== 原生分享模态框（本站专属） ==================== */
.share-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.32s cubic-bezier(0.22, 0.9, 0.3, 1), visibility 0s 0.32s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
}

.share-modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.32s cubic-bezier(0.22, 0.9, 0.3, 1), visibility 0s 0s;
}

.share-modal-box {
    width: 100%;
    max-width: 420px;
    max-height: 88vh;
    background: #ffffff;
    border-radius: var(--tg-radius-xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.92) translateY(18px);
    transition: transform 0.35s cubic-bezier(0.22, 0.9, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.share-modal-overlay.active .share-modal-box {
    transform: scale(1) translateY(0);
}

.lottery-frame-box {
    height: min(88vh, 760px);
}

.lottery-frame {
    display: block;
    width: 100%;
    min-height: 0;
    flex: 1;
    border: 0;
    background: #d5eafa;
}

.share-modal-header {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f8faff 0%, #eef3fc 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    gap: 10px;
    min-height: 52px;
}

.share-modal-back {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(51, 144, 236, 0.08);
    border: none;
    padding: 6px 14px 6px 10px;
    border-radius: 40px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--tg-blue);
    cursor: pointer;
    transition: all 0.18s;
    flex-shrink: 0;
}

.share-modal-back:active {
    background: rgba(51, 144, 236, 0.18);
    transform: scale(0.94);
}

.share-modal-back svg {
    width: 17px;
    height: 17px;
    stroke: var(--tg-blue);
}

.share-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.2px;
    flex: 1;
    text-align: center;
    margin-right: 50px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.share-modal-title .highlight {
    background: linear-gradient(90deg, #ff6b6b, #ffa94d, #ffd93d, #6bcb77, #4d96ff, #9b59b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

.share-modal-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* 分享站品牌卡片 */
.share-site-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #f2f7ff 0%, #eaf2fc 100%);
    border-radius: 16px;
    border: 1px solid #dbe6f5;
}

.share-site-logo {
    width: 50px;
    height: 50px;
    border-radius: 13px;
    background: #fff;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.share-site-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.share-site-logo-icon {
    font-size: 26px;
}

.share-site-info {
    min-width: 0;
    flex: 1;
}

.share-site-name {
    font-size: 15px;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.share-site-domain {
    font-size: 12px;
    color: var(--tg-blue);
    margin-bottom: 2px;
}

.share-site-desc {
    font-size: 11px;
    color: var(--tg-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 链接输入框及复制按钮 */
.share-url-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.share-url-label {
    font-size: 12.5px;
    font-weight: 700;
    color: #3b424c;
}

.share-url-input-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
}

.share-url-input {
    flex: 1;
    min-width: 0;
    background: #f7f9fc;
    border: 1.5px solid #e1e6ee;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
    color: #1a1a1a;
    font-weight: 600;
    outline: none;
}

.share-url-input:focus {
    border-color: var(--tg-blue);
    background: #fff;
}

.share-copy-btn {
    flex-shrink: 0;
    background: var(--tg-blue);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    padding: 10px 18px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(51, 144, 236, 0.3);
    transition: all 0.15s;
    white-space: nowrap;
}

.share-copy-btn:active {
    background: var(--tg-blue-hover);
    transform: scale(0.96);
}

/* 社交平台渠道按钮 */
.share-channels-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #3b424c;
    margin-top: 2px;
}

.share-channels-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.share-channel-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    background: #f5f8fc;
    border: 1px solid #e2eaf4;
    color: #26384d;
    cursor: pointer;
    transition: all 0.15s;
}

.share-channel-btn:active {
    background: #e9f1fb;
    transform: scale(0.96);
}

.share-channel-icon {
    font-size: 18px;
}

/* 规则卡片 */
.share-rules-card {
    background: #fafbfe;
    border: 1px solid #e7edf7;
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-rules-title {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
}

.share-rules-list {
    margin: 0;
    padding-left: 18px;
    font-size: 12px;
    color: #5d6778;
    line-height: 1.6;
}

.share-rules-list li {
    margin-bottom: 4px;
}

.share-service-jump-btn {
    width: 100%;
    margin-top: 4px;
    padding: 10px 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #ff9500 0%, #ff5e3a 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 3px 12px rgba(255, 94, 58, 0.3);
    transition: all 0.18s;
}

.share-service-jump-btn:active {
    transform: scale(0.97);
    filter: brightness(0.95);
}

/* ==================== 系统公告弹窗 ==================== */
.popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.22, 0.9, 0.3, 1), visibility 0s 0.3s;
    padding: 16px;
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.3s cubic-bezier(0.22, 0.9, 0.3, 1), visibility 0s 0s;
}

.popup-modal {
    width: 100%;
    max-width: 360px;
    background: #ffffff;
    border-radius: var(--tg-radius-lg);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transform: scale(0.92);
    transition: transform 0.3s cubic-bezier(0.22, 0.9, 0.3, 1);
}

.popup-overlay.active .popup-modal {
    transform: scale(1);
}

.popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, #f8faff, #eef4fc);
    border-bottom: 1px solid #edf1f6;
}

.popup-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
}

.popup-close {
    font-size: 22px;
    color: #7b838f;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
}

.popup-body {
    padding: 18px 20px;
}

.popup-content {
    font-size: 13.5px;
    line-height: 1.6;
    color: #3b424c;
}

.popup-domain {
    font-size: 14px;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.popup-domain strong {
    color: var(--tg-blue);
}

.popup-desc {
    color: #616b79;
    margin-bottom: 10px;
}

.popup-tip {
    font-size: 12px;
    color: #ff9500;
    font-weight: 600;
}

.popup-footer {
    padding: 0 20px 18px;
}

.popup-btn {
    width: 100%;
    padding: 11px 0;
    border-radius: 12px;
    background: var(--tg-blue);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(51, 144, 236, 0.3);
    transition: all 0.15s;
}

.popup-btn:active {
    background: var(--tg-blue-hover);
    transform: scale(0.97);
}

/* ==================== Toast 提示 ==================== */
.toast-tip {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(-130px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.22, 0.9, 0.3, 1);
}

.toast-tip.show {
    transform: translateX(-50%) translateY(0);
}

.toast-content {
    background: rgba(30, 30, 32, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    color: #fff;
    font-weight: 500;
    font-size: 14.5px;
    padding: 10px 22px;
    border-radius: 50px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    letter-spacing: -0.1px;
}

.toast-content svg {
    width: 18px;
    height: 18px;
    stroke: #4cd964;
    flex-shrink: 0;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 380px) {
    .main-title {
        font-size: 28px;
    }
    .cat-tab {
        padding: 8px 13px;
        font-size: 13.5px;
    }
    .card {
        padding: 8px 3px 8px;
    }
    .card .logo {
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }
    .card .name {
        font-size: 12px;
    }
    .card .promo {
        font-size: 10.5px;
    }
    .card .btn {
        font-size: 10px;
        padding: 5px 0;
    }
    .header-logo-img {
        height: 36px;
        max-width: 130px;
    }
    .header-share-btn {
        padding: 6px 11px;
        font-size: 12px;
        gap: 4px;
    }
    .header-share-btn svg {
        width: 14px;
        height: 14px;
    }
    .header-share-btn .btn-emoji {
        font-size: 13px;
    }
}

@media (min-width: 421px) {
    .service-panel {
        left: 50%;
        right: auto;
        transform: translate(-50%, 100%);
        max-width: var(--content-width);
        width: calc(100% - 16px);
        border-radius: 22px;
        bottom: 16px;
        box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
    }
    .service-panel.active {
        transform: translate(-50%, 0);
    }
    .floating-service-btn {
        right: calc(50% - (var(--content-width) / 2) + 12px);
        bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    }
}

@media (min-width: 440px) {
    .floating-service-btn {
        right: calc(50% - 200px);
    }
}
