/* common.css - 钓点哥网站样式文件 */
/* 版本：2.0 (完整版) */

/* ==================== 全局样式重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    font-size: 16px;
    padding-top: 60px; /* 给顶部固定导航栏留空间 */
    padding-bottom: 60px; /* 给底部固定导航栏留空间 */
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==================== 顶部导航栏 ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    color: #333;
    padding: 10px 15px;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid #eee;
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.site-title {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    color: #2e7d32;
    letter-spacing: 1px;
}

/* ==================== 搜索框样式 ==================== */
.search-container {
    padding: 60px 15px 15px 15px;
    background: white;
    margin-bottom: 10px;
}

.search-box {
    display: flex;
    gap: 10px;
}

.search-box input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.search-box input:focus {
    border-color: #2e7d32;
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.1);
}

.search-box button {
    padding: 12px 20px;
    background: #2e7d32;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-box button:hover {
    background: #1b5e20;
}

/* ==================== 主要内容区域 ==================== */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 首页钓点卡片容器 */
.fishing-spots-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .fishing-spots-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 480px) {
    .fishing-spots-container {
        grid-template-columns: 1fr;
    }
}

/* 首页钓点卡片样式 */
.fishing-spot-card {
    background: white;
    border-radius: 12px;
    padding: 25px 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 80px;
    text-decoration: none;
    color: inherit;
}

.fishing-spot-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.fishing-spot-card h3 {
    color: #2e7d32;
    margin: 0;
    font-size: 18px;
}

