:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #0a2547;
  --muted: #6d7e95;
  --brand: #00a8c6;
  --border: #dbe4ef;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.wrap {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

h1 {
  font-size: 1.3rem;
  margin: 0;
}

.section-title {
  margin: 20px 0 14px;
  font-size: 1.1rem;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding-bottom: 34px;
}

.news-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.news-link {
  color: inherit;
  text-decoration: none;
  display: block;
}

.news-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(11, 39, 76, 0.08);
}

.news-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.news-body {
  padding: 12px 14px 14px;
}

.news-meta {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 0.84rem;
}

.news-title {
  margin: 10px 0 0;
  font-size: 1.35rem;
  line-height: 1.35;
  font-weight: 700;
}

.news-category {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--brand);
  font-weight: 700;
  text-transform: uppercase;
}

.article-section {
  padding: 20px 0 40px;
}

.article-card {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

.article-cover {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
}

.article-inner {
  padding: 18px;
}

.article-inner h2 {
  margin: 0 0 10px;
}

.article-inner p {
  line-height: 1.75;
  white-space: pre-line;
}

.back-btn,
.ghost-btn,
.primary-btn {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
}

a.ghost-btn {
  display: inline-block;
  text-decoration: none;
  color: inherit;
}

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

.back-btn {
  margin-bottom: 10px;
}

.hidden {
  display: none !important;
}

.admin-panel {
  position: fixed;
  inset: 0;
  background: rgba(5, 23, 43, 0.55);
  display: grid;
  place-items: center;
  z-index: 40;
  padding: 10px;
}

.admin-content {
  width: min(760px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  padding: 14px;
}

.admin-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hint {
  font-size: 0.86rem;
  color: var(--muted);
}

.news-form {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.news-form label {
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 600;
}

.news-form input,
.news-form textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
}

.admin-news-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
}

.admin-news-item b {
  display: block;
  margin-bottom: 6px;
}

.admin-actions {
  display: flex;
  gap: 8px;
}

.admin-page {
  padding-bottom: 48px;
}

.auth-box {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 14px;
}

.auth-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-row input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
  min-width: 220px;
}

@media (max-width: 1000px) {
  .news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .news-grid {
    grid-template-columns: 1fr;
  }

  .news-title {
    font-size: 1.12rem;
  }
}
