/* 基础变量和重置 */
:root {
    --primary-blue: #1a73e8;
    --primary-dark: #1557b0;
    --bg-gray: #f8f9fa;
    --text-main: #202124;
    --text-sub: #5f6368;
    --text-tip: #9aa0a6;
    --border-color: #e8eaed;
    --shadow: 0 1px 2px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.1);
    --card-bg: #ffffff;
    --success-green: #1e8e3e;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-gray);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* 容器和布局 */
.container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    box-shadow: 0 0 20px rgba(0,0,0,0.02);
    position: relative;
}

.main-content {
    padding: 20px 7px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 搜索模式相关样式 */
.container.search-mode {
    background: #fff;
    padding-top: 0;
}

.search-mode .notice-bar {
    margin-top: 0;
    position: relative;
    z-index: 10;
}

.search-mode .main-content {
    padding-top: 0;
    position: relative;
    z-index: 9;
}

.search-mode .header {
    margin-top: 0;
    padding-top: 10px;
    transition: all 0.3s ease;
}

.search-mode .visit-counter {
    margin-top: 0;
    transition: all 0.3s ease;
}

.search-mode .search-section {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 10px 0;
    margin-bottom: 10px;
}

.search-mode .action-buttons {
    margin-top: 0;
    position: relative;
    z-index: 8;
}

/* 通知栏 */
.notice-bar {
    background: #fffbe6;
    padding: 10px 15px;
    font-size: 12px;
    color: #d48806;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid #fff2cc;
    margin-top: 5px;
}

.notice-text {
    display: inline-block;
    animation: scrollNotice 150s linear infinite;
    padding-left: 100%;
}

@keyframes scrollNotice {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* 头部区域 */
.header {
    text-align: center;
    margin-bottom: 25px;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    letter-spacing: 0;
    margin-top: 36px;
    gap: 6px;
}

.logo-text {
    font-size: 30px;
    font-weight: 700;
    color: var(--primary-blue);
}


.logo-icon {
    height: 34px;
    width: auto;
}

.slogan {
    font-size: 13px;
    color: var(--text-sub);
    margin-top: 2px;
    text-align: center;
    font-weight: 400;
    opacity: 0.9;
    letter-spacing: 0.5px;
}

/* 访问量统计 */
.visit-counter {
    font-size: 14px;
    color: var(--text-tip);
    margin-bottom: 30px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.visit-number {
    font-weight: bold;
    color: var(--primary-blue);
    font-size: 24px;
    font-family: 'DIN Alternate', sans-serif;
}

/* 搜索区域 */
.search-section {
    width: 100%;
    margin-bottom: 20px;
}

.search-wrapper {
    display: flex;
    gap: 6px;
    width: 100%;
    position: relative;
}

.search-wrapper {
    display: flex;
    gap: 6px;
    width: 100%;
    position: relative;
    align-items: center;  /* 新增：垂直居中 */
}

.search-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    font-size: 15px;
    transition: all 0.2s;
    background: #f8f9fa;
    color: var(--text-main);
}
.search-input:focus {
    background: white;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
    outline: none;
}

.search-btn {
    width: 68px;
    height: 44px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.scan-btn {
    width: 44px;
    height: 44px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 22px;
    font-size: 19px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-sub);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.scan-btn:active {
    background: #f1f3f4;
}

.search-btn {
    width: 74px;
    height: 44px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 22px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(26, 115, 232, 0.2);
}

/* 扫码按钮 */
.scan-btn {
    width: 40px;
    height: 40px;
    background: #f5f7fa;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #666;
}
.scan-btn:active {
    background: #e8ecf0;
    transform: scale(0.95);
}

.search-btn:active {
    transform: scale(0.97);
    background: #096dd9;
}

/* 清空按钮 */
.clear-btn {
    position: absolute;
    right: 144px;  /* 调整位置 */
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: #ccc;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 18px;
    font-size: 16px;
    cursor: pointer;
    z-index: 10;
    display: none;
}

.clear-btn:hover {
    background: #999;
}

/* 快捷操作按钮 */
.action-buttons {
    width: 100%;
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}


.action-btn {
    flex: 1;
    height: 40px;
    border-radius: 20px;
    border: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow);
}

/* 优化三个按钮的视觉平衡 */
.action-btn-primary,
.action-btn-secondary,
.action-btn-qrcode {
    flex: 1; /* 保持等宽 */
    min-width: 0; /* 防止内容溢出 */
    white-space: nowrap; /* 防止文字换行 */
    font-size: 15px; /* 统一字体大小 */
    letter-spacing: 0.5px; /* 轻微字间距，提升可读性 */
}

/* 针对超小屏幕的优化 */
@media (max-width: 380px) {
    .action-buttons {
        gap: 8px; /* 减小间距 */
    }
    .action-btn {
        font-size: 14px; /* 稍微减小字体 */
        padding: 0 5px; /* 增加内边距，防止文字贴边 */
    }
    
    /* 优化按钮内图标和文字的对齐 */
    .action-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px; /* 图标和文字间距 */
    }
    
    /* 确保按钮内容不会溢出 */
    .action-btn span,
    .action-btn::before { /* 针对伪元素图标 */
        display: inline-block;
        vertical-align: middle;
    }
}

.action-btn-primary {
    background: var(--primary-blue);
    color: white;
}

.action-btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    font-weight: 500;
}

