.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.16s, filter 0.16s, background 0.16s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--gradient-brand);
  color: #041018;
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.22);
}

.btn-primary:hover {
  filter: brightness(1.07);
}

.btn-ghost {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.btn-sm {
  height: 34px;
  padding: 0 14px;
  font-size: var(--fs-xs);
  border-radius: var(--r-sm);
}

.btn .icon {
  width: 16px;
  height: 16px;
  flex: none;
}

.btn[aria-pressed="true"] {
  color: var(--brand);
  border-color: var(--brand);
  background: rgba(56, 189, 248, 0.1);
}

.panel {
  padding: 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.panel h4 {
  margin: 0 0 14px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text-3);
  text-transform: uppercase;
}

.ui-tablist {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow-x: auto;
}

.ui-tab {
  flex: none;
  padding: 8px 16px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: var(--fs-sm);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.ui-tab:hover {
  background: var(--surface-2);
  color: var(--text);
}

.ui-tab.active {
  background: var(--brand);
  color: var(--bg);
  font-weight: 600;
}

.ui-tab-count {
  margin-left: 6px;
  font-size: var(--fs-xs);
  opacity: 0.75;
}

.ui-panel {
  display: none;
}

.ui-panel.active {
  display: block;
}

.post-list {
  display: grid;
  gap: 12px;
}

.post-card {
  padding: 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease-out, border-color 0.18s ease-out;
}

.post-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.post-card.unread {
  border-left: 3px solid var(--brand);
}

.post-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.type-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--module, var(--brand));
  background: color-mix(in srgb, var(--module, var(--brand)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--module, var(--brand)) 28%, transparent);
}

.meta {
  margin-left: auto;
  color: var(--text-3);
  font-size: var(--fs-xs);
  white-space: nowrap;
}

.post-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.post-card h3 a:hover {
  color: var(--brand);
}

.post-card p {
  margin: 0 0 14px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
}

.tag.risk-high {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}

.author {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
  font-size: var(--fs-xs);
}

.chip {
  flex: none;
  height: 32px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: var(--fs-xs);
  cursor: pointer;
}

.chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.chip.active {
  color: var(--module, var(--brand));
  border-color: color-mix(in srgb, var(--module, var(--brand)) 55%, transparent);
  background: color-mix(in srgb, var(--module, var(--brand)) 10%, transparent);
}

.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: var(--sp-4);
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.risk-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-left: 3px solid var(--warning);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--warning) 8%, var(--surface));
  margin-bottom: 16px;
  font-size: var(--fs-sm);
}

.risk-banner.high {
  border-left-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}

.risk-banner strong {
  color: var(--warning);
}

.risk-banner.high strong {
  color: var(--danger);
}

.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: 8px;
}

.field .hint {
  color: var(--text-3);
  font-size: var(--fs-xs);
  margin-top: 6px;
}

.input,
.select,
.textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.input,
.select {
  height: 44px;
}

.select-sm,
.input-sm {
  height: 34px;
  flex: none;
  padding: 0 12px;
  font-size: var(--fs-xs);
}

select.select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

select.select-sm {
  background-position: right 10px center;
  padding-right: 30px;
}

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-strong, #cbd5e1);
  border-radius: 4px;
  background: var(--surface);
  display: inline-block;
  position: relative;
  vertical-align: middle;
  cursor: pointer;
}

input[type="checkbox"]:checked {
  border-color: var(--brand);
  background: var(--brand);
}

input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.textarea {
  min-height: 320px;
  line-height: 1.7;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 14px;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}

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

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

.tag-group {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  margin-bottom: 14px;
  background: var(--surface);
}

.tag-group h4 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-3);
}

.tag-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-options label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  cursor: pointer;
}

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

.pagination a,
.pagination span {
  padding: 6px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  font-size: var(--fs-xs);
  color: var(--text-2);
}

.pagination .current {
  border-color: var(--module, var(--brand));
  color: var(--module, var(--brand));
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

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

.table th {
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.notice {
  padding: 12px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--fs-sm);
  margin-bottom: 16px;
}

.notice.error {
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}

.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-3);
  border: 1px dashed var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  z-index: 60;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-card);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 0.18s, transform 0.18s;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.is-error {
  border-color: var(--danger);
  color: var(--danger);
}

.search-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  display: none;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.search-pill .search-suggest {
  left: auto;
  right: 0;
  width: min(360px, 86vw);
}

.search-suggest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: var(--fs-sm);
  text-align: left;
  cursor: pointer;
}

.search-suggest-item > span:first-child {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-suggest-item > span:last-child {
  flex: 0 0 auto;
  white-space: nowrap;
}

.search-suggest-item:hover {
  background: var(--surface-2);
}

.search-form .search-suggest {
  top: calc(100% - 2px);
}

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