:root {
  color: #192438;
  background: #f4f6fa;
  font-family: "Segoe UI", "Microsoft YaHei UI", system-ui, sans-serif;
  line-height: 1.5;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: #2155b8; }
button, input, textarea, select { font: inherit; }
h1, h2, h3, p { margin: 0; }

.shell { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.banner { background: #14233a; color: #dbe5f3; }
.banner .shell { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: white; font-weight: 650; text-decoration: none; }
.mark { display: grid; place-items: center; height: 34px; width: 34px; border-radius: 9px; background: #315dc2; font-size: .875rem; }
.workspace { font-size: .875rem; }
.sign-out { display: block; margin: 0; }
.sign-out button { background: #253952; padding: 6px 11px; font-size: .875rem; }
.sign-out button:hover { background: #324a69; }

main { padding-block: 38px 52px; }
h1 { margin-bottom: 23px; font-size: 2rem; line-height: 1.3; }
h2 { font-size: 1.125rem; }
.board-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 23px; }
.board-heading h1 { margin-bottom: 0; }
.panel { background: white; border: 1px solid #dce3ed; border-radius: 14px; box-shadow: 0 2px 5px #14233a08; }
.editor, .list-header { padding: 22px; }

.search { grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 12px; }
.search label { display: grid; gap: 5px; min-width: 0; }
.search input, .search select { min-width: 0; margin: 0; font-weight: 400; }
.search-actions, .search .error { grid-column: 1 / -1; }
.search-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.result-count { margin-inline-start: auto; color: #52627b; font-size: .875rem; font-variant-numeric: tabular-nums; }
.empty { border-top: 1px solid #e8edf4; min-height: 182px; padding: 32px 22px; display: grid; place-items: center; text-align: center; color: #52627b; }
.tickets { margin: 0; padding: 0; list-style: none; }
.ticket { display: flex; align-items: start; justify-content: space-between; gap: 14px; padding: 16px 22px; border-top: 1px solid #e8edf4; text-decoration: none; }
.ticket:hover { background: #f6f8fc; }
.ticket:focus-visible { outline-offset: -3px; }
.tickets li:last-child .ticket { border-radius: 0 0 13px 13px; }
.ticket-content { min-width: 0; }
.ticket h3 { margin-block: 3px; color: #192438; font-size: 1rem; overflow-wrap: anywhere; }
.ticket:hover h3, .ticket:focus-visible h3 { color: #2155b8; text-decoration: underline; }
.ticket-preview { color: #52627b; font-size: .9375rem; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ticket-attachment { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: #52627b; font-size: .875rem; }
.ticket-attachment img { width: 62px; height: 40px; border: 1px solid #dce3ed; border-radius: 6px; background: #eef2f8; object-fit: contain; }
.ticket-actions { display: grid; justify-items: end; gap: 8px; flex: none; }
.ticket-view { font-size: .875rem; }
.ticket-meta { color: #52627b; font-size: .8125rem; font-variant-numeric: tabular-nums; }
.ticket-meta span { margin-inline: 3px; }
.status { flex: none; border-radius: 999px; padding: 4px 10px; font-size: .875rem; }
.todo { color: #42516a; background: #edf1f6; }
.doing { color: #214aa0; background: #eaf0fc; }
.review { color: #775007; background: #fff1d1; }
.done { color: #21614c; background: #e5f4ed; }

form { margin-top: 18px; display: grid; gap: 7px; }
label { font-size: .9375rem; font-weight: 650; }
label small { margin-left: 4px; color: #52627b; font-weight: 400; }
input, textarea, select { width: 100%; margin-bottom: 9px; padding: 9px 11px; border: 1px solid #b9c6d8; border-radius: 8px; color: inherit; background: #fff; }
input::placeholder, textarea::placeholder { color: #586981; }
.description-editor { min-width: 0; margin-bottom: 9px; border: 1px solid #b9c6d8; border-radius: 8px; }
.description-editor:focus-within { border-color: #2863cf; }
textarea { display: block; min-height: 170px; margin: 0; border: 0; border-radius: 7px 7px 0 0; resize: vertical; }
textarea:focus-visible { outline-offset: -2px; }
.image-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 10px; border-top: 1px solid #e8edf4; padding: 8px 10px; color: #52627b; font-size: .875rem; }
.image-picker { position: relative; display: inline-flex; align-items: center; border: 1px solid #c7d4e8; border-radius: 6px; padding: 4px 8px; color: #214aa0; font-size: .875rem; cursor: pointer; }
.image-picker:hover, .image-picker:focus-within { background: #eaf0fc; }
.image-picker:focus-within { outline: 2px solid #2863cf; outline-offset: 2px; }
.image-picker input { position: absolute; inset: 0; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.image-picker input::file-selector-button { cursor: pointer; }
.image-message { margin: 0 10px 9px; color: #42516a; font-size: .875rem; }
.image-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin: 0; padding: 0 10px 10px; list-style: none; }
.image-previews:empty { display: none; }
.image-preview { min-width: 0; border: 1px solid #dce3ed; border-radius: 7px; overflow: hidden; }
.image-preview:has(input:checked) img { opacity: .35; }
.image-preview a { display: block; }
.image-preview img { display: block; width: 100%; height: 69px; object-fit: contain; background: #eef2f8; }
.image-remove { display: flex; justify-content: center; align-items: center; gap: 4px; width: 100%; border: 0; border-radius: 0; padding: 3px; background: #fff; color: #42516a; font-size: .875rem; font-weight: 400; cursor: pointer; }
.image-remove:hover { background: #eaf0fc; }
.image-preview :focus-visible { outline-offset: -3px; }
.image-remove input { width: auto; margin: 0; accent-color: #2856b8; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; white-space: nowrap; clip-path: inset(50%); }
select {
  appearance: none;
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, #52627b 50%), linear-gradient(135deg, #52627b 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
:focus-visible { outline: 2px solid #2863cf; outline-offset: 3px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
button, .primary-action { border: 1px solid transparent; border-radius: 8px; padding: 9px 15px; background: #2856b8; color: white; font-weight: 650; cursor: pointer; }
.primary-action { text-decoration: none; }
button:hover, .primary-action:hover { background: #1d4499; }
button:disabled { opacity: .65; cursor: wait; }
button.image-remove:hover { background: #eaf0fc; }
.cancel, .back { font-size: .9375rem; }
.back { display: inline-block; margin-bottom: 16px; }
.edit-page { max-width: 46rem; }
.edit-page h1 { margin: 5px 0 0; }
.login-panel { width: min(100%, 25rem); margin: 30px auto; }
.login-panel h1 { margin-bottom: 8px; font-size: 1.5rem; }
.error { border-radius: 8px; padding: 10px; background: #fff0ed; color: #9d2d20; margin-bottom: 7px; }

.save-notice { position: fixed; z-index: 1; right: 18px; bottom: 18px; max-width: calc(100% - 36px); padding: 10px 15px; border: 1px solid #cde4d9; border-radius: 8px; background: #eef8f3; color: #21614c; box-shadow: 0 2px 12px #14233a1a; }
dialog { width: min(720px, calc(100% - 32px)); max-height: min(820px, calc(100dvh - 32px)); padding: 0; overflow: hidden; border: 1px solid #dce3ed; border-radius: 14px; color: #192438; box-shadow: 0 16px 64px #14233a40; }
dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
dialog::backdrop { background: #14233a85; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-bottom: 1px solid #e8edf4; }
.dialog-actions { display: flex; align-items: center; gap: 8px; }
.dialog-edit { font-size: .875rem; white-space: nowrap; }
.dialog-close { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; background: #edf1f6; color: #42516a; font-size: 1.5rem; font-weight: 400; }
.dialog-close:hover { background: #e0e8f3; }
.dialog-body { padding: 20px 22px 24px; overflow: auto; overscroll-behavior: contain; }
.dialog-body form { margin-top: 0; }
.ticket-details { display: grid; gap: 14px; justify-items: start; }
.ticket-details[hidden] { display: none; }
.detail-title { display: flex; width: 100%; align-items: start; justify-content: space-between; gap: 12px; }
.detail-title h3 { min-width: 0; overflow-wrap: anywhere; font-size: 1.25rem; }
.detail-description { max-width: 100%; color: #34445c; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-images { width: 100%; padding: 0; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.detail-images img { height: 92px; }

@media (max-width: 760px) {
  .shell { width: calc(100% - 32px); }
  .search { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main { padding-top: 26px; }
  .editor, .list-header, .ticket, .dialog-heading, .dialog-body { padding-inline: 16px; }
}

@media (max-width: 400px) {
  .search { grid-template-columns: minmax(0, 1fr); }
}