/* 名片按钮 - 与发布按钮同级，使用品牌蓝色 */
.action-btn-qrcode {
    background: var(--primary-blue);
    color: white;
    border: 1px solid var(--primary-blue);
    font-weight: 500;
}

.action-btn-primary {
    background: var(--primary-blue);
    color: white;
    font-weight: 500;
}

/* 为所有操作按钮增加悬停反馈，提升手感 */
.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.action-btn:active {
    transform: translateY(0px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* 页脚区域 */
.footer {
    padding: 16px 15px 24px;
    text-align: center;
    font-size: 11px;
    color: #999;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
    margin-top: auto;
}
.footer-links {
    margin-bottom: 8px;
}
.footer-links a {
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}
.footer-links a:active {
    color: var(--primary-dark);
}
.legal-notice {
    margin-bottom: 6px;
    color: #bbb;
}
.beian-info {
    font-size: 10px;
    color: #999;
    line-height: 1.6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}
.beian-info a {
    color: #999;
    text-decoration: none;
}
.beian-icon {
    width: 12px;
    height: 12px;
    margin-right: 3px;
    vertical-align: middle;
}
.footer-copy {
    margin-top: 6px;
    font-size: 10px;
    color: #ccc;
}

.legal-notice {
    margin-bottom: 4px;
}

.legal-notice a {
    color: #d90505;
    text-decoration: none;
    margin-right: 4px;
}

.beian-info {
    font-size: 12px;
    color: #666;
    line-height: 1.3;
}

.beian-icon {
    width: 12px;
    height: 12px;
    margin-right: 3px;
    vertical-align: middle;
}

/* 搜索结果清空按钮样式 */
.search-results-clear {
    color: #1890ff;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border: 1px solid #1890ff;
    border-radius: 4px;
    transition: all 0.2s;
}

.search-results-clear:hover {
    background: #e6f7ff;
    border-color: #096dd9;
    color: #096dd9;
}

/* 搜索模式下的样式 */
.search-mode .container {
    background: #fff;
    overflow-y: auto;
}

.search-mode .main-content {
    padding-top: 0;
    padding-bottom: 0;
}

/* 新增：标语样式 */
.slogan {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
    text-align: center;
    font-weight: 400;
    opacity: 0.8;
}

/* ========== 国际水准二维码弹窗样式 ========== */
/* 修复layui弹窗的默认样式 */
.layui-layer {
    width: auto !important;
    min-width: auto !important;
}
.layui-layer-content {
    padding: 0 !important;
    line-height: 1 !important;
}

/* === 完美居中卡片样式 === */
.qr-popup-international {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 320px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 20px;
    box-sizing: border-box;
    z-index: 999999;
    text-align: center;
}

@keyframes qrPopupAppear {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.qr-popup-close {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 28px;
    height: 28px;
    line-height: 28px;
    border-radius: 50%;
    background: #f8f9fa;
    color: #666;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.qr-popup-close:hover {
    background: #e8f4ff;
    color: #1890ff;
    transform: rotate(90deg);
}

.qr-popup-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 15px 0;
    text-align: center !important;
}

.qr-popup-subtitle {
    font-size: 13px;
    color: #d90505;
    margin-bottom: 15px;
    line-height: 1.4;
}

.qr-image-container {
    margin: 0 auto 20px;
    padding: 10px; /* 减小padding */
    background: #fafafa;
    border-radius: 12px;
    display: block; /* 改为block，避免inline-block的空隙 */
    border: 1px solid #f0f0f0;
    width: 200px; /* 固定宽度 */
    height: 200px; /* 固定高度 */
    box-sizing: border-box;
}
.qr-image-container img {
    display: block;
    width: 100%; /* 改为100%填充容器 */
    height: 100%; /* 改为100%填充容器 */
    object-fit: contain; /* 保持比例 */
}

.qr-popup-tip {
    font-size: 12px;
    color: #888;
    margin-bottom: 24px;
}

.qr-popup-actions {
    display: flex;
    gap: 12px; /* 控制两个按钮之间的间距 */
}

.qr-btn {
    flex: 1;
    padding: 13px 0;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}
.qr-btn-primary {
    background: linear-gradient(135deg, #1890ff, #096dd9);
    color: white;
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
}
.qr-btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(24, 144, 255, 0.4);
}
.qr-btn-secondary {
    background-color: #ffffff;
    color: #1890ff;
    border: 1.5px solid #1890ff;
}
.qr-btn-secondary:active {
    background-color: #f0f8ff;
    transform: translateY(1px);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    letter-spacing: 1px;
    margin-top: 40px;
    gap: 8px;
}

.logo-icon {
    height: 40px;
    width: auto;
}

.logo-text {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary-blue);
}

/* ========== 专业级扫码弹窗样式（layui版本） ========== */
/* 修复layui弹窗的基础问题 */
.layui-layer.layui-layer-dialog {
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    border-radius: 24px !important;
    overflow: hidden !important;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    background: white !important;
    animation: popupScaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

@keyframes popupScaleIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 解决弹窗高度问题 - 去除固定460px高度 */
.layui-layer.layui-layer-dialog[style*="460px"] {
    height: auto !important;
    min-height: auto !important;
    max-height: 90vh !important;
}

/* 弹窗标题美化 */
.layui-layer.layui-layer-dialog .layui-layer-title {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
    color: #1e293b !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    text-align: center !important;
    padding: 20px 50px 15px 20px !important;
    height: auto !important;
    line-height: 1.4 !important;
    border-radius: 24px 24px 0 0 !important;
}

/* 关闭按钮美化 */
.layui-layer.layui-layer-dialog .layui-layer-setwin {
    top: 16px !important;
    right: 16px !important;
    width: auto !important;
    height: auto !important;
}

.layui-layer.layui-layer-dialog .layui-layer-setwin .layui-layer-close {
    width: 40px !important;
    height: 40px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    color: #475569 !important;
    font-size: 24px !important;
    line-height: 40px !important;
    border-radius: 50% !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    right: 0 !important;
    top: 0 !important;
}

.layui-layer.layui-layer-dialog .layui-layer-setwin .layui-layer-close:hover {
    background: white !important;
    color: #1e293b !important;
    transform: rotate(90deg) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2) !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
}

/* 弹窗内容区域 - 关键修复 */
.layui-layer.layui-layer-dialog .layui-layer-content {
    padding: 0 !important;
    background: white !important;
    border-radius: 0 0 24px 24px !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
}

/* 二维码扫描器容器 - 自适应高度 */
#qr-reader {
    width: 100% !important;
    max-width: 320px !important;
    margin: 0 auto !important;
    padding: 0 20px 20px 20px !important;
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background: #000 !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    min-height: 320px !important;
    max-height: 50vh !important;
}

