:root {
    color-scheme: light;
    --primary: #1d4ed8;
    --primary-dark: #1e3a8a;
    --border: #dbe4f0;
    --muted: #64748b;
    --background: #f4f7fb;
    --card: #ffffff;
    --text: #0f172a;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: linear-gradient(135deg, #f8fbff 0%, var(--background) 100%);
    color: var(--text);
    line-height: 1.55;
}

body.embed-page { background: #fff; }

a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

.wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px;
}
.wrap--wide { max-width: 1160px; }
.wrap--narrow { max-width: 720px; padding-top: 72px; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    padding: 24px;
}
.page-title { margin: 0; color: var(--primary-dark); font-size: 1.7rem; }
.page-intro { margin-top: 4px; margin-bottom: 20px; }

.search-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 18px;
}
.field { flex: 1; }
label { display: block; font-size: .92rem; font-weight: 700; margin-bottom: 6px; color: #334155; }
input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    font: inherit;
}
input:focus { outline: 3px solid #bfdbfe; border-color: var(--primary); }

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    padding: 10px 16px;
    border: 0;
    border-radius: 9px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.button:hover { background: var(--primary-dark); color: #fff; }
.button--secondary { background: #eff6ff; color: var(--primary); }
.button--secondary:hover { background: #dbeafe; color: var(--primary-dark); }

.notice {
    margin-bottom: 16px;
    padding: 12px 14px;
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    border-radius: 8px;
    color: #1e3a8a;
}
.notice--neutral { color: #475569; background: #f8fafc; border-left-color: #94a3b8; }
.notice--error { color: #991b1b; background: #fef2f2; border-left-color: #ef4444; }
.empty-state { padding: 24px; text-align: center; color: var(--muted); }
.empty-state h1 { color: var(--primary-dark); }

.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.result-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    min-height: 148px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .04);
}
.result-photo {
    width: 112px;
    height: 128px;
    border-radius: 9px;
    object-fit: cover;
    background: #e2e8f0;
    flex: 0 0 auto;
}
.result-photo--placeholder { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .8rem; text-align: center; }
.result-content { min-width: 0; }
.result-content h2 { margin: 0 0 8px; font-size: 1.05rem; line-height: 1.3; }
.result-content p { margin: 4px 0; color: #475569; font-size: .92rem; }
.profile-links { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 9px; }
.profile-links a { font-size: .9rem; font-weight: 650; }

.pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid #e2e8f0; color: var(--muted); }
.pagination > :last-child { text-align: right; }

.back-link { display: inline-block; margin-bottom: 18px; font-weight: 700; text-decoration: none; }
.back-link::before { content: "← "; }
.hero { display: flex; gap: 26px; align-items: flex-start; }
.photo-frame { flex: 0 0 auto; padding: 8px; border-radius: 24px; background: linear-gradient(135deg, #dbeafe, #eff6ff); box-shadow: 0 10px 25px rgba(29, 78, 216, .16); }
.detail-photo { display: block; width: 280px; height: 340px; object-fit: cover; border: 3px solid #fff; border-radius: 18px; background: #e2e8f0; }
.detail-photo--placeholder { display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 600; }
.detail-content { flex: 1; min-width: 0; }
.detail-content h1 { margin: 0; color: var(--primary-dark); font-size: 1.85rem; line-height: 1.2; }
.muted { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 13px 0 20px; }
.chip { display: inline-block; padding: 7px 12px; border: 1px solid #bfdbfe; border-radius: 999px; background: #eff6ff; color: var(--primary-dark); font-size: .92rem; font-weight: 650; }
.detail-section { margin-top: 20px; padding: 18px; border: 1px solid #edf2f7; border-radius: 15px; background: #fbfdff; }
.detail-section h2 { margin: 0 0 10px; color: var(--primary-dark); font-size: 1.08rem; }
.history-list { margin: 0; padding-left: 22px; }
.history-list li { margin-bottom: 7px; color: #334155; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; border: 1px solid #e2e8f0; background: #fff; }
th, td { padding: 11px 13px; border-bottom: 1px solid #e2e8f0; text-align: left; vertical-align: top; }
th { background: #eff6ff; color: var(--primary-dark); }
tbody tr:nth-child(even) { background: #f8fbff; }
code { padding: 2px 5px; border-radius: 4px; background: #e2e8f0; }

@media (max-width: 760px) {
    .wrap { padding: 12px; }
    .card { padding: 16px; border-radius: 13px; }
    .search-form { flex-direction: column; align-items: stretch; }
    .result-grid { grid-template-columns: 1fr; gap: 12px; }
    .hero { flex-direction: column; align-items: center; }
    .detail-photo { width: 220px; height: 280px; }
    .detail-content h1 { text-align: center; font-size: 1.5rem; }
    .detail-content > .muted { text-align: center; }
    .chips { justify-content: center; }
}

@media (max-width: 480px) {
    .wrap { padding: 8px; }
    .result-card { flex-direction: column; align-items: center; text-align: center; }
    .result-photo { width: 92px; height: 102px; }
    .profile-links { justify-content: center; }
    .pagination { grid-template-columns: 1fr; text-align: center; }
    .pagination > :last-child { text-align: center; }
}
