/* ============================================
   海角论坛 - 航海日志风格主样式表
   CSS/ID前缀: hj-
   ============================================ */

/* --- Google Fonts Import (Local fallback) --- */
@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700;900&family=Open+Sans:wght@300;400;600;700&display=swap');

/* --- CSS Variables --- */
:root {
    --hj-primary: #001f3f;
    --hj-secondary: #F0E68C;
    --hj-accent: #FFFFFF;
    --hj-text: #333333;
    --hj-link: #4682B4;
    --hj-card-bg: #fdf6e3;
    --hj-parchment: #f5e6c8;
    --hj-rope: #8B6914;
    --hj-wood: #5C3317;
    --hj-shadow: rgba(0, 31, 63, 0.3);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--hj-text);
    background-color: var(--hj-primary);
    line-height: 1.8;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Merriweather', serif;
    color: var(--hj-primary);
    line-height: 1.4;
}

a {
    color: var(--hj-link);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--hj-secondary);
}

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

/* --- Navigation --- */
#hj-header {
    background: var(--hj-primary);
    padding: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 3px solid var(--hj-secondary);
}

.hj-nav-container {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
}

.hj-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hj-logo img {
    width: 40px;
    height: 40px;
}

.hj-logo-text {
    font-family: 'Merriweather', serif;
    color: var(--hj-secondary);
    font-size: 1.3rem;
    font-weight: 700;
}

#hj-nav {
    display: flex;
    align-items: center;
    gap: 0;
}

#hj-nav a {
    color: var(--hj-secondary);
    font-size: 0.9rem;
    padding: 8px 14px;
    position: relative;
    font-weight: 600;
    transition: color 0.3s ease;
}

#hj-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--hj-accent);
    border-radius: 2px;
    transition: width 0.3s ease;
}

#hj-nav a:hover {
    color: var(--hj-accent);
}

#hj-nav a:hover::after {
    width: 80%;
}

/* Hamburger Menu */
.hj-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
}

.hj-hamburger span {
    width: 28px;
    height: 3px;
    background: var(--hj-secondary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Mobile Menu Overlay */
.hj-mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: var(--hj-parchment);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Crect fill='%23f5e6c8'/%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4'/%3E%3C/filter%3E%3Crect filter='url(%23n)' opacity='0.1'/%3E%3C/svg%3E");
    z-index: 2000;
    padding: 60px 30px;
    transition: right 0.4s ease;
    box-shadow: -5px 0 20px var(--hj-shadow);
    overflow-y: auto;
}

.hj-mobile-menu.hj-active {
    right: 0;
}

.hj-mobile-menu a {
    display: block;
    color: var(--hj-primary);
    font-family: 'Merriweather', serif;
    font-size: 1.1rem;
    padding: 15px 0;
    border-bottom: 1px dashed var(--hj-rope);
}

.hj-mobile-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.8rem;
    color: var(--hj-primary);
    cursor: pointer;
    background: none;
    border: none;
}

.hj-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1500;
}

.hj-overlay.hj-active {
    display: block;
}

/* --- Hero Section --- */
#hj-hero {
    position: relative;
    width: 100%;
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--hj-primary);
}

.hj-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
    filter: sepia(0.3);
}

.hj-hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 40px;
    max-width: 800px;
}

.hj-hero-content h1 {
    color: var(--hj-secondary);
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.6);
}

.hj-hero-content p {
    color: var(--hj-accent);
    font-size: 1.2rem;
    line-height: 1.8;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
}

.hj-hero-cta {
    display: inline-block;
    margin-top: 30px;
    padding: 14px 36px;
    background: var(--hj-secondary);
    color: var(--hj-primary);
    font-family: 'Merriweather', serif;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 4px;
    border: 2px solid var(--hj-rope);
    transition: all 0.3s ease;
    box-shadow: 3px 3px 0 var(--hj-rope);
}

.hj-hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 5px 5px 0 var(--hj-rope);
    color: var(--hj-primary);
}

/* --- Section Base --- */
.hj-section {
    padding: 80px 24px;
    max-width: 1440px;
    margin: 0 auto;
}

