:root {
	--primary: #2563eb;
	--bg: #f8fafc;
	--fg: #0f172a;
	--muted: #000000;
	--card: #ffffff;
	--border: #e2e8f0;
	--danger: #dc2626;
	--topbar-h: 56px;
	--input-pad-y: 6px;
	--input-pad-x: 8px;
}

* {
	box-sizing: border-box;
	font-weight: 600;
}

button,
input,
select,
textarea {
	font-family: inherit;
	font-weight: inherit;
	font-size: 16px;
}

input::placeholder,
textarea::placeholder {
	font-size: 16px;
}

html,
body {
	margin: 0;
	padding: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: "KaiTi", "STKaiti", "Songti SC", "Noto Serif SC", serif;
	font-weight: 600;
}

html[data-global-font='heiti'] body {
	font-family: "SimHei", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
}

html[data-global-bold='normal'] * {
	font-weight: 400 !important;
}

.global-bold-option-text--bold {
	font-weight: 700 !important;
}

.global-bold-option-text--normal {
	font-weight: 400 !important;
}

html[data-global-bold='normal'] .global-bold-option-text--bold {
	font-weight: 700 !important;
}

html[data-global-bold='normal'] .global-bold-option-text--normal {
	font-weight: 400 !important;
}

i,
em {
	font-style: normal;
}

.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: var(--topbar-h);
	padding: 0 16px;
	border-bottom: 1px solid var(--border);
	background: #ffffff;
	position: sticky;
	top: 0;
	z-index: 10;
}

.topbar .actions {
	margin-top: 0;
	height: 100%;
	align-items: center;
}

.topbar h1 {
	font-size: 18px;
	margin: 0;
}

.topbar-center {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}
.topbar-logo {
	height: 36px;
	width: auto;
	display: block;
	pointer-events: auto; 
}

.container {
	padding: 16px;
	max-width: 1080px;
	margin: 0 auto;
}

#formContainer {
	display: flex;
	flex-direction: column;
}

#formContainer > * + * {
	margin-top: 12px;
}

.home-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
}

