/* 轻奢黑金色风格 CSS */
/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 移动端性能优化 */
@media (max-width: 768px) {
    * {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    .card {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #2a2a2a 100%);
    color: #d4af37;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(212, 175, 55, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 215, 0, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(184, 134, 11, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* 容器 */
.container {
    max-width: 414px;
    margin: 0 auto;
    padding: 0 12px 8px 12px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(20, 20, 20, 0.8) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(212, 175, 55, 0.2);
    min-height: 100vh;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(212, 175, 55, 0.1);
    display: flex;
    flex-direction: column;
}

/* 公告栏 */
.announcement-bar {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(30, 30, 30, 0.9) 100%);
    backdrop-filter: blur(15px);
    border-radius: 0 0 15px 15px;
    margin: -1px -12px 12px -12px;
    padding: 12px 16px;
    position: relative;
    border: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(212, 175, 55, 0.2);
}

.announcement-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.announcement-item {
    font-size: 12px;
    color: #d4af37;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    line-height: 1.4;
    padding: 2px 0;
    display: block;
}

.announcement-item:before {
    content: "• ";
    color: #ffd700;
    font-weight: bold;
    margin-right: 4px;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px 0;
    color: #d4af37;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-top: 2px solid #d4af37;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 主要内容区域 */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 卡片容器 */
.cards-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

/* 流量卡卡片 */
.card {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(20, 20, 20, 0.6) 100%);
    backdrop-filter: blur(20px);
    border-radius: 15px;
    padding: 12px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(212, 175, 55, 0.2),
        inset 0 1px 0 rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.15);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    will-change: transform;
    transform: translateZ(0);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05) 0%, rgba(255, 215, 0, 0.02) 100%);
    border-radius: 20px;
    z-index: -1;
}

.card:hover {
    transform: translateY(-8px) scale(1.02) translateZ(0);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(212, 175, 55, 0.3),
        inset 0 1px 0 rgba(212, 175, 55, 0.2);
}

/* 卡片头部 - h3和span在同一行 */
.card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    position: relative;
}

/* 折叠状态下的卡片内容 */
.card-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    will-change: max-height, opacity;
    transform: translateZ(0);
}

/* 展开状态 */
.card.expanded .card-content {
    max-height: 300px;
    opacity: 1;
}

/* 价格信息 */
.price-info {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 8px;
}

.card-header .card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #d4af37;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    background: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex: 1;
}

.card-header .price,
.card-header .data-info,
.card-header .duration {
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 6px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.3);
    backdrop-filter: blur(5px);
}

.card-header .price {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(255, 215, 0, 0.15) 100%);
    color: #ffd700;
    border-color: rgba(255, 215, 0, 0.4);
}

.card-header .data-info {
    background: linear-gradient(135deg, rgba(184, 134, 11, 0.2) 0%, rgba(212, 175, 55, 0.15) 100%);
    color: #d4af37;
    border-color: rgba(212, 175, 55, 0.4);
}

.card-header .duration {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.2) 0%, rgba(160, 82, 45, 0.15) 100%);
    color: #daa520;
    border-color: rgba(218, 165, 32, 0.4);
}

/* 卡片底部 - div和a在同一行 */
.card-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.card-footer .requirements {
    flex: 1;
    margin: 0;
    font-size: 11px;
    color: #d4af37;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(20, 20, 20, 0.4) 100%);
    backdrop-filter: blur(10px);
    padding: 6px 10px;
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    line-height: 1.4;
}

.card-footer .card-button {
    flex-shrink: 0;
    width: auto;
    min-width: 80px;
    padding: 8px 16px;
    margin: 0;
}

/* 运营商标识 */
.operator-badge {
    display: inline-block;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 6px;
}

.operator-badge.广电 {
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.8) 0%, rgba(27, 94, 32, 0.6) 100%);
    color: #81c784;
    border: 1px solid rgba(129, 199, 132, 0.3);
}

.operator-badge.移动 {
    background: linear-gradient(135deg, rgba(25, 118, 210, 0.8) 0%, rgba(13, 71, 161, 0.6) 100%);
    color: #64b5f6;
    border: 1px solid rgba(100, 181, 246, 0.3);
}

.operator-badge.联通 {
    background: linear-gradient(135deg, rgba(245, 124, 0, 0.8) 0%, rgba(230, 81, 0, 0.6) 100%);
    color: #ffb74d;
    border: 1px solid rgba(255, 183, 77, 0.3);
}