/* html5-qrcode生成的容器 */
#qr-reader > div:first-child {
    position: relative !important;
    width: 100% !important;
    height: 320px !important;
    min-height: 320px !important;
    max-height: 50vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}

/* 视频流 - 保持比例 */
#qr-reader video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 16px !important;
}

/* 扫描框装饰 */
#qr-reader::before {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 250px !important;
    height: 250px !important;
    border: 2px solid rgba(24, 144, 255, 0.8) !important;
    border-radius: 20px !important;
    box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.7) !important;
    pointer-events: none !important;
    z-index: 2 !important;
}

/* 扫描线动画 */
#qr-reader::after {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 250px !important;
    height: 3px !important;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(24, 144, 255, 0.9) 50%, 
        transparent 100%) !important;
    animation: scanLineMove 2s ease-in-out infinite !important;
    border-radius: 1.5px !important;
    box-shadow: 0 0 8px rgba(24, 144, 255, 0.5) !important;
    z-index: 3 !important;
}

@keyframes scanLineMove {
    0% { 
        top: 50% !important;
        opacity: 0.8 !important;
    }
    50% { 
        top: calc(50% + 247px) !important;
        opacity: 1 !important;
    }
    100% { 
        top: 50% !important;
        opacity: 0.8 !important;
    }
}

/* 提示文字 */
.scan-tip {
    text-align: center !important;
    padding: 15px 20px 20px 20px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    background: white !important;
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.scan-tip-text {
    font-size: 15px !important;
    color: #334155 !important;
    font-weight: 500 !important;
    margin-bottom: 6px !important;
    line-height: 1.4 !important;
}

.scan-tip-sub {
    font-size: 12px !important;
    color: #64748b !important;
    line-height: 1.3 !important;
}