@media (min-width: 768px) {
	.home-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.home-card {
	margin: 0;
}

.home-card .card-head {
	margin-bottom: 0;
}

.home-card-full {
	grid-column: 1 / -1;
}

.home-pending .table-wrapper {
	overflow-x: auto;
}

.card {
	background: var(--card);
	padding: 12px;
	border-radius: 8px;
	margin-bottom: 12px;
	border: 1px solid var(--border);
	box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.tutorial-body {
	--tutorial-ink: #000000;
	--tutorial-accent: #d97706;
	background: var(--bg);
	color: var(--tutorial-ink);
}

.tutorial-page {
	position: relative;
	padding: 20px 16px 32px;
}

.tutorial-grid {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 12px;
}

.tutorial-card {
	background: rgba(255, 255, 255, 0.9);
	border: 1px solid rgba(226, 232, 240, 0.9);
	border-radius: 12px;
	padding: 11px;
	box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
	backdrop-filter: blur(4px);
}

.tutorial-row {
	display: flex;
	align-items: baseline;
	gap: 6px;
	flex-wrap: wrap;
}

.tutorial-row ol {
	margin: 4px 0 0;
	padding-left: 20px;
}

.tutorial-row li {
	margin: 2px 0;
	line-height: 1.45;
}

.tutorial-row--stack {
	flex-direction: column;
	align-items: stretch;
	gap: 4px;
}

.tutorial-row--stack .tutorial-title {
	display: block;
	line-height: 1.2;
}

.tutorial-row--stack ol {
	margin: 2px 0 0;
}

.tutorial-row--stack li {
	margin: 1px 0;
}

.tutorial-bottom-grid {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
	gap: 12px;
}

.tutorial-links {
	margin: 4px 0 0;
	padding-left: 20px;
}

.tutorial-links a {
	color: #1d4ed8;
	text-decoration: underline;
}

@media (max-width: 960px) {
	.tutorial-bottom-grid {
		grid-template-columns: 1fr;
	}
}

.tutorial-title {
	font-size: 18px;
	font-weight: 600;
	letter-spacing: 0.5px;
}

.tutorial-divider {
	color: var(--tutorial-accent);
	font-weight: 600;
}

.tutorial-detail {
	font-size: 16px;
	color: #000000;
}

.font-option .font-option-text {
	font-weight: 600;
}

.font-option-kaiti .font-option-text {
	font-family: "KaiTi", "STKaiti", "Songti SC", "Noto Serif SC", serif;
}

.font-option-heiti .font-option-text {
	font-family: "SimHei", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
}

.section-card {
	background: var(--card);
	padding: 16px;
	border-radius: 8px;
	margin-bottom: 12px;
	border: 1px solid var(--border);
	box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.card-head {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 8px;
	flex-wrap: wrap;
}

.home-pending .card-head {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 12px;
}

.home-pending .card-head .card-title {
	justify-self: start;
}

.home-pending .card-head .pagination-bar {
	justify-self: center;
	margin-top: 0;
}

.home-pending .card-head #myPendingSummary {
	justify-self: end;
}

.card-title {
	font-weight: 600;
	margin: 0;
	min-width: 120px;
}

.actions-row {
	display: flex;
	gap: 8px;
	align-items: center;
	margin-left: auto;
	justify-content: flex-end;
	flex: 0 0 auto;
}

.actions-row .search {
	flex: 1;
	min-width: 200px;
	margin-right: 16px;
}

.actions-row .btn {
	flex-shrink: 0;
}

.btn {
	background: #eef2ff;
	border: 1px solid var(--border);
	color: var(--fg);
	text-decoration: none;
	padding: 6px 12px;
	border-radius: 6px;
	cursor: pointer;
}

.btn.primary {
	background: var(--primary);
	border-color: var(--primary);
	color: #fff;
}

#selfCheckBtn,
.id-with-sample #sampleBtn,
.btn.check-dup-btn {
	background: var(--primary);
	border-color: var(--primary);
	color: #fff;
}

.btn.success {
	background: #22c55e;
	border-color: #16a34a;
	color: #fff;
}

.btn.success.active {
	box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35), inset 0 0 0 1px rgba(22, 163, 74, 0.7);
}

.btn.success:disabled {
	background: #bbf7d0;
	border-color: #bbf7d0;
	color: #15803d;
	opacity: 1;
	cursor: not-allowed;
}

.btn:disabled {
	opacity: .6;
	cursor: not-allowed;
}

.search {
	flex: 1;
	padding: 6px 8px;
	border-radius: 6px;
	border: 1px solid var(--border);
	background: #ffffff;
	color: var(--fg);
}

.results {
	margin-top: 8px;
}

.result-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 6px 8px;
	border: 1px solid var(--border);
	border-radius: 6px;
	margin-bottom: 6px;
	cursor: pointer;
	background: #ffffff;
}

.result-item:hover {
	background: #f1f5f9;
}

.link {
	color: var(--primary);
	text-decoration: none;
}

.list-controls {
	display: flex;
	gap: 8px;
	margin-bottom: 12px;
	flex-wrap: wrap;
	align-items: center;
}

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

.table.user-table {
	table-layout: fixed;
}

.table th,
.table td {
	border-bottom: 1px solid var(--border);
	padding: 8px;
	text-align: left;
}

.table th.actions-col {
	width: 120px;
	text-align: center;
}

.table td.actions-cell {
	vertical-align: middle;
}

.table td.actions-cell .actions-row {
	display: flex;
	gap: 8px;
	align-items: center;
	justify-content: center;
	margin-left: 0;
}

.user-table col {
	width: auto;
}

.user-table col.col-id {
	width: 14%;
}

.user-table col.col-username {
	width: 16%;
}

.user-table col.col-role {
	width: 16%;
}

.user-table col.col-realname {
	width: 16%;
}

.user-table col.col-student {
	width: 16%;
}

.user-table col.col-actions {
	width: 20%;
}

.list-count {
	font-size: 16px;
	color: var(--muted);
	white-space: nowrap;
	padding: 4px 0;
}

.list-controls .list-count {
	margin-left: auto;
}

.pagination-count {
	margin-left: 0;
}

.pagination-bar {
	display: flex;
	gap: 8px;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	margin-top: 12px;
}

.actions-row .pagination-bar {
	margin-top: 0;
}