.hj-section-light {
    background: var(--hj-parchment);
}

.hj-section-dark {
    background: var(--hj-primary);
}

.hj-section-title {
    text-align: center;
    margin-bottom: 50px;
}

.hj-section-title h2 {
    font-size: 2.2rem;
    color: var(--hj-primary);
    margin-bottom: 10px;
}

.hj-section-dark .hj-section-title h2 {
    color: var(--hj-secondary);
}

.hj-section-title p {
    font-size: 1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

.hj-section-dark .hj-section-title p {
    color: #aaa;
}

/* --- Card Grid --- */
.hj-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.hj-card {
    background: var(--hj-card-bg);
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--hj-rope);
    box-shadow: 4px 4px 0 rgba(139, 105, 20, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hj-card:hover {
    transform: translateY(-6px);
    box-shadow: 6px 10px 0 rgba(139, 105, 20, 0.4);
}

.hj-card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.hj-card-body {
    padding: 20px;
}

.hj-card-body h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--hj-primary);
}

.hj-card-body p {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.7;
}

.hj-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px dashed var(--hj-rope);
    font-size: 0.8rem;
    color: #888;
}

/* --- Waterfall / Masonry --- */
.hj-masonry {
    columns: 3;
    column-gap: 20px;
}

.hj-masonry-item {
    break-inside: avoid;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--hj-rope);
    background: var(--hj-card-bg);
}

.hj-masonry-item img {
    width: 100%;
    display: block;
}

.hj-masonry-caption {
    padding: 12px 16px;
    font-size: 0.85rem;
}

/* --- Bulletin Board --- */
.hj-bulletin {
    background: var(--hj-parchment);
    border: 3px solid var(--hj-rope);
    border-radius: 8px;
    padding: 30px;
    position: relative;
}

.hj-bulletin::before {
    content: '📌';
    position: absolute;
    top: -15px;
    left: 30px;
    font-size: 1.5rem;
}

.hj-bulletin-item {
    padding: 15px 0;
    border-bottom: 1px dashed var(--hj-rope);
}

.hj-bulletin-item:last-child {
    border-bottom: none;
}

.hj-bulletin-item h4 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.hj-bulletin-item span {
    font-size: 0.8rem;
    color: #888;
}

