﻿:root {
  --bg: #f9fafb;
  --card: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-2: #10b981;
  --border: #e5e7eb;
  --hover: #f3f4f6;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 24px rgba(17, 24, 39, 0.08);
}

* { box-sizing: border-box; }

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

header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

header .brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand h1,
.brand-title {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.2px;
  font-weight: 700;
}

.brand-subtitle {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.3px;
}

nav a {
  margin-right: 12px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
}

nav a:hover { color: var(--ink); }

.lang-toggle button {
  border: 1px solid var(--border);
  background: var(--card);
  padding: 6px 10px;
  margin-left: 6px;
  cursor: pointer;
  font-weight: 600;
  border-radius: 8px;
}

.lang-toggle button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: center;
  background: var(--card);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.hero h2 { margin-top: 0; }

.search-shell {
  margin-top: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.search-form {
  display: grid;
  gap: 10px;
}

.search-row {
  display: grid;
  grid-template-columns: 180px 180px minmax(240px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.search-form-list {
  margin-bottom: 12px;
}

.search-form-list .search-row {
  grid-template-columns: 220px minmax(260px, 1fr) auto;
}

.search-field {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.search-field-wide {
  min-width: 0;
}

.search-feedback {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.section {
  margin-top: 28px;
}

.section h3 {
  margin-bottom: 12px;
  border-left: 6px solid var(--accent);
  padding-left: 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.card a { color: var(--accent); text-decoration: none; font-weight: 600; }

.badge {
  display: inline-block;
  background: #eef2ff;
  border: 1px solid #e0e7ff;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  color: #3730a3;
  font-weight: 600;
}

.footer {
  margin-top: 48px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th, .table td {
  border-bottom: 1px solid var(--border);
  padding: 10px;
  text-align: left;
  font-size: 14px;
}

.admin-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  font-family: inherit;
  background: #fff;
}

.button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.button.secondary {
  background: var(--accent-2);
  color: #ffffff;
}

.notice {
  padding: 10px 12px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 10px;
  margin-bottom: 12px;
}

.home-layout.compact {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-top: 22px;
}

.home-left {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-content: start;
}

.home-left .panel.full {
  grid-column: 1 / -1;
}

.home-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.home-left .panel .panel-header {
  align-items: flex-start;
  min-height: 58px;
}

.home-left .panel .panel-title {
  min-height: 58px;
  align-items: flex-start;
}

.panel-subtitle {
  margin: 0 0 10px 0;
  font-size: 12px;
  color: var(--muted);
}

.panel-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
}

.panel-icon.blue { background: var(--accent); }
.panel-icon.green { background: var(--accent-2); }
.panel-icon.amber { background: #f59e0b; }
.panel-icon.neutral {
  background: #f3f4f6;
  color: #111827;
}

.panel-icon svg {
  width: 16px;
  height: 16px;
}

.panel-link {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.stack {
  display: grid;
  gap: 10px;
}

.stack .card {
  background: var(--hover);
  border-left: 4px solid var(--accent);
  box-shadow: none;
}

.home-left .stack .card {
  min-height: 152px;
}

.home-left .stack .card-title {
  min-height: 34px;
}

.home-left .stack .card-summary {
  min-height: 34px;
}

.card-title {
  font-weight: 600;
  font-size: 14px;
  margin: 0 0 4px 0;
}

.card-summary {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 6px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.card-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.empty {
  font-size: 12px;
  color: var(--muted);
  padding: 8px 0;
}

.deadline-item {
  background: var(--hover);
  border-radius: 12px;
  padding: 10px 12px;
  border-left: 4px solid #f59e0b;
  display: grid;
  gap: 6px;
}

.deadline-date {
  font-size: 12px;
  font-weight: 700;
  color: #b45309;
}

.news-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.news-item:last-child { border-bottom: none; }

.news-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 4px 0;
}

.news-summary {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 4px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-date {
  font-size: 11px;
  color: var(--muted);
}

.news-content {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.5;
  white-space: pre-wrap;
}

.news-preview-card {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.news-preview-card:hover {
  border-color: #bfdbfe;
  box-shadow: var(--shadow-md);
}

.news-preview-active {
  border-color: var(--accent);
}

.news-detail-wrap {
  max-width: 860px;
}

.news-card .news-date {
  margin-bottom: 6px;
}

.news-card .news-summary {
  margin-bottom: 8px;
}

.news-article {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 34px;
  box-shadow: var(--shadow-sm);
}

.news-article-title {
  margin: 0 0 18px 0;
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.news-article-date {
  font-size: 18px;
  color: #1f2937;
  margin: 0 0 18px 0;
}

.news-article-lead {
  font-size: 24px;
  line-height: 1.52;
  color: #111827;
  margin: 0 0 26px 0;
}

.news-article-body {
  font-size: 22px;
  line-height: 1.72;
  color: #111827;
  margin-bottom: 18px;
}

.news-article-body p {
  margin: 0 0 18px 0;
}

.news-article-tags {
  font-size: 20px;
  line-height: 1.55;
  margin: 8px 0 20px 0;
  color: #111827;
}

.news-article-meta-title {
  font-size: 15px;
  font-weight: 700;
  margin: 10px 0 6px 0;
  color: #111827;
}

.news-article-source {
  display: inline;
  color: var(--accent);
  text-decoration: underline;
  font-weight: 500;
  word-break: break-all;
}

.news-article-source:hover {
  text-decoration-thickness: 2px;
}

.calendar-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cal-title {
  font-size: 16px;
  font-weight: 600;
}

.cal-nav {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
  font-weight: 600;
}

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-day {
  min-height: 88px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  font-size: 13px;
  border: 1px solid transparent;
  cursor: pointer;
  background: #fff;
  padding: 6px 6px 8px 6px;
  text-align: left;
}

.cal-day.muted {
  color: #c4c7cf;
}

.cal-day.today {
  border-color: #111827;
}

.cal-day.has {
  background: var(--hover);
  color: var(--ink);
  border: 1px solid var(--border);
}

.cal-day.selected {
  outline: 2px solid #111827;
  outline-offset: 2px;
}

.cal-day-num {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}

.cal-day-items {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cal-item-mini {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  min-height: 16px;
}

.cal-item-more {
  font-size: 10px;
  font-weight: 700;
  opacity: 0.95;
}

.cal-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 8px;
  background: #16a34a;
  margin-top: 2px;
}

.cat-lang .cal-dot { background: #b7791f; }
.cat-prof .cal-dot { background: #2563eb; }
.cat-other .cal-dot { background: #16a34a; }

.cal-item-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 9px;
  line-height: 1.15;
  color: inherit;
}

.calendar-list {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.calendar-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}

.calendar-item-title {
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-item-date {
  font-size: 12px;
  color: var(--muted);
}

.calendar-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 10px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
}

@media (max-width: 900px) {
  .home-layout.compact { grid-template-columns: 1fr; }
  .home-left { grid-template-columns: 1fr; }
  .search-row,
  .search-form-list .search-row { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; }
  nav { display: none; }
  .news-article { padding: 22px; }
  .news-article-title { font-size: 30px; }
  .news-article-lead { font-size: 20px; }
  .news-article-body { font-size: 18px; line-height: 1.66; }
  .news-article-tags { font-size: 17px; }
  .news-article-date { font-size: 16px; }
}
