:root {
    --bg: #f4efe6;
    --paper: #fffaf2;
    --ink: #222222;
    --subtle: #6f665b;
    --accent: #bb4d00;
    --accent-soft: #ffe7d0;
    --line: #e7d7c0;
    --danger: #b42318;
    --success: #18794e;
    --shadow: 0 18px 40px rgba(80, 48, 16, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top right, rgba(255, 214, 170, 0.45), transparent 28%),
        linear-gradient(180deg, #fbf4ea 0%, var(--bg) 100%);
}

a {
    color: var(--accent);
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

.wrap {
    width: min(1120px, calc(100vw - 32px));
    margin: 0 auto;
}

.site-header {
    border-bottom: 1px solid var(--line);
    background: rgba(255, 250, 242, 0.88);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 18px 0;
}

.header-inner h1 {
    margin: 0;
    font-size: 28px;
}

.nav {
    display: flex;
    gap: 16px;
}

.nav a {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--subtle);
}

.nav a.active,
.nav a:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.main-layout {
    padding: 28px 0 48px;
    display: grid;
    gap: 20px;
}

.card {
    background: var(--paper);
    border: 1px solid rgba(187, 77, 0, 0.08);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 24px;
}

.hero-card {
    position: relative;
    overflow: hidden;
}

.hero-card::after {
    content: "";
    position: absolute;
    inset: auto -60px -80px auto;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(187, 77, 0, 0.18) 0%, transparent 70%);
}

.muted {
    color: var(--subtle);
}

.form-grid,
.filters,
.button-row,
.section-title,
.cookie-form {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.form-grid {
    margin: 18px 0 12px;
    align-items: stretch;
}

.form-grid label {
    min-width: 72px;
    padding-top: 11px;
}

input[type="url"],
input[type="text"],
input[type="date"],
select {
    flex: 1;
    min-width: 180px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
}

button,
.actions button {
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    padding: 11px 18px;
    cursor: pointer;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.button-link {
    display: inline-block;
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    padding: 11px 18px;
}

.button-link.secondary {
    background: #fff1e4;
    color: var(--accent);
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

button:hover:not(:disabled),
.actions button:hover {
    transform: translateY(-1px);
}

.analysis-card,
.status-panel {
    margin-top: 16px;
    padding: 18px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--line);
}

.empty-state,
.empty-row {
    color: var(--subtle);
    text-align: center;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.actions a {
    display: inline-block;
    padding: 9px 12px;
    border-radius: 10px;
    background: #fff1e4;
}

.cookie-list {
    padding-left: 18px;
}

pre {
    white-space: pre-wrap;
    word-break: break-word;
    background: #211d1a;
    color: #f7f0e9;
    border-radius: 14px;
    padding: 16px;
    max-height: 420px;
    overflow: auto;
}

.media-player {
    width: 100%;
    max-height: 72vh;
    margin: 16px 0;
    border-radius: 16px;
    background: #000;
}

.media-image {
    display: block;
    width: 100%;
    max-height: 72vh;
    object-fit: contain;
    margin: 16px 0;
    border-radius: 16px;
    background: #f5efe8;
}

.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    min-width: 220px;
    max-width: 360px;
    background: #1f1a16;
    color: #fff;
    padding: 14px 16px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav {
        width: 100%;
        overflow-x: auto;
    }

    .form-grid label {
        min-width: auto;
        padding-top: 0;
    }
}
