:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --panel: #ffffff;
  --line: #d6dde5;
  --text: #17202a;
  --muted: #5a6675;
  --primary: #0f4c81;
  --primary-dark: #0b365c;
  --accent: #c97916;
  --steel: #2f3f4f;
  --green: #168a4a;
  --amber: #a45f00;
  --red: #b42318;
  --shadow: 0 10px 32px rgba(22, 34, 51, 0.10);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(15, 76, 129, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(15, 76, 129, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 20% 0%, rgba(201, 121, 22, 0.10), transparent 34%),
    #f3f5f7;
  background-size: 42px 42px, 42px 42px, auto, auto;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.public-shell {
  min-height: 100vh;
  display: grid;
  align-items: start;
  padding: 48px 24px 28px;
}

.construction-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 24px;
}

.public-intro {
  position: sticky;
  top: 28px;
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 420px;
  padding: 32px 24px;
  border-left: 5px solid var(--accent);
  background: linear-gradient(180deg, #1b2a38 0%, #243746 100%);
  color: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.public-intro h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.18;
}

.public-intro p {
  color: #d8e1ea;
}

.brand-mark {
  width: fit-content;
  min-width: 104px;
  height: 54px;
  padding: 0 14px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0;
  border-radius: 8px;
}

.support-points {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.support-points span {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #f4f7fb;
  font-weight: 600;
}

.support-points span::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 2px;
}

.privacy-note {
  margin: 8px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.admin-entry {
  width: fit-content;
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  padding: 9px 14px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

.admin-entry:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.submit-panel,
.login-panel {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.login-panel {
  width: min(420px, 100%);
  margin: 72px auto;
}

.panel-heading,
.detail-header,
.brand-block {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 28px;
  margin-bottom: 6px;
}

h2 {
  font-size: 22px;
  margin-bottom: 4px;
}

h3 {
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--muted);
}

p {
  color: var(--muted);
  line-height: 1.65;
}

.admin-link {
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}

.ticket-form,
.license-form,
.filters {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.field-block {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.field-title {
  color: var(--steel);
  font-size: 15px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  background: #fff;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.12);
}

textarea {
  min-height: 188px;
  resize: vertical;
}

.form-grid,
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.hint,
.status-text {
  color: var(--muted);
  font-size: 13px;
}

.form-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-submit-field {
  display: grid;
  gap: 4px;
  flex: 0 1 auto;
  color: var(--muted);
  font-size: 13px;
}

.inline-submit-field input,
.inline-submit-field select {
  height: 40px;
  padding: 8px 10px;
}

.version-field {
  width: 180px;
}

.category-field {
  width: 150px;
}

.optional-contact {
  border: 1px dashed #c7d1dc;
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
}

.optional-contact summary {
  color: var(--steel);
  cursor: pointer;
  font-weight: 700;
}

.optional-contact label {
  margin-top: 12px;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  border: 1px solid transparent;
  border-radius: 6px;
  min-height: 40px;
  padding: 9px 14px;
  font-weight: 600;
}

.primary-button {
  background: var(--primary);
  color: white;
}

.primary-button:hover {
  background: var(--primary-dark);
}

.secondary-button {
  color: var(--primary);
  background: #eff6ff;
  border-color: #bed4e8;
}

.ghost-button {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
}

.danger-button {
  color: white;
  background: var(--red);
}

.success-box {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #b6e3c6;
  background: #effaf3;
  border-radius: 8px;
  color: var(--green);
}

.success-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.hidden {
  display: none !important;
}

.admin-shell {
  min-height: 100vh;
}

.workspace {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #fff;
  padding: 20px;
  overflow: auto;
}

.brand-block {
  align-items: center;
  margin-bottom: 18px;
}

.brand-block h1 {
  font-size: 22px;
}

.ticket-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.ticket-item {
  display: grid;
  gap: 6px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 12px;
}

.ticket-item:hover,
.ticket-item.active {
  border-color: var(--primary);
  background: #f8fbff;
}

.ticket-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.ticket-no {
  font-weight: 700;
}

.badge {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.badge.new {
  color: var(--amber);
  background: #fff6e8;
}

.badge.seen,
.badge.processing {
  color: var(--primary);
  background: #eff6ff;
}

.badge.resolved,
.badge.closed {
  color: var(--green);
  background: #effaf3;
}

.ticket-preview {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-area {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 24px;
  overflow: auto;
}

.detail-panel,
.license-panel,
.empty-state {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 18px rgba(22, 34, 51, 0.06);
}

.empty-state {
  color: var(--muted);
}

.content-block {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 16px;
}

.content-block p {
  white-space: pre-wrap;
  color: var(--text);
}

.attachment-list,
.license-list {
  display: grid;
  gap: 8px;
}

.attachment-list a,
.license-item {
  display: block;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--primary);
  text-decoration: none;
  background: #fbfcfe;
}

.note-editor {
  margin-top: 16px;
}

.license-form {
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  align-items: end;
  margin-bottom: 14px;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-check input {
  width: auto;
}

.site-footer {
  padding: 0 20px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--primary);
}

@media (max-width: 900px) {
  .construction-shell {
    grid-template-columns: 1fr;
  }

  .public-intro {
    position: static;
    min-height: auto;
  }

  .workspace,
  .form-grid,
  .detail-grid,
  .license-form {
    grid-template-columns: 1fr;
  }

  .form-actions {
    align-items: stretch;
  }

  .inline-submit-field {
    flex: 1 1 180px;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .detail-area {
    padding: 16px;
  }
}
