/* ==========================================================
   Island Shared Styles
   Newspaper-style components shared across island pages
   ========================================================== */

/* --- Masthead (报头) --- */
.masthead {
    padding: 60px 0 20px;
    text-align: center;
    position: relative;
}

.masthead-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    border-bottom: 2px solid var(--ink-black);
    padding-bottom: 10px;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.brand-title {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -0.05em;
    margin: 0;
    color: var(--ink-black);
    text-transform: uppercase;
}

.brand-sub {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.2rem;
    color: #666;
    margin-top: 10px;
}

/* --- Top Bar Widgets --- */
.top-bar-widgets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 30px;
    border-top: 2px solid var(--ink-black);
    border-bottom: 2px solid var(--ink-black);
    padding: 15px 0;
}

.top-widget-box {
    border-right: 1px dashed #ccc;
    padding: 0 15px;
}

.top-widget-box:last-child {
    border-right: none;
}

.top-widget-title {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 10px;
    color: var(--ink-black);
    text-transform: uppercase;
    border-bottom: 1px solid var(--ink-black);
    padding-bottom: 5px;
}

/* --- Layout Grid --- */
.main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 48px;
    margin-top: 40px;
}

/* --- Article Components --- */
.article-tag {
    display: inline-block;
    background: var(--ink-black);
    color: #fff;
    padding: 4px 8px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.headline {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 20px 0;
}

.policy-text {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
}

/* --- Finance Widget --- */
.finance-widget {
    background: #F1F5F9;
    padding: 24px;
    border: 2px solid var(--ink-black);
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.1);
}

.widget-title {
    font-family: var(--font-mono);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--ink-black);
    padding-bottom: 8px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.stat-val {
    font-weight: 700;
}

/* --- Topics Banner --- */
.topics-banner {
    background: var(--ink-black);
    color: #fff;
    padding: 24px;
    margin: 40px 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    border: 1px dashed #555;
    position: relative;
    overflow: hidden;
}

.topics-banner::after {
    content: "FUTURE";
    position: absolute;
    right: -20px;
    bottom: -40px;
    font-size: 10rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

.topic-col h3 {
    font-family: var(--font-mono);
    color: var(--accent-gold);
    margin-top: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.topic-desc {
    font-size: 0.95rem;
    color: #ccc;
    margin-bottom: 20px;
}

.api-box {
    border: 1px solid #444;
    background: #1a1a1a;
    padding: 15px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #00ff9d;
}

/* --- Feed / Voices --- */
.feed-section-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 900;
    border-bottom: 4px double var(--ink-black);
    padding-bottom: 10px;
    margin-bottom: 30px;
}

.feed-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.feed-item {
    padding: 24px 0;
    border-bottom: 1px solid #ddd;
}

.feed-item:first-child {
    padding-top: 0;
}

.feed-meta {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 8px;
}

.feed-author {
    color: var(--accent-red);
    font-weight: bold;
}

.feed-content {
    font-size: 1.05rem;
    font-weight: 500;
}

/* --- Live Ticker Terminal --- */
.live-ticker-terminal {
    background: transparent;
    color: var(--ink-black);
    font-family: var(--font-sans);
    padding: 10px 0;
    font-size: 0.9rem;
    border: none;
    box-shadow: none;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.live-ticker-line {
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    opacity: 0;
    max-height: 200px;
    overflow: hidden;
    animation: tickerFadeIn 0.8s ease-out forwards;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out, max-height 0.6s ease-out, padding 0.6s ease-out, border 0.6s ease-out;
}

.live-ticker-line.ticker-fade-out {
    opacity: 0;
    transform: translateX(-15px);
}

.live-ticker-line .ticker-time {
    color: #94a3b8;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    margin-right: 8px;
    display: inline-block;
}

/* Type Variations */
.ticker-type-dialogue {
    background: #f0fdf4;
    border-color: #bbf7d0;
    border-left: 4px solid #4ade80;
}

.ticker-type-purchase {
    background: #fffbeb;
    border-color: #fef08a;
    border-left: 4px solid #facc15;
}

.ticker-type-post {
    background: #eff6ff;
    border-color: #bfdbfe;
    border-left: 4px solid #60a5fa;
}

.ticker-type-system {
    background: #f8fafc;
    border-color: #e2e8f0;
    border-left: 4px solid #cbd5e1;
    color: #64748b;
}

@keyframes tickerFadeIn {
    from {
        opacity: 0;
        transform: translateX(15px);
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }

    to {
        opacity: 1;
        transform: translateX(0);
        max-height: 200px;
        padding-top: 4px;
        padding-bottom: 4px;
    }
}

/* --- Sidebar Widgets --- */
.sidebar-widget {
    margin-bottom: 40px;
}

.sidebar-header {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.1rem;
    border-bottom: 2px solid var(--ink-black);
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.rank-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dotted #ccc;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.rank-num {
    font-weight: bold;
    margin-right: 10px;
    color: var(--accent-red);
}

/* --- Shared Empty State --- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-family: var(--font-mono);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.empty-state h2 {
    font-family: var(--font-serif);
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--ink-black);
}

.empty-state p {
    color: #666;
    margin-bottom: 30px;
}

/* --- Island Shared Modal Overrides --- */
.modal-content {
    max-width: 480px;
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .main-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .topics-banner {
        margin-top: 24px;
    }
}

@media (max-width: 768px) {
    .top-bar-widgets {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px 0;
    }

    .top-widget-box:nth-child(2) {
        border-right: none;
    }

    .masthead-meta {
        flex-direction: column;
        gap: 12px;
    }

    .brand-title {
        font-size: clamp(2.5rem, 6vw, 3.5rem);
    }

    .headline {
        font-size: 2rem;
    }

    .modal-content {
        padding: 24px;
        box-shadow: 8px 8px 0 var(--ink-black);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .masthead {
        padding: 30px 0 15px;
    }

    .brand-title {
        font-size: 2.2rem;
    }

    .brand-sub {
        font-size: 1rem;
    }

    .top-bar-widgets {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .top-widget-box {
        border-right: none;
        border-bottom: 1px dashed var(--border-light);
        padding: 16px 0;
    }

    .top-widget-box:last-child {
        border-bottom: none;
    }

    .headline {
        font-size: 1.6rem;
    }

    .feed-section-title {
        font-size: 1.25rem;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        padding: 20px;
        box-shadow: none;
        border-left: none;
        border-right: none;
        border-bottom: none;
        margin: 0;
        min-height: 100vh;
        border-radius: 0;
        animation: slideUp 0.2s ease-out;
    }

    .finance-widget,
    .topics-banner {
        padding: 20px;
    }

    .stat-row {
        font-size: 0.8rem;
    }
}
