/* Hallmark · shape: app screen · genre: modern-minimal · theme: cobalt · signature: share link and QR · v2.0.0 */
/* Critique: the result and the visitor's destination stay legible on narrow screens. */
:root {
    color-scheme: light;
    --paper: #f4f8fc;
    --surface: #fff;
    --tint: #eaf2fe;
    --ink: #182b43;
    --muted: #4d6078;
    --rule: #d4e1f1;
    --input-edge: #768aa5;
    --blue: #205bcf;
    --blue-hover: #194dad;
    --blue-pressed: #163c85;
    --blue-edge: #8caee9;
    --focus: #1c57c5;
    --green: #256046;
    --green-bg: #eaf6f0;
    --red: #a22939;
    --transparent: transparent;
    --font: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
    --mono: Consolas, ui-monospace, monospace;
    --radius: 8px;
    --panel-radius: 14px;
    --measure: 68rem;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
[hidden] { display: none !important; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font);
    line-height: 1.55;
}

h1, h2, p, dl, dd { margin: 0; }
h1, h2 { min-width: 0; overflow-wrap: break-word; text-wrap: balance; }
h1 { font-size: 2.5rem; line-height: 1.18; }
h2 { font-size: 1.15rem; line-height: 1.4; }
a { color: var(--blue); text-underline-offset: 0.2em; }
button, input, select { font: inherit; }

:where(button, a, input, select):focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}

.container { width: min(calc(100% - 3rem), var(--measure)); margin-inline: auto; }

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--rule);
}

.top-bar {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 44px;
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}

.brand-mark {
    position: relative;
    flex: 0 0 30px;
    height: 30px;
    background: var(--blue);
    border-radius: var(--radius);
}

.brand-mark::before, .brand-mark::after {
    position: absolute;
    width: 12px;
    height: 8px;
    border: 2px solid var(--surface);
    border-radius: 5px;
    transform: rotate(-45deg);
    content: "";
}
.brand-mark::before { top: 8px; left: 12px; }
.brand-mark::after { top: 14px; left: 6px; }

.button, .nav-button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--transparent);
    border-radius: var(--radius);
    padding: 0.55rem 1rem;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.primary { background: var(--blue); color: var(--surface); }
.secondary { background: var(--surface); color: var(--blue); border-color: var(--rule); }
.nav-button { background: var(--transparent); color: var(--blue); padding-inline: 0.6rem; }
.full-width { width: 100%; }
.button:disabled { opacity: 0.55; cursor: not-allowed; }
.primary:active { background: var(--blue-pressed); }
.secondary:active, .nav-button:active { background: var(--tint); }

label { display: block; font-size: 0.9rem; font-weight: 700; margin-bottom: 0.42rem; }
input:not([type="hidden"]), select {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    border: 1px solid var(--input-edge);
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
}
input::placeholder { color: var(--muted); opacity: 1; }
input:focus-visible, select:focus-visible { outline-offset: 1px; }
input[aria-invalid="true"] { border-color: var(--red); }
.error { color: var(--red); margin-top: 0.6rem; }

.dashboard { padding-block: 3.5rem 4rem; }
.dashboard-heading { margin: 0 0 1.9rem; }
.dashboard-heading p { margin-top: 0.65rem; color: var(--muted); }
.home { max-width: 52rem; padding-block: 5.5rem 3rem; }
.home-heading { margin-bottom: 1.9rem; text-align: center; }
.home-heading p { margin-top: 0.65rem; color: var(--muted); }
.home-login { margin-top: 1rem; text-align: center; color: var(--muted); }
.home-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.55rem 1.2rem; }
.management-help { margin-top: 0.6rem; }
.manager-heading { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.8rem; }

.editor, .result, .link-list, .visitor-panel {
    border: 1px solid var(--rule);
    border-radius: var(--panel-radius);
    background: var(--surface);
}

.editor {
    border-color: var(--blue-edge);
    padding: 1.5rem;
}
.editor-heading, .result-heading, .list-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.editor-heading { min-height: 36px; margin-bottom: 0.6rem; }
.editor-fields, .share-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
}
.editor-fields { align-items: end; }
.editor-fields .field { min-width: 0; }
.editor-fields.create-fields { grid-template-columns: minmax(0, 1fr) minmax(9rem, 0.28fr) auto; }
.editor-fields .button { padding-inline: 1.35rem; }

