* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', 'Yu Gothic UI', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  color: #0f172a;
  background: #f1f5f9;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.cn-hidden {
  display: none !important;
}

.cn-web-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.cn-web-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cn-web-logo {
  font-size: 24px;
}

.cn-web-brand h1 {
  margin: 0;
  font-size: 18px;
  color: #0369a1;
  display: inline-block;
}

.cn-web-version {
  margin-left: 8px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 700;
}

.cn-web-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cn-web-pill {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.cn-web-btn {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.cn-web-btn:hover {
  background: #f8fafc;
}

.cn-web-primary {
  border: none;
  background: #0284c7;
  color: #ffffff;
}

.cn-web-primary:hover {
  background: #0369a1;
}

.cn-web-danger {
  border-color: #fca5a5;
  color: #b91c1c;
}

.cn-web-danger:hover {
  background: #fee2e2;
}

.cn-web-full {
  width: 100%;
}

.cn-web-alert {
  padding: 8px 18px;
  background: #fef3c7;
  border-bottom: 1px solid #fcd34d;
  color: #92400e;
  font-size: 12px;
}

.cn-web-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 300px 1fr;
}

@media (max-width: 760px) {
  .cn-web-main {
    grid-template-columns: 1fr;
    grid-template-rows: 240px 1fr;
  }
}

.cn-web-sidebar {
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.cn-web-sidebar-top {
  padding: 12px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cn-web-sidebar-top input[type="search"],
.cn-web-filter-row select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  font-size: 13px;
}

.cn-web-filter-row {
  display: flex;
  gap: 6px;
}

.cn-web-import-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  background: #f8fafc;
}

.cn-web-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cn-web-item {
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  background: #ffffff;
}

.cn-web-item:hover {
  background: #f8fafc;
}

.cn-web-item.cn-selected {
  border-color: #0284c7;
  background: #f0f9ff;
}

.cn-web-item-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cn-web-item-meta {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cn-web-empty {
  padding: 20px;
  text-align: center;
  font-size: 12px;
  color: #64748b;
}

.cn-web-editor-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 16px;
}

.cn-web-editor-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 14px;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
}

.cn-web-editor-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fefce8;
  border: 1px solid #fde047;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.cn-web-editor-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(202, 138, 4, 0.25);
}

.cn-web-title-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  outline: none;
}

.cn-web-editor-actions {
  display: flex;
  gap: 6px;
}

.cn-web-meta-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 14px;
  font-size: 12px;
  background: rgba(254, 240, 138, 0.35);
  border-bottom: 1px solid rgba(202, 138, 4, 0.18);
}

.cn-web-meta-bar select {
  padding: 3px 6px;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
}

.cn-web-muted {
  color: #64748b;
}

.cn-web-body-input {
  flex: 1;
  width: 100%;
  border: none;
  resize: none;
  padding: 14px;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.65;
  color: #1e293b;
  outline: none;
}

.cn-web-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.cn-web-modal-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
}

.cn-web-modal-wide {
  max-width: 620px;
}

.cn-web-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cn-web-modal-head h3,
.cn-web-modal-card h3 {
  margin: 0;
  font-size: 16px;
}

.cn-web-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.cn-web-field label {
  font-size: 12px;
  font-weight: 700;
}

.cn-web-field input,
.cn-web-field select {
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  font-size: 13px;
}

.cn-web-field small {
  color: #64748b;
  font-size: 11px;
}

.cn-web-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.cn-web-pre {
  margin-top: 12px;
  padding: 10px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  font-size: 11px;
  max-height: 220px;
  overflow: auto;
}