.operator-badge.电信 {
    background: linear-gradient(135deg, rgba(194, 24, 91, 0.8) 0%, rgba(136, 14, 79, 0.6) 100%);
    color: #f48fb1;
    border: 1px solid rgba(244, 143, 177, 0.3);
}

/* 地区标识 */
.region-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    color: #000;
    margin-left: 8px;
    font-weight: 600;
}

/* 描述信息 */
.description {
    font-size: 12px;
    line-height: 1.4;
    color: #d4af37;
    margin-bottom: 8px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(20, 20, 20, 0.5) 100%);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 8px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    white-space: pre-line;
}

/* 按钮 */
.card-button {
    background: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 
        0 4px 12px rgba(212, 175, 55, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.card-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.card-button:hover::before {
    left: 100%;
}

.card-button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 10px 25px rgba(212, 175, 55, 0.5),
        0 0 0 1px rgba(255, 215, 0, 0.5),
        0 0 20px rgba(212, 175, 55, 0.3);
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
}

.card-button:active {
    transform: translateY(0) scale(1.02);
}

/* 底部版权 */
.footer {
    text-align: center;
    margin-top: 12px;
    padding: 12px 10px;
    font-size: 11px;
    color: #d4af37;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(20, 20, 20, 0.6) 100%);
    backdrop-filter: blur(15px);
    border-radius: 15px 15px 0 0;
    border: 1px solid rgba(212, 175, 55, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    margin-left: -12px;
    margin-right: -12px;
    margin-bottom: -8px;
    flex-shrink: 0;
}

.footer p {
    margin: 2px 0;
    line-height: 1.4;
}

/* 备案链接样式 */
.footer .beian-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.footer .beian-link:hover {
    color: inherit;
    text-decoration: none;
}

/* 工具按钮容器 */
.tools-container {
    display: flex;
    justify-content: center;
    margin: 15px 0;
}



/* 筛选按钮容器 */
.filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    /* 移动端优化 */
    -webkit-overflow-scrolling: touch;
}

/* 移动端特定样式 */
@media screen and (max-width: 768px) {
    .filter-buttons {
        gap: 6px;
        padding: 0 10px;
    }
    
    .filter-button {
        padding: 10px 16px;
        font-size: 14px;
        min-height: 44px; /* iOS推荐的最小触摸目标 */
        display: flex;
        align-items: center;
        justify-content: center;
        /* 移动端触摸优化 */
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
    }
}

/* 筛选按钮 */
.filter-button {
    /* 备用背景色，兼容不支持rgba的浏览器 */
    background: #2a2a2a;
    background: rgba(212, 175, 55, 0.15);
    color: #d4af37;
    border: 1px solid #8b7355;
    border: 1px solid rgba(212, 175, 55, 0.4);
    padding: 8px 14px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    /* 简化transition，提高兼容性 */
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    /* 移除backdrop-filter，使用更兼容的样式 */
    text-align: center;
    white-space: nowrap;
    /* 添加webkit前缀支持 */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* 防止文本选择 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.filter-button:hover,
.filter-button:focus {
    background: #3a3a3a;
    background: rgba(212, 175, 55, 0.25);
    color: #ffd700;
    border-color: #b8860b;
    border-color: rgba(212, 175, 55, 0.6);
    /* 移除transform，避免兼容性问题 */
}

.filter-button.active {
    /* 备用背景色 */
    background: #d4af37;
    background: -webkit-linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    background: -moz-linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    background: -o-linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    color: #000;
    border-color: transparent;
    /* 简化box-shadow */
    -webkit-box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
    -moz-box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.filter-button.active:hover,
.filter-button.active:focus {
    background: #ffd700;
    background: -webkit-linear-gradient(135deg, #ffd700 0%, #d4af37 100%);
    background: -moz-linear-gradient(135deg, #ffd700 0%, #d4af37 100%);
    background: -o-linear-gradient(135deg, #ffd700 0%, #d4af37 100%);
    background: linear-gradient(135deg, #ffd700 0%, #d4af37 100%);
    -webkit-box-shadow: 0 3px 12px rgba(212, 175, 55, 0.4);
    -moz-box-shadow: 0 3px 12px rgba(212, 175, 55, 0.4);
    box-shadow: 0 3px 12px rgba(212, 175, 55, 0.4);
}

/* 一证通查按钮特殊样式 */
.filter-button.tool-modal-button {
    background: #d4af37;
    background: -webkit-linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    background: -moz-linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    background: -o-linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    color: #000;
    border-color: transparent;
    -webkit-box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
    -moz-box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.filter-button.tool-modal-button:hover,
.filter-button.tool-modal-button:focus {
    background: #ffd700;
    background: -webkit-linear-gradient(135deg, #ffd700 0%, #d4af37 100%);
    background: -moz-linear-gradient(135deg, #ffd700 0%, #d4af37 100%);
    background: -o-linear-gradient(135deg, #ffd700 0%, #d4af37 100%);
    background: linear-gradient(135deg, #ffd700 0%, #d4af37 100%);
    -webkit-box-shadow: 0 3px 12px rgba(212, 175, 55, 0.4);
    -moz-box-shadow: 0 3px 12px rgba(212, 175, 55, 0.4);
    box-shadow: 0 3px 12px rgba(212, 175, 55, 0.4);
}

/* 弹窗遮罩 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.show {
    display: flex;
}

/* 弹窗内容 */
.modal-content {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(20, 20, 20, 0.9) 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    max-width: 320px;
    width: 80%;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 
        0 12px 25px rgba(0, 0, 0, 0.7),
        0 0 20px rgba(212, 175, 55, 0.2);
    animation: slideIn 0.3s ease;
}

/* 弹窗头部 */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.modal-header h3 {
    margin: 0;
    color: #d4af37;
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.close-button {
    background: none;
    border: none;
    color: #d4af37;
    font-size: 18px;
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-button:hover {
    background: rgba(212, 175, 55, 0.2);
    color: #ffd700;
}

/* 弹窗主体 */
.modal-body {
    padding: 16px;
}

/* 工具区块 */
.tool-section {
    margin-bottom: 14px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(20, 20, 20, 0.4) 100%);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 10px;
}

.tool-section:last-child {
    margin-bottom: 0;
}

.tool-section h4 {
    margin: 0 0 6px 0;
    color: #d4af37;
    font-size: 13px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.tool-section p {
    margin: 0 0 10px 0;
    color: #d4af37;
    font-size: 11px;
    line-height: 1.3;
}

/* 工具链接 */
.tool-link {
    display: inline-block;
    background: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
    color: #000;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 11px;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.3);
}

.tool-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(212, 175, 55, 0.4);
}

/* 运营商链接容器 */
.operator-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* 运营商链接 */
.operator-link {
    display: inline-block;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 11px;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    color: #000;
}

.operator-link.mobile {
    background: linear-gradient(135deg, #81c784 0%, #4caf50 100%);
    box-shadow: 0 2px 6px rgba(129, 199, 132, 0.3);
}

.operator-link.unicom {
    background: linear-gradient(135deg, #ffb74d 0%, #ff9800 100%);
    box-shadow: 0 2px 6px rgba(255, 183, 77, 0.3);
}

.operator-link.telecom {
    background: linear-gradient(135deg, #64b5f6 0%, #2196f3 100%);
    box-shadow: 0 2px 6px rgba(100, 181, 246, 0.3);
}

.operator-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

/* 步骤说明 */
.steps {
    color: #d4af37;
    font-size: 11px;
}

.steps ol {
    padding-left: 14px;
    margin: 6px 0;
}

.steps li {
    margin: 4px 0;
    line-height: 1.3;
    color: #d4af37;
}

.steps .note {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(255, 215, 0, 0.1) 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 6px;
    padding: 6px;
    margin-top: 10px;
    color: #d4af37;
    font-size: 10px;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 响应式设计 */
@media (max-width: 375px) {
    .container {
        padding: 16px 12px;
    }
    
    .header {
        margin: -16px -12px 24px -12px;
    }
    
    .card {
        padding: 16px;
    }
    
    .card-title {
        font-size: 16px;
    }
    
    .price {
        font-size: 18px;
    }
}

/* 错误状态 */
.error {
    text-align: center;
    padding: 40px 20px;
    color: #d4af37;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.2) 0%, rgba(160, 82, 45, 0.1) 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    margin: 20px 0;
}

.error h3 {
    margin-bottom: 8px;
}

/* 动画效果 */
.card {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}