.pagination-bar .btn {
	padding: 4px 10px;
}

.pagination-info {
	font-size: 16px;
	color: var(--muted);
}

.pagination-input {
	appearance: textfield;
	width: 62px;
	padding: 4px 6px;
	border: 1px solid var(--border);
	border-radius: 6px;
	font-size: 16px;
	background: #ffffff;
	color: var(--fg);
}

.pagination-input::-webkit-outer-spin-button,
.pagination-input::-webkit-inner-spin-button {
	appearance: none;
	margin: 0;
}


.move-btn {
	min-width: 0;
}

.poem-readonly .add-row,
.poem-readonly .del-row,
.poem-readonly .move-btn,
.poem-readonly .check-dup-btn,
.poem-readonly #preface-toggle,
.poem-readonly #body-lock-toggle {
	display: none !important;
}

.poem-readonly .body-head-actions #preface-toggle,
.poem-readonly .body-head-actions #body-lock-toggle {
	display: inline-flex !important;
	visibility: hidden;
	pointer-events: none;
}

.body-area {
	position: relative;
}

.body-area textarea,
.body-area .body-render {
	padding-bottom: 0;
	font-size: 16px;
	line-height: 1.6;
}

.body-render {
	min-height: 48px;
}

#f-preface-render {
	min-height: 0;
}

.body-head {
	display: flex;
	align-items: center;
	gap: 12px;
	justify-content: space-between;
	margin-bottom: 4px;
}

.body-head-left {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.body-head-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
	flex-wrap: wrap;
}

.body-lock-controls {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.preface-row input {
	font-size: 16px;
	padding: 8px 10px;
	border: 1px solid var(--border);
	border-radius: 6px;
}

.body-word-count {
	font-size: 16px;
	color: var(--muted);
	background: rgba(255, 255, 255, 0.9);
	padding: 2px 10px;
	border-radius: 999px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.type-tag {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 16px;
	font-weight: 600;
	color: #0f172a;
}

.type-W {
	background: #bfdbfe;
	color: #1d4ed8;
}

.type-G {
	background: #c7d2fe;
	color: #3730a3;
}

.type-C {
	background: #bbf7d0;
	color: #047857;
}

.type-E {
	background: #fed7aa;
	color: #c2410c;
}

.type-S {
	background: #fbcfe8;
	color: #be185d;
}

.type-L {
	background: #fee2e2;
	color: #b91c1c;
}

#fltType .type-tag {
	display: inline-flex;
	align-items: center;
	cursor: pointer;
}

#fltType .type-tag input {
	margin-right: 4px;
}

#fltSub .type-tag {
	display: inline-flex;
	align-items: center;
	cursor: pointer;
}

#fltSub .type-tag input {
	margin-right: 4px;
}

