:root {
    --paper: #f4f1eb;
    --paper-deep: #ebe6dc;
    --ink: #171717;
    --muted: #6f6b64;
    --line: #d9d3c8;
    --red: #c63c2f;
    --red-deep: #9e2b21;
    --green: #2f6b4f;
    --white: #fff;
    --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "SimSun", serif;
    --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
    --shadow: 0 18px 50px rgba(30, 25, 18, .08);
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: var(--sans);
    line-height: 1.6;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .18;
    background-image:
        radial-gradient(circle at 15% 20%, rgba(198, 60, 47, .08), transparent 34%),
        radial-gradient(circle at 85% 8%, rgba(23, 23, 23, .05), transparent 28%),
        repeating-linear-gradient(0deg, rgba(23, 23, 23, .018) 0, rgba(23, 23, 23, .018) 1px, transparent 1px, transparent 4px);
    z-index: 0;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

button {
    color: inherit;
}

img {
    max-width: 100%;
}

.flash-stack {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 100;
    display: grid;
    gap: 8px;
    max-width: min(420px, calc(100vw - 36px));
}

.flash {
    padding: 12px 16px;
    border: 1px solid var(--line);
    background: var(--white);
    box-shadow: var(--shadow);
    font-size: 14px;
}

.flash-success {
    border-left: 4px solid var(--green);
}

.flash-error {
    border-left: 4px solid var(--red);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid var(--ink);
    background: var(--ink);
    color: var(--white);
    text-decoration: none;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.btn:hover {
    background: var(--red);
    border-color: var(--red);
}

.btn-secondary {
    background: transparent;
    color: var(--ink);
}

.btn-secondary:hover {
    background: var(--ink);
    color: var(--white);
    border-color: var(--ink);
}

.btn-danger {
    background: transparent;
    color: var(--red);
    border-color: rgba(198, 60, 47, .45);
}

.btn-danger:hover {
    background: var(--red);
    color: var(--white);
    border-color: var(--red);
}

.flash-error,
.field-error {
    color: var(--red-deep);
}

[hidden] {
    display: none !important;
}
