/* assets/css/style.css - 完整版 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --danger: #f56565;
    --dark: #1a2a3a;
    --gray: #6c7a8a;
    --light: #f5f7fa;
    --border: #e5e7eb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #ffffff;
    color: var(--dark);
    line-height: 1.5;
    font-size: 17px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* 头部 */
.header {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 0;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
}

.logo {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark);
    background: none;
    color: #1a2a3a;
}

.admin-link {
    color: var(--gray);
    text-decoration: none;
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 6px;
}

/* 顶部广告位 */
.top-ad {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    padding: 10px 12px;
    margin: 12px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    border: 1px solid #fcd34d;
}

.ad-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.ad-icon {
    font-size: 1rem;
}

.ad-text {
    font-size: 0.8rem;
    color: #92400e;
    font-weight: 500;
    line-height: 1.4;
}

.ad-close {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #92400e;
    padding: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* 欢迎语 */
.welcome {
    text-align: center;
    padding: 20px 0 16px;
}

.welcome h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark);
}

/* 搜索框 */
.search-section {
    margin: 16px 0 20px;
}

.search-wrapper {
    position: relative;
    max-width: 100%;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: #9ca3af;
}

.search-input {
    width: 100%;
    padding: 12px 44px 12px 42px;
    border: 1px solid #e5e7eb;
    border-radius: 32px;
    font-size: 0.95rem;
    background: #f9fafb;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #9ca3af;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-clear:hover {
    background: #e5e7eb;
    color: #4b5563;
}

/* 分类标签栏 */
.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 24px;
    padding: 8px 0;
}

.tag {
    background: #eef2f6;
    color: #3a4a5c;
    padding: 6px 18px;
    border-radius: 30px;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
}

.tag.active {
    background: #1a2a3a;
    color: #fff;
}

.tag:hover {
    background: var(--primary);
    color: #fff;
}

/* 最近使用区域 */
.section-recent {
    margin-bottom: 28px;
}

.section-title-recent {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--dark);
}

.recent-container {
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    padding: 16px;
    background: #fff;
}

.recent-empty {
    text-align: center;
    padding: 24px;
    color: #9ca3af;
    font-size: 0.85rem;
}

/* 优选网址区域 */
.url-container {
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    background: #fff;
}

.section-title-url {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--dark);
}

/* 分类菜单按钮行 */
.url-category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.url-cat-btn {
    background: #f0f2f5;
    color: #3a4a5c;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    cursor: pointer;
}

.url-cat-btn.active {
    background: var(--primary);
    color: #fff;
}

.url-cat-btn:hover {
    background: var(--primary);
    color: #fff;
}

/* 链接网格 */
.links-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.link-card {
    background: #fff;
    border-radius: 10px;
    padding: 4px 6px;
    transition: all 0.2s;
    border: 1px solid #e8e8e8;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: calc(33.333% - 6px);
    min-width: 0;
    position: relative;
}

.link-card:active {
    transform: scale(0.98);
    background: #fafafa;
}

.link-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.link-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.link-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--dark);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

/* 状态标记 */
.status-badge {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 0.5rem;
    padding: 1px 4px;
    border-radius: 10px;
    font-weight: 500;
    z-index: 10;
    white-space: nowrap;
}