.lv-subtype-picker {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.erya-subtype-picker {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.lv-subtype-btn {
	flex: 1;
	min-width: 120px;
}

.erya-subtype-picker .lv-subtype-btn {
	min-width: 0;
}

@media (max-width: 640px) {
	.erya-subtype-picker {
		grid-template-columns: 1fr;
	}
}

.type-picker-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.type-picker-cell {
	padding: 0;
	background: transparent;
	border: none;
	display: flex;
	align-items: stretch;
	justify-content: center;
}

.type-picker-btn {
	width: 100%;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-align: center;
}

.type-picker-cell--lv {
	flex-direction: column;
	gap: 0;
}

.type-picker-lv-buttons {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	width: 100%;
}

.type-picker-btn--sub {
	font-size: 16px;
}

.type-picker-btn[data-type='W'] {
	background: #bfdbfe;
	border-color: #93c5fd;
	color: #1d4ed8;
}

.type-picker-btn[data-type='G'] {
	background: #c7d2fe;
	border-color: #a5b4fc;
	color: #3730a3;
}

.type-picker-btn[data-type='C'] {
	background: #bbf7d0;
	border-color: #86efac;
	color: #047857;
}

.type-picker-btn[data-type='E'] {
	background: #fed7aa;
	border-color: #fdba74;
	color: #c2410c;
}

.type-picker-btn[data-type='S'] {
	background: #fbcfe8;
	border-color: #f9a8d4;
	color: #be185d;
}

.type-picker-btn[data-type='L'] {
	background: #fee2e2;
	border-color: #fecaca;
	color: #b91c1c;
}

.type-picker-btn:hover {
	opacity: 0.92;
}

.lv-render-target {
	margin-top: 12px;
}

.variant-card {
	display: flex;
	flex-direction: column;
	gap: 12px;
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 12px;
	margin-bottom: 12px;
	background: #fff;
}

.variant-card__head {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.variant-card textarea[data-field="sample"],
.variant-card textarea[data-field="pingze"] {
	font-size: 16px;
	line-height: 1.6;
}

.variant-card .locked-text {
	border-style: solid;
	background: #ffffff;
	margin-top: 0;
	font-size: 16px;
	line-height: 1.6;
}

.variant-lock-controls {
	display: flex;
	gap: 8px;
	margin-top: 8px;
}

.variant-lock-controls .btn {
	min-width: 0;
}

.label-row .variant-lock-controls {
	margin-top: 0;
	margin-left: auto;
}

.variant-pingze-field .pingze-mark-buttons {
	margin-left: auto;
}


.pingze-mark-buttons {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.pingze-mark-buttons .btn[data-mode="variable"] {
	background: transparent;
	border-style: dashed;
}

.pingze-mark-buttons .btn[data-mode="fixed"] {
	background: #dbeafe;
	border-color: #bfdbfe;
	color: #1d4ed8;
}

.pingze-mark-buttons .btn[data-mode="rhyme"] {
	background: #dcfce7;
	border-color: #bbf7d0;
	color: #047857;
}

.pingze-mark-buttons .btn.active {
	box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.locked-text {
	border: 1px dashed var(--border);
	border-radius: 6px;
	padding: 8px;
	margin-top: 8px;
	min-height: 48px;
	background: #f8fafc;
	font-family: inherit;
	line-height: 1.6;
	word-break: break-word;
	white-space: pre-wrap;
}

.locked-char {
	display: inline-block;
	padding: 1px 2px;
	border-radius: 4px;
	transition: background 120ms ease;
}

.locked-char--fixed {
	background: #dbeafe;
	color: #1d4ed8;
}

.locked-char--rhyme {
	background: #dcfce7;
	color: #047857;
}

.locked-char--active {
	background: #fee2e2;
	color: #b91c1c;
}

.locked-char--empty {
	color: #94a3b8;
}

.image-upload-block {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	flex-wrap: wrap;
}

.image-preview {
	width: 220px;
	height: 180px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: #f8fafc;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.image-preview img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	display: block;
}

.nature-row {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	flex-wrap: wrap;
}

.nature-intro {
	flex: 1 1 280px;
}

.nature-image-field {
	flex: 0 0 240px;
}

.image-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.label-row {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.label-row>label {
	margin-right: 4px;
}

.label-row>.image-actions {
	margin-right: auto;
}

.image-note {
	font-size: 16px;
	line-height: 1.2;
	margin-bottom: 8px;
	display: block;
	padding-top: 8px;
}

#formContainer.poem-readonly .nature-image-field .image-actions,
#formContainer.poem-readonly .nature-image-field .image-note {
	display: none !important;
}

.status-tag {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: 16px;
	line-height: 1.4;
	background: #e2e8f0;
	color: #475569;
	border: 1px solid #cbd5f5;
	white-space: nowrap;
}

.status-tag input {
	margin-right: 4px;
}

.status-tag+.status-tag {
	margin-left: 6px;
}

.status-pending {
	background: #dbeafe;
	border-color: #bfdbfe;
	color: #1d4ed8;
}

.status-rejected {
	background: #fee2e2;
	border-color: #fecaca;
	color: #b91c1c;
}

.status-approved {
	background: #dcfce7;
	border-color: #bbf7d0;
	color: #15803d;
}

.status-archived {
	background: #fef9c3;
	border-color: #fde68a;
	color: #b45309;
}


.status-default {
	background: #e2e8f0;
	border-color: #cbd5f5;
	color: #475569;
}

#metaReviewStatus,
#metaRepairStatus {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

#metaReviewStatus .status-tag,
#metaRepairStatus .status-tag {
	margin-left: 0;
}

#metaReviewStatus .status-tag,
#metaRepairStatus .status-tag,
#fltStatus .status-tag,
#fltRepair .status-tag {
	font-size: 16px;
}

.name-cell {
	max-width: 16ch;
	white-space: normal;
	overflow-wrap: break-word;
	word-break: break-word;
}

.grid-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.grid-3 {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 12px;
}

.grid-4 {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
}

.grid-1-2 {
	display: grid;
	grid-template-columns: 1fr 2fr;
	gap: 12px;
}

.field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.field.field-sample-gap {
	margin-top: 8px;
}

.field-row {
	display: flex;
	gap: 8px;
	align-items: center;
}
.field-row input,
.field-row textarea,
.field-row select {
	flex: 1 1 auto;
	min-width: 0; 
}
.field-row .link-field-display {
	flex: 1 1 auto;
	min-width: 0;
	display: block; 
}
.field-row .check-dup-btn {
	flex: 0 0 auto;
}

.field > label {
	display: block;
	min-height: 28px;
	line-height: 28px;
}

.poem-readonly .field > label { padding-right: 0; }

.poem-readonly .field-row {
	display: flex;
	align-items: center;
}
.poem-readonly .field-row .link-field-display {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	box-sizing: border-box;
	width: 100%;
}

.field input,
.field textarea,
.field select {
	padding: var(--input-pad-y) var(--input-pad-x);
	border-radius: 6px;
	border: 1px solid var(--border);
	background: #ffffff;
	color: var(--fg);
	line-height: 1.6;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="file"]).read-mode,
textarea.read-mode,
select.read-mode,
input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="file"])[readonly],
textarea[readonly],
input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="file"]):disabled,
textarea:disabled,
select:disabled,
.link-field-display,
.locked-text,
.anno-editor .anno-input {
	padding-top: var(--input-pad-y);
	padding-bottom: var(--input-pad-y);
}

