:root {
    --bg: #f5efe5;
    --bg-strong: #f0e6d6;
    --surface: rgba(255, 250, 243, 0.92);
    --surface-strong: #fffdf9;
    --ink: #1f2937;
    --muted: #5b6471;
    --line: rgba(140, 112, 76, 0.18);
    --accent: #0f766e;
    --accent-strong: #115e59;
    --danger: #c2410c;
    --shadow: 0 20px 45px rgba(31, 41, 55, 0.12);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: "Trebuchet MS", "PingFang SC", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 32%),
        radial-gradient(circle at right 10%, rgba(217, 119, 6, 0.12), transparent 26%),
        linear-gradient(180deg, #fbf7f0 0%, var(--bg) 100%);
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

.page-glow {
    position: fixed;
    inset: auto;
    width: 18rem;
    height: 18rem;
    border-radius: 999px;
    filter: blur(18px);
    opacity: 0.55;
    pointer-events: none;
}

.glow-a {
    top: -4rem;
    right: -4rem;
    background: rgba(15, 118, 110, 0.14);
}

.glow-b {
    left: -5rem;
    bottom: 14rem;
    background: rgba(217, 119, 6, 0.1);
}

.shell {
    position: relative;
    width: min(1120px, calc(100% - 1.25rem));
    margin: 0 auto;
    padding: 1rem 0 3rem;
}

.site-header {
    position: sticky;
    top: 0.75rem;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
    background: rgba(255, 251, 245, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 22px;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--accent), #14b8a6);
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-text strong {
    font-family: Georgia, "Songti SC", serif;
    font-size: 1.15rem;
    line-height: 1.2;
}

.brand-text small {
    color: var(--muted);
    font-size: 0.8rem;
}

.header-actions,
.detail-actions {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.main-content {
    display: grid;
    gap: 1rem;
}

.hero-panel,
.page-panel,
.danger-panel {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    animation: rise-in 0.45s ease both;
}

.hero-panel,
.page-panel,
.danger-panel {
    padding: 1.15rem;
}

.danger-panel {
    display: grid;
    gap: 1rem;
    border-color: rgba(194, 65, 12, 0.16);
    background: linear-gradient(180deg, rgba(255, 250, 245, 0.96), rgba(255, 245, 238, 0.96));
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-head.compact {
    margin-bottom: 0.8rem;
}

.eyebrow {
    margin: 0 0 0.4rem;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    font-family: Georgia, "Songti SC", serif;
    line-height: 1.2;
}

h1 {
    font-size: 1.9rem;
}

h2 {
    font-size: 1.2rem;
}

.hero-copy,
.panel-copy,
.empty-state p,
.danger-panel p {
    margin: 0.55rem 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.search-form {
    display: grid;
    gap: 0.55rem;
}

.field-label {
    display: inline-block;
    font-weight: 700;
    font-size: 0.92rem;
}

.search-row,
.sticky-actions,
.action-grid {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.search-row input,
.field input[type="text"],
.field input[type="search"],
.field textarea,
.field input[type="file"] {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--ink);
    padding: 0.95rem 1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.field textarea {
    resize: vertical;
    min-height: 14rem;
    line-height: 1.6;
}

.field-hint,
.field-note {
    margin: 0.55rem 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.card-grid,
.media-grid {
    display: grid;
    gap: 1rem;
}

.material-card,
.media-card,
.content-card,
.empty-state {
    background: var(--surface-strong);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(31, 41, 55, 0.08);
}

.material-card {
    animation: rise-in 0.45s ease both;
}

.card-cover {
    position: relative;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.18), rgba(217, 119, 6, 0.15));
}

.card-cover img,
.media-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.empty-cover {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: var(--muted);
    font-weight: 700;
}

.cover-badge {
    position: absolute;
    right: 0.8rem;
    bottom: 0.8rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(31, 41, 55, 0.72);
    color: white;
    font-size: 0.8rem;
}

.card-content,
.media-card-body,
.content-card {
    padding: 1rem;
}

.card-meta,
.media-name {
    color: var(--muted);
    font-size: 0.9rem;
}

.card-content h2 {
    margin-top: 0.35rem;
}

.card-summary {
    margin: 0.65rem 0 1rem;
    color: var(--ink);
    line-height: 1.6;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.8rem;
    padding: 0.7rem 1rem;
    border-radius: 16px;
    font-weight: 700;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.button:hover,
.button:focus-visible {
    transform: translateY(-1px);
}

.button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid rgba(15, 118, 110, 0.28);
    outline-offset: 2px;
}

.button.primary {
    background: linear-gradient(135deg, var(--accent), #14b8a6);
    color: white;
    box-shadow: 0 12px 24px rgba(15, 118, 110, 0.2);
}

.button.secondary {
    background: white;
    color: var(--ink);
    border: 1px solid var(--line);
}

.button.ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid rgba(91, 100, 113, 0.18);
}

.button.muted {
    background: rgba(91, 100, 113, 0.1);
    color: var(--muted);
}

.button.danger {
    background: linear-gradient(135deg, var(--danger), #ea580c);
    color: white;
    box-shadow: 0 12px 24px rgba(194, 65, 12, 0.18);
}

.button.large {
    min-height: 3.1rem;
    padding-inline: 1.2rem;
}

.button.wide,
.action-grid > .wide,
.action-grid > form,
.action-grid > .button,
.action-grid > a {
    flex: 1 1 calc(50% - 0.35rem);
}

.button.disabled,
.button:disabled {
    opacity: 0.55;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

.stack-form {
    display: grid;
    gap: 1rem;
}

.field {
    display: grid;
    gap: 0.5rem;
}

.sticky-actions {
    position: sticky;
    bottom: 0.75rem;
    padding-top: 0.5rem;
}

.media-grid {
    grid-template-columns: 1fr;
}

.media-card {
    display: grid;
    gap: 0;
}

.media-card img {
    aspect-ratio: 4 / 3;
}

.message {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    font-weight: 700;
}

.message.error {
    background: rgba(194, 65, 12, 0.12);
    color: var(--danger);
}

.content-card h2 {
    margin-bottom: 0.75rem;
}

.content-text {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.7;
    font-family: "Trebuchet MS", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 1rem;
}

.empty-state {
    display: grid;
    place-items: center;
    gap: 0.4rem;
    padding: 1.5rem;
    text-align: center;
}

.empty-state.compact {
    padding: 1.2rem;
}

.copy-source {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
}

.copy-source.manual-copy-active {
    position: fixed;
    inset: auto 0 1rem 0;
    width: calc(100% - 1.5rem);
    min-height: 14rem;
    margin: 0 auto;
    padding: 1rem;
    border: 2px solid rgba(15, 118, 110, 0.35);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.98);
    color: var(--ink);
    box-shadow: var(--shadow);
    opacity: 1;
    z-index: 60;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 1rem;
    z-index: 50;
    min-width: 12rem;
    max-width: calc(100% - 2rem);
    padding: 0.85rem 1rem;
    border-radius: 16px;
    background: rgba(31, 41, 55, 0.9);
    color: white;
    text-align: center;
    box-shadow: var(--shadow);
    transform: translate(-50%, 120%);
    opacity: 0;
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.toast.show {
    transform: translate(-50%, 0);
    opacity: 1;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 720px) {
    .shell {
        width: min(1120px, calc(100% - 2rem));
        padding-top: 1.25rem;
    }

    .hero-panel {
        display: grid;
        grid-template-columns: 1.3fr 0.9fr;
        gap: 1.5rem;
        align-items: center;
    }

    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 719px) {
    .site-header,
    .panel-head,
    .header-actions,
    .detail-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .brand {
        width: 100%;
    }

    .search-row {
        flex-direction: column;
    }

    .button.wide,
    .action-grid > form,
    .action-grid > .button,
    .action-grid > a {
        flex-basis: 100%;
    }
}
