:root {
    --primary: #0057b8;
    --primary-dark: #004494;
    --secondary: #00a896;
    --text: #1a1a1a;
    --text-muted: #666;
    --bg: #f5f7fa;
    --white: #ffffff;
    --border: #e0e4e8;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-lg: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Header */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo .dot {
    color: var(--primary);
}

.main-nav a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 24px;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.main-nav a:hover {
    color: var(--primary);
}

/* Hero Search */
.hero-search {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 80px 0 64px;
    text-align: center;
}

.hero-search h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}

.hero-search .subtitle {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 32px;
}

.search-box {
    display: flex;
    max-width: 560px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.search-box input {
    flex: 1;
    padding: 16px 20px;
    border: none;
    font-size: 16px;
    outline: none;
    color: var(--text);
}

.search-box input::placeholder {
    color: #aaa;
}

.search-button {
    padding: 16px 28px;
    background: var(--secondary);
    color: var(--white);
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.search-button:hover {
    background: #008c7d;
}

.search-hint {
    margin-top: 16px;
    font-size: 13px;
    opacity: 0.75;
}

/* Features */
.features {
    padding: 48px 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--white);
    padding: 28px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.feature-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.feature-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Recent searches */
.recent-searches {
    padding: 0 0 48px;
}

.recent-searches h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.search-tag {
    display: inline-block;
    padding: 8px 16px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 14px;
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s;
}

.search-tag:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Person Result Page */
.person-result {
    padding: 24px 0 48px;
}

.breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    margin: 0 6px;
}

.person-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 24px;
}

.person-header {
    display: flex;
    align-items: center;
    padding: 28px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
}

.person-avatar {
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    margin-right: 20px;
    flex-shrink: 0;
}

.person-title h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.person-age {
    font-size: 14px;
    opacity: 0.9;
}

.person-details {
    padding: 28px;
}

.detail-section {
    margin-bottom: 28px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

.detail-item {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item .label {
    width: 140px;
    flex-shrink: 0;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.detail-item .value {
    flex: 1;
    font-size: 14px;
    color: var(--text);
}

/* Protected contact */
.contact-protected {
    flex-direction: column;
    align-items: flex-start;
}

.contact-protected .label {
    margin-bottom: 8px;
}

.protected-content {
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius);
    width: 100%;
}

.protect-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
}

.revealed-content {
    padding: 12px 16px;
    background: #e8f5e9;
    border-radius: var(--radius);
    border-left: 4px solid var(--secondary);
}

.email-link {
    color: var(--secondary);
    font-weight: 600;
    text-decoration: none;
    font-size: 15px;
}

.email-link:hover {
    text-decoration: underline;
}

/* Contact row styles */
.contact-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.contact-row:last-child {
    border-bottom: none;
}

.contact-label {
    width: 70px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    flex-shrink: 0;
}

.contact-value {
    color: var(--secondary);
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
}

.contact-value:hover {
    text-decoration: underline;
}

.contact-note {
    font-size: 12px;
    color: #888;
}

/* Reveal contact button */
.reveal-contact-btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.reveal-contact-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.reveal-contact-btn:active {
    transform: translateY(0);
}

/* Address subsections */
.address-subsection {
    margin-bottom: 16px;
}

.address-subsection:last-child {
    margin-bottom: 0;
}

.address-subsection h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    margin-top: 4px;
}

.post-address {
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

/* Language switcher */
.lang-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: var(--white) !important;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    margin-left: 16px;
    text-decoration: none;
    transition: background 0.2s;
}

.lang-switch:hover {
    background: var(--primary-dark);
    color: var(--white) !important;
}

/* Map widget */
.map-widget {
    margin-bottom: 24px;
}

.map-widget h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.map-container {
    width: 100%;
    height: 320px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.map-note {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

.hidden {
    display: none !important;
}

/* History items */
.history-item {
    display: flex;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
}

.history-item:last-child {
    border-bottom: none;
}

.history-period {
    width: 110px;
    flex-shrink: 0;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    padding-top: 2px;
}

.history-content strong {
    font-size: 14px;
    color: var(--text);
    display: block;
    margin-bottom: 4px;
}

.history-content p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Related links */
.related-links h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.related-card {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.related-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.related-icon {
    font-size: 20px;
    margin-right: 12px;
    flex-shrink: 0;
}

.related-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.related-arrow {
    color: var(--primary);
    font-size: 18px;
    font-weight: 300;
}

/* Footer */
.site-footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 24px 0;
    text-align: center;
    margin-top: auto;
}

.site-footer p {
    font-size: 13px;
    color: var(--text-muted);
}

.footer-links {
    margin-top: 8px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    padding: 32px;
    border-radius: var(--radius-lg);
    max-width: 420px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.modal-content h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.modal-text {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.modal-subtext {
    font-size: 12px;
    color: #999;
    margin-top: 12px;
}

.modal-subtext code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.close {
    position: absolute;
    right: 16px;
    top: 12px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.close:hover {
    color: var(--text);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .link-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-search h1 {
        font-size: 28px;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-button {
        width: 100%;
    }
    
    .person-header {
        flex-direction: column;
        text-align: center;
    }
    
    .person-avatar {
        margin-right: 0;
        margin-bottom: 12px;
    }
    
    .detail-item {
        flex-direction: column;
    }
    
    .detail-item .label {
        width: 100%;
        margin-bottom: 4px;
    }
    
    .history-item {
        flex-direction: column;
    }
    
    .history-period {
        width: 100%;
        margin-bottom: 4px;
    }
}