/* 二级页面列表样式 */
.fishing-spots-list {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.fishing-spot-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.fishing-spot-item:last-child {
    border-bottom: none;
}

.fishing-spot-item:hover {
    background-color: #f8f9fa;
}

.fishing-spot-item h3 {
    color: #2e7d32;
    font-size: 16px;
    margin: 0;
}

/* ==================== 页面标题样式 ==================== */
.page-title {
    font-size: 24px;
    color: #2e7d32;
    margin: 15px 0;
    text-align: center;
    padding: 0 10px;
}

/* ==================== 返回按钮样式 ==================== */
.back-button-container {
    position: absolute;
    top: 10px;
    left: 15px;
    z-index: 1001;
}

.back-button {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.back-button:hover {
    background: white;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

/* ==================== 底部导航栏 ==================== */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #eee;
    padding: 15px 15px;
    z-index: 1000;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 40px;
}

/* 信息框通用样式 */
.info-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 20px;
    min-width: 180px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
}

/* 微信信息框 */
.wechat-box {
    background: #f0f9f0;
    border-color: #d4edda;
}

.wechat-contact {
    font-weight: bold;
    color: #2e7d32;
    font-size: 14px;
}

.update-notice {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* 版权信息框 */
.copyright-box {
    background: #f8f9fa;
    border-color: #e9ecef;
}

.copyright {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.copyright .current-year {
    color: #2e7d32;
    font-weight: bold;
}

/* 清除本地信息按钮 - 放在最下面单独一行 */
.clear-data-section {
    width: 100%;
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #ddd;
}

.clear-data-btn {
    padding: 6px 12px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    opacity: 0.8;
    transition: all 0.3s;
}

.clear-data-btn:hover {
    background: #ff5252;
    opacity: 1;
}

/* ==================== 弹窗样式 ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: white;
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.4s ease-out;
    border: 2px solid #e0e0e0;
    position: relative;
}

/* 去掉顶部的绿色装饰条 */
.modal::before {
    display: none !important; /* 确保不显示 */
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 弹窗内容区域 - 加深背景色 */
.modal-content {
    margin-bottom: 25px;
    font-size: 16px;
    line-height: 1.7;
    text-align: center;
    padding: 25px 20px;
    color: #333;
    min-height: 120px;
    display: block;
    background: #e0f2e1 !important; /* 更深的绿色背景 */
    border-radius: 10px;
    border: 2px solid #a5d6a7 !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    font-weight: 500;
}

/* 钓鱼图标装饰 */
.modal-content::before {
    content: '🎣';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #2e7d32, #4caf50);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
    border: 2px solid white;
    z-index: 2;
}

/* 重点文本强调 */
.modal-content strong {
    color: #2e7d32;
    font-weight: 700;
}

/* 微信文本特殊样式 */
.wechat-text {
    color: #2e7d32 !important;
    font-weight: 700 !important;
    font-size: 17px !important;
}

.modal-content br {
    display: block;
    margin-bottom: 10px;
    content: "";
}

/* 验证码输入框 */
.code-input {
    width: 100%;
    padding: 16px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 25px;
    text-align: center;
    outline: none;
    transition: all 0.3s;
    background: white;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    font-weight: 500;
    color: #333;
}

.code-input:focus {
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
}

.code-input::placeholder {
    color: #666;
    font-weight: normal;
    font-size: 14px;
}

/* 弹窗按钮区域 */
.modal-buttons {
    display: flex;
    gap: 15px;
}

/* 按钮通用样式 */
.modal-buttons button {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* "看看再说"按钮 */
.cancel-btn {
    background: #f0f0f0 !important;
    color: #555 !important;
    border: 2px solid #d0d0d0 !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

.cancel-btn:hover {
    background: #e0e0e0 !important;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-2px);
}

/* "确认输入"按钮 */
.confirm-btn {
    background: #2e7d32 !important;
    color: white !important;
    border: 2px solid #1b5e20 !important;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3) !important;
}

.confirm-btn:hover {
    background: #1b5e20 !important;
    box-shadow: 0 6px 16px rgba(46, 125, 50, 0.4) !important;
    transform: translateY(-2px);
}

/* 确认按钮禁用状态 */
.confirm-btn:disabled {
    background: #cccccc !important;
    border-color: #999 !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
    cursor: not-allowed;
    opacity: 0.7;
    transform: none !important;
}

.confirm-btn:disabled:hover {
    background: #cccccc !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
    transform: none !important;
}

/* ==================== 加载和错误状态样式 ==================== */
.loading-text, .error-text {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
    grid-column: 1 / -1;
}

.loading-text {
    color: #2e7d32;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.error-text {
    color: #ff6b6b;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 480px) {
    .site-title {
        font-size: 20px;
    }
    
    .search-container {
        padding: 50px 10px 10px 10px;
    }
    
    .search-box input {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .search-box button {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .fishing-spot-card {
        padding: 20px 12px;
        min-height: 70px;
    }
    
    .fishing-spot-card h3 {
        font-size: 16px;
    }
    
    .page-title {
        font-size: 20px;
    }
    
    .footer-content {
        gap: 20px;
    }
    
    .info-box {
        min-width: 150px;
        padding: 10px 15px;
    }
    
    /* 弹窗响应式 */
    .modal {
        padding: 25px 20px;
        width: 95%;
    }
    
    .modal-content {
        padding: 20px 15px;
        font-size: 15px;
        min-height: 100px;
    }
    
    .modal-content::before {
        width: 35px;
        height: 35px;
        font-size: 18px;
        top: -18px;
    }
    
    .code-input {
        padding: 14px;
        font-size: 15px;
        margin-bottom: 20px;
    }
    
    .modal-buttons {
        gap: 12px;
    }
    
    .modal-buttons button {
        padding: 14px;
        font-size: 15px;
    }
}

@media (max-width: 320px) {
    .footer-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .info-box {
        width: 100%;
        min-width: auto;
    }
    
    .modal-buttons {
        flex-direction: column;
        gap: 10px;
    }
}

/* ==================== 打印样式 ==================== */
@media print {
    .header, .footer, .back-button-container,
    .search-container, .clear-data-section {
        display: none;
    }
    
    body {
        padding-top: 0;
        padding-bottom: 0;
        background: white;
    }
    
    .fishing-spots-container,
    .fishing-spots-list {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    /* 打印时隐藏弹窗 */
    .modal-overlay {
        display: none !important;
    }
}

/* ==================== 高对比度模式支持 ==================== */
@media (prefers-contrast: high) {
    .fishing-spot-card,
    .info-box,
    .modal {
        border: 2px solid #333;
    }
    
    .search-box input,
    .code-input {
        border: 2px solid #333;
    }
    
    .fishing-spot-item {
        border-bottom: 2px solid #333;
    }
    
    .modal-content {
        background: #e0f2e1 !important;
        border: 3px solid #2e7d32 !important;
    }
    
    .cancel-btn {
        background: #f0f0f0 !important;
        border: 2px solid #555 !important;
        color: #000 !important;
    }
    
    .confirm-btn {
        background: #2e7d32 !important;
        border: 2px solid #000 !important;
        color: #fff !important;
    }
}

/* ==================== 暗色模式支持 ==================== */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #121212;
        color: #e0e0e0;
    }
    
    .header,
    .footer,
    .fishing-spot-card,
    .fishing-spots-list,
    .info-box,
    .modal {
        background-color: #1e1e1e;
        border-color: #333;
    }
    
    .site-title {
        color: #4caf50;
    }
    
    .fishing-spot-card h3,
    .fishing-spot-item h3,
    .page-title {
        color: #4caf50;
    }
    
    .search-box input,
    .code-input {
        background-color: #2d2d2d;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .search-box button {
        background-color: #2e7d32;
    }
    
    .search-box button:hover {
        background-color: #1b5e20;
    }
    
    /* 暗色模式下的弹窗 */
    .modal {
        background-color: #2d2d2d;
        border-color: #444;
    }
    
    .modal-content {
        background-color: #1e3a1e !important;
        border-color: #2e5c2e !important;
        color: #e0e0e0;
    }
    
    .modal-content strong,
    .wechat-text {
        color: #4caf50 !important;
    }
    
    .cancel-btn {
        background-color: #333 !important;
        border-color: #555 !important;
        color: #ccc !important;
    }
    
    .cancel-btn:hover {
        background-color: #3a3a3a !important;
        border-color: #666 !important;
    }
    
    .confirm-btn {
        background-color: #2e7d32 !important;
        border-color: #1b5e20 !important;
    }
    
    .confirm-btn:hover {
        background-color: #1b5e20 !important;
        border-color: #155c1b !important;
    }
    
    .copyright-box {
        background-color: #252525;
    }
    
    .update-notice {
        color: #aaa;
    }
    
    .modal-overlay {
        background: rgba(0, 0, 0, 0.8);
    }
}