.entry-row {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.entry-row .entry-card {
	flex: 1 1 0;
	margin-bottom: 12px;
}

.entry-card .link {
	display: block;
	text-align: center;
}

.card h2 {
	margin: 0 0 8px 0;
	font-size: 16px;
}

.ordered-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
}


.ordered-item .pair-order-controls {
	display: flex;
	flex-direction: row;
	gap: 2px;
	flex: 0 0 auto;
	align-items: center;
}

.ordered-item .pair-remove-controls {
	display: flex;
	flex-direction: row;
	gap: 4px;
	flex: 0 0 auto;
	align-items: center;
}

.poem-readonly .ordered-item {
	flex-wrap: nowrap;
}

.poem-readonly .ordered-item .pair-label {
	width: 10ch;
	flex: 0 0 10ch;
}

.poem-readonly .ordered-item .pair-value {
	flex: 1 1 auto;
	width: auto;
}

.ordered-item {
	display: flex;
	gap: 8px;
	align-items: center;
}

.ordered-item input {
	flex: 1;
}

.poem-readonly .pair-order-controls,
.poem-readonly .pair-remove-controls {
	display: none !important;
}

.ordered-item .pair-label {
	flex: 0 0 10ch;
	width: 10ch;
	max-width: 10ch;
}

.ordered-item .pair-value {
	flex: 1 1 auto;
	min-width: 120px;
	width: auto;
}

.muted,
.small,
.text-muted {
	font-size: 16px;
	color: var(--muted);
}

.notice {
	font-size: 16px;
	line-height: 1.6;
}

.id {
	font-weight: 700;
}

.id-with-sample {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.actions {
	display: flex;
	gap: 8px;
	align-items: center;
	margin-top: 12px;
}

.actions .divider {
	width: 1px;
	height: 20px;
	background: var(--border);
	margin: 0 8px;
	align-self: center;
}

.btn.small {
	padding: 4px 8px;
	font-size: 16px;
}

.btn.danger {
	background: #fee2e2;
	border-color: #fecaca;
	color: #dc2626;
}

.btn.danger:hover {
	background: #fecaca;
}

.error-text {
	color: var(--danger);
	font-size: 16px;
	margin-top: 6px;
}

.anno-row {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px;
	border-radius: 4px;
	margin-bottom: 4px;
	font-size: 16px;
	line-height: 1.6;
}

.anno-actions {
	display: flex;
	gap: 6px;
	align-items: center;
	flex-shrink: 0;
}

.poem-readonly .anno-actions {
	display: none !important;
}

.anno-main {
	display: flex;
	gap: 6px;
	align-items: center;
	min-width: 0;
	flex-wrap: wrap;
}

.anno-arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--muted);
	font-weight: 600;
	min-width: 18px;
	flex-shrink: 0;
}