.status-badge.dead {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.suspicious {
    background: #fff3cd;
    color: #856404;
}

.status-badge.slow {
    background: #ffe0b3;
    color: #cc7b00;
}

.status-badge.foreign {
    background: #e5e7eb;
    color: #4b5563;
}

.card-dead {
    opacity: 0.6;
    background: #f8f9fa;
}

.card-suspicious {
    background: #fff8e7;
    border-left: 2px solid #f39c12;
}

.card-slow {
    background: #fff5e6;
    border-left: 2px solid #f59e0b;
}

.card-foreign {
    background: #f3f0ff;
    border-left: 2px solid #8b5cf6;
}

.strikethrough {
    text-decoration: line-through;
    color: #999;
}

/* 手机端 */
@media (max-width: 600px) {
    body {
        font-size: 15px;
    }
    
    .container {
        padding: 0 12px;
    }
    
    .header .container {
        padding: 0 12px;
    }
    
    .header {
        padding: 10px 0;
    }
    
    .logo {
        font-size: 1rem;
    }
    
    .admin-link {
        font-size: 0.7rem;
        padding: 3px 6px;
    }
    
    .top-ad {
        padding: 6px 8px;
        margin: 8px 0;
        border-radius: 10px;
    }
    
    .ad-text {
        font-size: 0.7rem;
    }
    
    .welcome {
        padding: 14px 0 10px;
    }
    
    .welcome h1 {
        font-size: 1.3rem;
    }
    
    .search-section {
        margin: 12px 0 16px;
    }
    
    .search-input {
        padding: 10px 38px 10px 36px;
        font-size: 0.85rem;
    }
    
    .search-icon {
        left: 12px;
        font-size: 0.9rem;
    }
    
    .search-clear {
        right: 10px;
        width: 24px;
        height: 24px;
        font-size: 0.9rem;
    }
    
    .category-tags {
        gap: 8px;
        margin-bottom: 20px;
    }
    
    .tag {
        padding: 5px 14px;
        font-size: 0.8rem;
    }
    
    .section-title-recent {
        font-size: 0.95rem;
    }
    
    .recent-container {
        padding: 12px;
    }
    
    .recent-empty {
        padding: 18px;
        font-size: 0.8rem;
    }
    
    .url-container {
        padding: 12px;
    }
    
    .section-title-url {
        font-size: 0.95rem;
    }
    
    .url-category-nav {
        gap: 8px;
        margin-bottom: 12px;
    }
    
    .url-cat-btn {
        padding: 4px 10px;
        font-size: 0.7rem;
    }
    
    .links-grid {
        gap: 6px;
    }
    
    .link-card {
        padding: 3px 5px;
        gap: 6px;
        width: calc(33.333% - 4px);
        border-radius: 8px;
    }
    
    .link-icon {
        width: 24px;
        height: 24px;
    }
    
    .link-icon img {
        width: 20px;
        height: 20px;border-radius:4px;
    }
    
    .link-name {
        font-size: 0.6rem;font-weight2:900;
        margin-left:-3px;
    }
    
    .status-badge {
        font-size: 0.45rem;
        padding: 1px 3px;
        top: 1px;
        right: 3px;
    }
}

/* 电脑端 */
@media (min-width: 769px) {
    .link-card {
        width: calc(20% - 7px);
    }
}

@media (min-width: 1100px) {
    .link-card {
        width: calc(16.666% - 7px);
    }
}

@media (min-width: 500px) and (max-width: 768px) {
    .link-card {
        width: calc(25% - 5px);
    }
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 16px 0;
    font-size: 0.7rem;
    color: var(--gray);
    border-top: 1px solid #f0f0f0;
    margin-top: 20px;
    background: #fff;
}

/* 举报入口区域 */
.report-section {
    background: #fafafc;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    padding: 12px 0;
    margin-top: 20px;
}

.report-links {
    text-align: center;
    font-size: 0.75rem;
}

.report-link {
    color: #6c7a8a;
    text-decoration: none;
    transition: color 0.2s;
    padding: 0 8px;
}

.report-link:hover {
    color: #667eea;
}

.report-separator {
    color: #e5e7eb;
}

@media (max-width: 600px) {
    .report-section {
        padding: 10px 0;
        margin-top: 16px;
    }
    .report-links {
        font-size: 0.7rem;
    }
}

/* ========== 弹窗样式 ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: #fff;
    border-radius: 20px;
    width: 90%;
    max-width: 340px;
    max-height: 85vh;
    overflow: auto;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    position: relative;
    text-align: center;
}

.modal-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
}

.modal-report-btn {
    position: absolute;
    left: 12px;
    top: 12px;
    background: none;
    border: none;
    font-size: 0.75rem;
    color: var(--gray);
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 20px;
}

.modal-report-btn:hover {
    background: #fee2e2;
    color: var(--danger);
}

.modal-close {
    position: absolute;
    right: 12px;
    top: 12px;
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--gray);
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    background: #f0f0f0;
    color: var(--danger);
}

.modal-body {
    padding: 16px;
}

.loading-state {
    text-align: center;
    padding: 20px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-hint {
    font-size: 0.65rem;
    color: var(--gray);
    margin-top: 4px;
}

.security-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 24px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.security-badge.safe {
    background: #c6f6d5;
    color: #22543d;
}

.security-badge.unsafe {
    background: #fed7d7;
    color: #9b2c2c;
}

.site-info {
    margin: 10px 0;
}

.site-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 5px;
    word-break: break-word;
    color: var(--dark);
}

.site-domain {
    font-family: monospace;
    font-size: 0.7rem;
    background: var(--light);
    padding: 5px 8px;
    border-radius: 8px;
    word-break: break-all;
    margin: 8px 0;
    color: var(--gray);
}

.warning-text, .safe-text {
    font-size: 0.7rem;
    padding: 6px 10px;
    border-radius: 8px;
    margin: 10px 0;
    line-height: 1.4;
}

.warning-text {
    background: #fff5e6;
    color: #ed8936;
}

.safe-text {
    background: #e6fffa;
    color: #38a169;
}

.action-buttons {
    display: flex;
    gap: 8px;
    margin: 14px 0 8px;
    width: 100%;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 8px 0;
    border-radius: 40px;
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary {
    background: #f5f7fa;
    color: #1a2a3a;
    border: 1px solid #e5e7eb;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.disclaimer {
    font-size: 0.6rem;
    color: var(--gray);
    text-align: center;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

@media (max-width: 600px) {
    .modal-content {
        max-width: 280px;
    }
    .modal-header {
        padding: 10px 12px;
    }
    .modal-header h3 {
        font-size: 0.9rem;
    }
    .modal-body {
        padding: 12px;
    }
    .action-buttons {
        gap: 6px;
        margin: 12px 0 6px;
    }
    .btn-primary, .btn-secondary {
        padding: 6px 0;
        font-size: 0.65rem;
    }
}

/* Toast 提示 */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--dark);
    color: #fff;
    padding: 6px 16px;
    border-radius: 36px;
    font-size: 0.7rem;
    z-index: 1100;
    transition: transform 0.2s;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

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