.notice {
    margin-top: 1.2rem;
    color: var(--green);
    font-size: 0.93rem;
    font-weight: 600;
}

.result {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem;
    margin-top: 1.2rem;
    background: var(--tint);
}
.result-heading { justify-content: flex-start; margin-bottom: 1rem; }
.result.home-result { display: block; }
.validity-note { color: var(--muted); font-size: 0.82rem; }
.result .validity-note { margin-top: 0.55rem; }
.result-actions { display: flex; gap: 0.55rem; flex-wrap: wrap; margin-top: 0.8rem; }
.copy-feedback { color: var(--muted); font-size: 0.85rem; }
.copy-feedback:not(:empty) { margin-top: 0.65rem; }
.qr {
    display: block;
    max-width: 100%;
    height: auto;
    padding: 0.35rem;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
}

.link-list { margin-top: 2rem; }
.list-heading { padding: 1rem 1.5rem; }
.list-heading span, .link-list-header, .empty, .pagination { color: var(--muted); font-size: 0.9rem; }
.empty { border-top: 1px solid var(--rule); padding: 2rem 1.5rem; }
.link-rows { margin: 0; padding: 0; list-style: none; }
.link-list-header, .link-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 5rem 11rem;
    gap: 1rem;
    align-items: center;
    padding: 0.55rem 1.5rem;
    border-top: 1px solid var(--rule);
}
.link-list-header { background: var(--paper); }
.link-row { padding-block: 0.8rem; }
.link-text { min-width: 0; display: grid; gap: 0.2rem; }
.link-text a, #share-url { font-family: var(--mono); overflow-wrap: anywhere; }
.link-text a { font-weight: 700; }
.link-target { color: var(--muted); font-size: 0.88rem; overflow-wrap: anywhere; }
.link-text time { color: var(--muted); font-size: 0.8rem; }
.row-actions, .pagination { display: flex; gap: 0.2rem; align-items: center; }
.manager-renewal { display: flex; gap: 0.4rem; align-items: center; }
.manager-renewal select { width: auto; padding-inline: 0.55rem; }
.pagination { justify-content: center; padding: 0.8rem; border-top: 1px solid var(--rule); gap: 0.8rem; flex-wrap: wrap; }
.status { display: inline-block; font-size: 0.82rem; font-weight: 700; }
.enabled { color: var(--green); }
.disabled { color: var(--muted); }
.expired { color: var(--red); }

.narrow { width: min(calc(100% - 3rem), 32rem); margin: 6rem auto 3rem; }
.visitor-panel { padding: 2rem; border-top: 4px solid var(--blue); }
.visitor-panel h1 { font-size: 1.8rem; }
.visitor-panel > p { margin-top: 0.9rem; color: var(--muted); }
.visitor-panel > .error { color: var(--red); }
.visitor-panel > a { margin-top: 1.25rem; }
.destination { background: var(--tint); border-radius: var(--radius); padding: 1rem; margin: 1.4rem 0; }
.destination dt { color: var(--muted); font-size: 0.88rem; }
.destination dd { overflow-wrap: anywhere; font-weight: 700; margin-top: 0.2rem; }
.login-form { display: grid; gap: 1rem; margin-top: 1.35rem; }

@media (hover: hover) {
    .primary:hover { background: var(--blue-hover); }
    .secondary:hover, .nav-button:hover { background: var(--tint); border-color: var(--blue-edge); }
    .brand:hover { color: var(--blue); }
    input:not([type="hidden"]):hover, select:hover { border-color: var(--focus); }
}

@media (max-width: 620px) {
    .container, .narrow { width: calc(100% - 2rem); }
    .top-bar { min-height: 58px; }
    .dashboard { padding-top: 2rem; }
    .home { padding-top: 3rem; }
    .dashboard-heading h1, .home-heading h1 { font-size: 2rem; }
    .editor, .result, .visitor-panel { padding: 1.15rem; }
    .editor-fields, .editor-fields.create-fields { grid-template-columns: minmax(0, 1fr); }
    .result { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
    .share-fields { grid-template-columns: minmax(0, 1fr); }
    .share-fields .button { justify-self: start; }
    #share-url { font-size: 0.9rem; }
    .list-heading, .empty { padding-inline: 1rem; }
    .link-list-header { display: none; }
    .link-row { grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem; padding-inline: 1rem; }
    .link-text { grid-column: 1 / -1; }
    .row-actions { justify-content: flex-end; }
    .narrow { margin-top: 3rem; }
}