.anno-note {
	flex: 1;
	min-width: 0;
}

.anno-note-display {
	display: block;
	font-size: 16px;
	line-height: 1.6;
	white-space: pre-wrap;
	word-break: break-word;
	cursor: text;
}

.linked-chunk {
	background: #bbf7d0;
	color: #14532d;
	border-radius: 4px;
	padding: 0 2px;
	cursor: pointer;
	transition: box-shadow 0.2s ease;
}

.linked-chunk:hover {
	box-shadow: inset 0 0 0 1px rgba(21, 128, 61, 0.6);
}

.linked-placeholder {
	background: #15803d;
	color: #ecfdf5;
	border-radius: 4px;
	padding: 0 2px;
	cursor: pointer;
	transition: box-shadow 0.2s ease;
}

.linked-placeholder:hover {
	box-shadow: inset 0 0 0 1px rgba(4, 120, 87, 0.6);
}

.link-field-display {
	padding: var(--input-pad-y) var(--input-pad-x);
	border: 1px solid var(--border);
	border-radius: 6px;
	background: #ffffff;
	line-height: 1.6;
	white-space: pre-wrap;
	word-break: break-word;
	min-height: 38px;
	cursor: text;
}

.link-field-display.empty {
	color: var(--muted);
	font-style: normal;
}

.link-field-display .linked-chunk,
.link-field-display .linked-placeholder {
	cursor: pointer;
}

.link-field-display[data-link-field^="fields.works"],
.link-field-display[data-link-field^="fields.repWorks"],
.link-field-display[data-link-field^="fields.anthos"],
.link-field-display[data-link-field^="fields.persons"] {
	display: block;
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
	max-width: none;
	padding: var(--input-pad-y) 10px;
	margin-right: 0;
}

.relation-grid.pair-grid {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 32px;
	row-gap: 12px;
	position: relative;
	padding: 0;
}

.relation-grid.pair-grid::before {
	content: '';
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 1px;
	background: var(--border);
	transform: translateX(-50%);
	pointer-events: none;
	z-index: 0;
}

.relation-grid.pair-grid .relation-inline {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 2px 0;
	min-width: 0;
	width: 100%;
	position: relative;
	z-index: 1;
}

.relation-grid.pair-grid .relation-inline>* {
	flex-shrink: 0;
}

.relation-grid.pair-grid .relation-inline .pair-label {
	flex: 0 0 16ch;
	width: 16ch;
	max-width: 16ch;
	min-width: 16ch;
}

.relation-grid.pair-grid .relation-inline .pair-label input,
.relation-grid.pair-grid .relation-inline .pair-label .link-field-display {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
}

.relation-grid.pair-grid .relation-inline .pair-value {
	flex: 1 1 auto;
	flex-shrink: 1;
	min-width: 0;
	display: flex;
}

.relation-grid.pair-grid .relation-inline .pair-value>* {
	flex: 1 1 auto;
	flex-shrink: 1;
	min-width: 0;
	width: 100%;
}

.relation-grid.pair-grid .relation-inline .pair-value input,
.relation-grid.pair-grid .relation-inline .pair-value .link-field-display {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
}

.relation-grid.pair-grid .relation-inline .link-field-display {
	flex: 1 1 auto;
	flex-shrink: 1;
	width: auto;
	max-width: none;
	min-width: 0;
}

.relation-grid.pair-grid .relation-inline .btn {
	white-space: nowrap;
}

@media (max-width: 768px) {
	.relation-grid.pair-grid {
		grid-template-columns: 1fr;
		padding: 0;
	}
	.relation-grid.pair-grid::before {
		display: none;
	}
}

.form-subtype-row {
	--subtype-gap: 32px;
	display: flex;
	flex-wrap: nowrap;
	align-items: flex-end;
	gap: var(--subtype-gap);
	justify-content: flex-start;
}