.toast.success { background: #48bb78; }
.toast.error { background: #f56565; }
.toast.warning { background: #ed8936; }

/* 兑换码窗口样式 */
.redeem-section {
    margin: 16px 0 24px;
}

.redeem-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    color: #fff;
}

.redeem-icon {
    font-size: 2rem;
}

.redeem-info h3 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.redeem-info p {
    font-size: 0.7rem;
    opacity: 0.9;
}

.redeem-input-group {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.redeem-quick-input {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-radius: 30px;
    font-size: 0.85rem;
    background: rgba(255,255,255,0.95);
}

.redeem-quick-input:focus {
    outline: none;
    background: #fff;
}

.redeem-quick-btn {
    background: #fff;
    color: #667eea;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

/* VIP区块样式 */
.section-vip {
    margin-bottom: 28px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-title-vip {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 6px;
}

.vip-badge {
    background: linear-gradient(135deg, #f39c12 0%, #e74c3c 100%);
    color: #fff;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 500;
}

.vip-container {
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    padding: 16px;
    background: #fff;
}

.vip-empty {
    text-align: center;
    padding: 24px;
    color: #9ca3af;
    font-size: 0.85rem;
}

.vip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.vip-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    transition: all 0.2s;
    border: 1px solid #f0f0f0;
}

.vip-card:hover {
    background: #fff;
    border-color: #667eea;
    transform: translateY(-2px);
}

.vip-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vip-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.vip-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--dark);
}

.vip-lock {
    font-size: 0.8rem;
    color: #f39c12;
    margin-left: 4px;
}

/* 手机端VIP样式 */
@media (max-width: 600px) {
    .redeem-card {
        padding: 12px 16px;
    }
    .redeem-icon {
        font-size: 1.5rem;
    }
    .redeem-info h3 {
        font-size: 0.9rem;
    }
    .redeem-info p {
        font-size: 0.65rem;
    }
    .redeem-quick-input {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    .redeem-quick-btn {
        padding: 8px 16px;
        font-size: 0.75rem;
    }
    .vip-card {
        padding: 8px 12px;
    }
    .vip-icon {
        width: 24px;
        height: 24px;
    }
    .vip-icon img {
        width: 20px;
        height: 20px;
    }
    .vip-name {
        font-size: 0.75rem;
    }
}

/* 兑换弹窗内样式 */
#redeem-modal .redeem-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.9rem;
    text-align: center;
    letter-spacing: 1px;
}

#redeem-modal .redeem-success {
    color: #27ae60;
    text-align: center;
    margin-bottom: 12px;
}

#redeem-modal .redeem-product-name {
    font-weight: bold;
    text-align: center;
    margin-bottom: 12px;
}

#redeem-modal .redeem-link {
    display: inline-block;
    margin: 8px 0;
    padding: 8px 16px;
    background: #667eea;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
}

#redeem-modal .copy-redeem-link,
#redeem-modal .copy-redeem-text {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
}

/* 历史记录弹窗样式 */
.history-modal .modal-content {
    max-width: 500px;
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    border-bottom: 1px solid #f0f0f0;
    padding: 12px 0;
}

.history-time {
    font-size: 0.7rem;
    color: #999;
}

.history-product {
    font-weight: 600;
    margin: 4px 0;
}

.history-card {
    font-family: monospace;
    background: #f5f5f5;
    padding: 6px;
    border-radius: 6px;
    font-size: 0.8rem;
    word-break: break-all;
}

.clear-history {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    cursor: pointer;
    margin-top: 12px;
}

/* 商品详情弹窗内样式 - 描述区域可滚动 */
.product-detail-scroll {
    max-height: 200px;
    overflow-y: auto;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 12px 0;
    word-break: break-word;
    text-align: left;
    border: 1px solid #e9ecef;
}

.product-detail-scroll::-webkit-scrollbar {
    width: 4px;
}

.product-detail-scroll::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 4px;
}

.product-detail-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.product-detail-scroll img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 8px 0;
}

.product-detail-scroll a {
    color: #667eea;
    text-decoration: none;
}

@media (max-width: 600px) {
    .product-detail-scroll {
        max-height: 150px;
        padding: 10px;
    }
}

/* 发卡系统额外样式（已整合，无需额外添加） */