/* --- Weather Module --- */
.hj-weather {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.hj-weather-card {
    background: linear-gradient(135deg, var(--hj-primary), #003366);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: var(--hj-accent);
    border: 1px solid var(--hj-secondary);
}

.hj-weather-card h4 {
    color: var(--hj-secondary);
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.hj-weather-card .hj-temp {
    font-size: 2rem;
    font-weight: 700;
}

.hj-weather-card .hj-condition {
    font-size: 0.85rem;
    margin-top: 8px;
    opacity: 0.8;
}

/* --- Membership --- */
.hj-membership {
    text-align: center;
    padding: 60px 30px;
    background: linear-gradient(135deg, var(--hj-primary), #002b5c);
    border-radius: 12px;
    border: 2px solid var(--hj-secondary);
}

.hj-membership h3 {
    color: var(--hj-secondary);
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.hj-membership p {
    color: var(--hj-accent);
    max-width: 600px;
    margin: 0 auto 25px;
}

.hj-membership-features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.hj-membership-feature {
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(240, 230, 140, 0.3);
}

.hj-membership-feature h4 {
    color: var(--hj-secondary);
    font-size: 1rem;
    margin-bottom: 8px;
}

.hj-membership-feature p {
    font-size: 0.85rem;
    color: #ccc;
}

/* --- Gear Exchange --- */
.hj-gear-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.hj-gear-item {
    background: var(--hj-card-bg);
    border: 2px solid var(--hj-rope);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.hj-gear-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--hj-rope);
}

.hj-gear-info h4 {
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.hj-gear-price {
    color: #c0392b;
    font-weight: 700;
    font-size: 1.1rem;
}

/* --- Footer --- */
#hj-footer {
    background: var(--hj-primary);
    border-top: 3px solid var(--hj-secondary);
    padding: 60px 24px 30px;
    color: var(--hj-accent);
}

.hj-footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.hj-footer-col h4 {
    color: var(--hj-secondary);
    font-family: 'Merriweather', serif;
    font-size: 1.1rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(240, 230, 140, 0.3);
}

.hj-footer-col a {
    display: block;
    color: #ccc;
    padding: 6px 0;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.hj-footer-col a:hover {
    color: var(--hj-secondary);
}

.hj-footer-col p {
    color: #ccc;
    font-size: 0.9rem;
    line-height: 1.7;
}

.hj-footer-bottom {
    max-width: 1200px;
    margin: 40px auto 0;
    padding-top: 20px;
    border-top: 1px solid rgba(240, 230, 140, 0.2);
    text-align: center;
    font-size: 0.8rem;
    color: #999;
}

.hj-footer-bottom a {
    color: var(--hj-link);
}

.hj-footer-cert {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.hj-footer-cert img {
    height: 30px;
    display: inline-block;
}

/* --- Page Content --- */
.hj-page-wrapper {
    background: var(--hj-parchment);
    min-height: 100vh;
}

.hj-page-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 60px 24px;
}

.hj-page-content h1 {
    font-size: 2rem;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--hj-rope);
}

.hj-page-content p {
    margin-bottom: 20px;
    line-height: 2;
}

.hj-page-content img {
    border-radius: 8px;
    margin: 20px 0;
    border: 2px solid var(--hj-rope);
}

/* --- Log Page Layout --- */
.hj-log-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    min-height: 70vh;
}

.hj-log-sidebar {
    background: var(--hj-card-bg);
    border: 2px solid var(--hj-rope);
    border-radius: 8px;
    padding: 20px;
    max-height: 80vh;
    overflow-y: auto;
}

.hj-log-entry {
    padding: 12px;
    border-bottom: 1px dashed var(--hj-rope);
    cursor: pointer;
    transition: background 0.2s;
}

.hj-log-entry:hover {
    background: rgba(240, 230, 140, 0.2);
}

.hj-log-entry h4 {
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.hj-log-entry span {
    font-size: 0.75rem;
    color: #888;
}

.hj-log-main {
    background: var(--hj-card-bg);
    border: 2px solid var(--hj-rope);
    border-radius: 8px;
    padding: 30px;
}

/* --- APP Download Page --- */
.hj-app-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hj-app-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
}

.hj-app-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 40px;
    max-width: 600px;
}

.hj-app-content h1 {
    color: var(--hj-secondary);
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.hj-app-content p {
    color: var(--hj-accent);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.hj-app-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.hj-app-btn {
    display: inline-block;
    padding: 14px 30px;
    background: var(--hj-secondary);
    color: var(--hj-primary);
    font-weight: 700;
    border-radius: 6px;
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.hj-app-btn:hover {
    transform: scale(1.05);
    color: var(--hj-primary);
}

/* --- Responsive Design --- */
@media (max-width: 1440px) {
    .hj-section {
        max-width: 1200px;
    }
}

@media (max-width: 1024px) {
    .hj-masonry {
        columns: 2;
    }
    .hj-log-layout {
        grid-template-columns: 1fr;
    }
    .hj-footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    #hj-nav {
        display: none;
    }
    .hj-hamburger {
        display: flex;
    }
    .hj-hero-content h1 {
        font-size: 2rem;
    }
    .hj-hero-content p {
        font-size: 1rem;
    }
    .hj-section {
        padding: 50px 16px;
    }
    .hj-section-title h2 {
        font-size: 1.6rem;
    }
    .hj-card-grid {
        grid-template-columns: 1fr;
    }
    .hj-masonry {
        columns: 1;
    }
    .hj-footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .hj-gear-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 360px) {
    html {
        font-size: 14px;
    }
    .hj-nav-container {
        padding: 10px 12px;
    }
    .hj-hero-content {
        padding: 20px;
    }
    .hj-hero-content h1 {
        font-size: 1.6rem;
    }
}