.form-subtype-row>* {
	flex: 0 0 auto;
	min-width: 0;
}

.form-subtype-row #f-form {
	flex: 0 0 33.3333%;
	min-width: 0;
}

.form-subtype-row #form-opts {
	display: flex;
	flex-wrap: nowrap;
	align-items: flex-end;
	justify-content: flex-start;
	gap: var(--subtype-gap);
	flex: 1 1 0;
	min-width: 0;
	overflow: hidden;
}

.form-subtype {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex: 1 1 0;
	min-width: 0;
	max-width: none;
	white-space: nowrap;
}

.form-subtype input,
.form-subtype select,
.form-subtype .link-field-display,
.form-subtype-row select,
.form-subtype-row input {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

.form-subtype .link-field-display,
.form-subtype-row .link-field-display {
	padding: var(--input-pad-y) 10px;
	margin: 0;
}

@media (max-width: 768px) {
	.form-subtype-row {
		flex-direction: column;
		align-items: stretch;
	}
	.form-subtype-row>*,
	.form-subtype-row #f-form,
	.form-subtype-row #form-opts,
	.form-subtype {
		flex: 1 1 100%;
		width: 100%;
		min-width: 0;
		max-width: none;
	}
	.form-subtype {
		justify-content: flex-start;
		white-space: normal;
	}
}

.toast {
	position: fixed;
	right: 12px;
	bottom: 12px;
	background: #111827;
	border: 1px solid var(--border);
	color: #fff;
	padding: 8px 12px;
	border-radius: 6px;
}

.modal {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .35);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2000;
}

.modal-card {
	width: 560px;
	max-width: 90vw;
	background: #ffffff;
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 12px;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-card-filter {
	width: 840px;
}

.filter-status-row {
	flex-wrap: nowrap;
}

.modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.modal-header-actions {
	display: flex;
	gap: 8px;
	align-items: center;
}

.modal-body {
	margin-top: 8px;
}

.dup-modal #closeDupModal {
	flex: 0 0 auto;
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 72px;
}

.export-session-row {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	min-width: 260px;
}

.export-session-text {
	display: inline-flex;
	align-items: center;
}

.export-session-actions {
	margin-left: auto;
	display: flex;
	gap: 8px;
	align-items: center;
}

.export-session-input {
	width: 120px;
}

.note-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 8px;
}

.note-item {
	display: flex;
	gap: 6px;
	margin-bottom: 0;
	align-items: center
}

.note-item input[type="text"],
.note-item input {
	flex: 1;
	min-width: 0
}

.note-item input,
.note-item textarea {
	padding: 8px;
	border: 1px solid #ddd;
	border-radius: 6px
}

.note-item .c-source {
	flex: 0 0 20ch;
	width: 20ch;
	min-width: 20ch;
	max-width: 20ch;
}

.note-item .c-content {
	flex: 1 1 auto;
	min-width: 0;
}

.poem-readonly .note-item .c-source {
	flex: 0 0 20ch;
}

.self-check-field {
	outline: 2px solid #f87171;
	outline-offset: 1px;
}

