@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

:root {
    /* Cute & Light Color Palette */
    --bg-gradient: linear-gradient(135deg, #e0f2fe 0%, #f0fdf4 100%);
    --paper: #ffffff;
    --text-main: #334155;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --primary: #38bdf8;
    --primary-soft: rgba(56, 189, 248, 0.15);
    --secondary: #fbbf24;
    --success: #34d399;
    --error: #fb7185;
    --border: #e2e8f0;

    --shadow-sm: 0 4px 12px rgba(148, 163, 184, 0.08);
    --shadow-md: 0 12px 24px rgba(148, 163, 184, 0.12);
    --shadow-hover: 0 20px 32px rgba(56, 189, 248, 0.15);

    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;

    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    font-family: 'Nunito', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 64px;
}

/* Base Layout */
.shell {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 16px;
}

.shell-detail {
    max-width: 680px;
}

/* Typography */
h1, h2, h3 {
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.3;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

p, li, span, div {
    line-height: 1.6;
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: slideUp 0.25s ease-out both;
}

.animate-stagger-1 {
    animation-delay: 0.05s;
}

.animate-stagger-2 {
    animation-delay: 0.1s;
}

.animate-stagger-3 {
    animation-delay: 0.15s;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 24px;
    position: relative;
}

.hero::before {
    content: '🌤️';
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
    100% {
        transform: translateY(0);
    }
}

.hero p {
    color: var(--text-muted);
    margin-top: 12px;
    font-size: 1.1rem;
}

.hero-meta {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

/* Badges & Tags */
.badge, .tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 99px;
    font-size: 0.875rem;
    font-weight: 700;
    background: var(--paper);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.badge:hover, .tag:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

.tag.emoji-tag {
    background: var(--primary-soft);
    color: var(--primary);
    border: none;
}

/* List & Grid Containers */
.record-list, .detail-stack, .field-grid, .meta-grid, .source-list {
    display: grid;
    gap: 20px;
}

.field-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.meta-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.source-list {
    grid-template-columns: 1fr;
}

/* Cards */
.record-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.record-card, .detail-card, .raw-card {
    background: var(--paper);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: all 0.25s ease-out;
    position: relative;
    overflow: hidden;
}

.record-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-hover);
    border-color: rgba(56, 189, 248, 0.3);
}

/* Decorative background bubble in card */
.record-card::after {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--primary-soft) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    transition: transform 0.25s ease-out;
}

.record-card:hover::after {
    transform: scale(1.5);
}

.record-card-top, .detail-head {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.record-card h3 {
    font-size: 1.15rem;
    margin-bottom: 8px;
}

.meta-line {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 600;
    white-space: nowrap;
}

.record-summary, .detail-intro {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.detail-intro {
    -webkit-line-clamp: unset;
    line-clamp: unset;
    font-size: 1.05rem;
}

.record-card-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Detail Page specific items */
.meta-item, .field-item, .source-item {
    background: rgba(248, 250, 252, 0.8);
    padding: 16px;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.meta-item strong, .field-item strong, .source-item strong {
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.field-item div {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
}

.source-item {
    gap: 8px;
}

.source-item a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    word-break: break-all;
}

.source-item a:hover {
    text-decoration: underline;
}

/* Empty & State cards */
.empty-state, .loading-card, .error-card {
    text-align: center;
    padding: 40px 20px;
    background: var(--paper);
    border-radius: var(--radius-xl);
    color: var(--text-muted);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.error-card {
    color: var(--error);
    background: #fff1f2;
}

/* Header/Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--paper);
    color: var(--text-main);
    text-decoration: none;
    font-weight: 700;
    border-radius: 99px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
}

.back-link::before {
    content: '←';
    font-size: 1.2em;
}

.back-link:hover {
    transform: translateX(-4px);
    color: var(--primary);
}

.title-row {
    margin-bottom: 20px;
}

.section-note {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .shell {
        padding: 16px 12px;
    }

    h1 {
        font-size: 1.75rem;
    }

    .record-card, .detail-card, .raw-card {
        padding: 20px;
    }

    .record-card-top, .detail-head {
        flex-direction: column;
        gap: 8px;
    }

    .meta-line {
        margin-top: 4px;
    }

    .field-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .field-item {
        padding: 12px;
    }

    .field-item div {
        font-size: 0.95rem;
    }
}

@media (max-width: 380px) {
    .field-grid {
        grid-template-columns: 1fr;
    }
}