.self-check-wrapper {
	margin-top: 6px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.self-check-group {
	border-radius: 8px;
	padding: 8px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	border: 1px solid transparent;
}

.self-check-group-auto {
	background: #f0fdf4;
	border-color: #86efac;
	color: #064e3b;
}

.self-check-group-manual {
	background: #fef2f2;
	border-color: #fecaca;
	color: #991b1b;
}

.self-check-group-summary {
	font-size: 16px;
	line-height: 1.5;
	padding: 6px 8px;
	border-radius: 6px;
	font-weight: 600;
	background: rgba(255, 255, 255, 0.7);
}

.self-check-group-auto .self-check-group-summary {
	background: rgba(134, 239, 172, 0.35);
	color: #047857;
}

.self-check-group-manual .self-check-group-summary {
	background: rgba(254, 226, 226, 0.7);
	color: #b91c1c;
}

.self-check-issue-groups {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.self-check-issue-group {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding-top: 6px;
	border-top: 1px dashed rgba(15, 23, 42, 0.15);
}

.self-check-issue-label {
	font-size: 16px;
	font-weight: 600;
}

.self-check-group-auto .self-check-issue-label {
	color: #047857;
}

.self-check-group-manual .self-check-issue-label {
	color: #b91c1c;
}

.self-check-issue-detail {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.self-check-detail-block,
.self-check-auto-block {
	border-radius: 0;
	padding: 0;
	background: transparent;
	border: none;
}

.self-check-auto-detail {
	display: flex;
	flex-direction: column;
	gap: 6px;
}


.self-check-inline-snippet {
	font-size: 16px;
	line-height: 1.5;
	font-family: inherit;
	background: transparent;
	border-radius: 0;
	padding: 0;
	margin: 0;
}

.self-check-inline-note {
	margin-top: 4px;
	font-size: 16px;
	color: #94a3b8;
}

.self-check-inline-change {
	background: #fef3c7;
	color: #92400e;
	padding: 0 2px;
	border-radius: 2px;
	border-bottom: 1px dashed #fbbf24;
}

.self-check-message {
	margin-top: 0;
	padding: 0;
	border: none;
	background: transparent;
	color: inherit;
	font-size: 16px;
	line-height: 1.5;
}

.self-check-space-char {
	background: rgba(248, 113, 113, 0.35);
	border-bottom: 1px solid #ef4444;
	color: #b91c1c;
	font-family: inherit;
}

.self-check-space-char[data-space-type="space"],
.self-check-space-char[data-space-type="nbsp"] {
	display: inline-block;
	min-width: 0.35rem;
}

.self-check-space-char[data-space-type="tab"] {
	padding: 0 2px;
	font-size: 16px;
}

.self-check-space-char[data-space-type="blank-line"] {
	display: inline-flex;
	align-items: center;
	padding: 0 4px;
	font-size: 16px;
	text-transform: none;
}

.self-check-pair-list {
	margin-top: 4px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.self-check-pair-item {
	font-size: 16px;
	line-height: 1.4;
}

.self-check-pair-char {
	padding: 0 3px;
	border-radius: 3px;
	font-weight: 700;
}

.self-check-pair-char[data-pair-role="open"] {
	background: #fef3c7;
	color: #92400e;
}

.self-check-pair-char[data-pair-role="close"] {
	background: #dbeafe;
	color: #1d4ed8;
}

.self-check-illegal-list {
	margin-top: 4px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.self-check-illegal-item {
	font-size: 16px;
	line-height: 1.5;
	padding: 0;
	border-radius: 0;
	background: transparent;
	border: none;
	font-family: inherit;
}

.self-check-illegal-char {
	color: #1e3a8a;
	font-weight: 700;
	background: #dbeafe;
	padding: 0 3px;
	border-radius: 3px;
}

.self-check-punct-list {
	margin-top: 4px;
}

.self-check-punct-item {
	font-size: 16px;
	line-height: 1.4;
}

.annotation {
	background: rgba(255, 230, 150, 0.6)
}

.annotation.depth-2 {
	background: rgba(255, 200, 120, 0.75)
}

.annotation.depth-3 {
	background: rgba(255, 170, 90, 0.85)
}

#f-body-render {
	white-space: pre-wrap
}

#f-body-render .annotation {
	padding: 0 2px;
	border-radius: 2px
}

#f-body-render .annotation:hover {
	outline: 2px solid rgba(43, 108, 176, 0.18);
	cursor: pointer
}

#f-preface-render .annotation:hover {
	outline: 2px solid rgba(43, 108, 176, 0.18);
	cursor: pointer
}

.anno-list {
	display: flex;
	flex-direction: column;
	gap: 4px
}

.anno-title {
	font-size: 16px;
}

.anno-note-display.empty {
	color: var(--muted);
	font-style: normal
}

#annotation-area .annotation,
#annotation-area .annotation.depth-1,
#annotation-area .annotation.depth-2,
#annotation-area .annotation.depth-3 {
	background: none;
	color: inherit
}

.anno-editor {
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
	font-size: 16px;
	line-height: 1.6;
}

.anno-editor .anno-input {
	padding: 6px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 16px;
	line-height: 1.6;
}

#f-body-render span {
	display: inline
}