:root {
    --ink: #172033;
    --muted: #667085;
    --line: #dbe4ee;
    --blue: #0c5adb;
    --cyan: #12a4b8;
    --green: #15803d;
    --orange: #f59e0b;
    --bg: #f5f8fb;
    --white: #ffffff;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.7;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { width: min(1200px, calc(100% - 36px)); margin: 0 auto; }

.topbar { background: #e8f5fb; color: #345; font-size: 13px; }
.topbar-inner { min-height: 34px; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.topbar-links { display: flex; gap: 14px; white-space: nowrap; }
.topbar a { color: #0c5adb; }

.site-header { background: var(--white); box-shadow: 0 6px 24px rgba(23, 32, 51, .06); position: sticky; top: 0; z-index: 20; }
.header-inner { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 280px; }
.brand-mark {
    width: 48px; height: 48px; display: grid; place-items: center; border-radius: 8px;
    color: #fff; font-weight: 800; font-size: 24px; background: linear-gradient(135deg, var(--blue), var(--cyan));
}
.brand strong { display: block; font-size: 22px; letter-spacing: 0; }
.brand small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.search { width: min(420px, 42vw); display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.search input { flex: 1; min-width: 0; border: 0; padding: 12px 14px; outline: none; }
.search button { border: 0; background: var(--blue); color: #fff; padding: 0 18px; cursor: pointer; }
.nav { background: var(--blue); color: #fff; }
.nav-inner { display: flex; align-items: center; overflow-x: auto; }
.nav a { padding: 14px 22px; white-space: nowrap; font-weight: 600; }
.nav a:hover { background: rgba(255,255,255,.14); }

.hero { background: linear-gradient(180deg, #edf8ff 0%, #fff 100%); padding: 58px 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(380px, .98fr); gap: 42px; align-items: center; }
.eyebrow { color: var(--blue); font-weight: 700; text-transform: uppercase; letter-spacing: 0; font-size: 13px; }
.hero h1 { font-size: clamp(34px, 5vw, 58px); line-height: 1.12; margin: 14px 0 18px; letter-spacing: 0; }
.hero p { color: #475467; font-size: 18px; margin: 0; max-width: 720px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0; }
.btn { border: 1px solid var(--line); border-radius: 6px; min-height: 44px; padding: 10px 18px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; cursor: pointer; }
.btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn.ghost { background: #fff; color: var(--blue); }
.btn.wide { width: 100%; margin-top: 12px; }
.hero-stats { display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); }
.hero-stats span { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px; color: var(--muted); font-size: 13px; }
.hero-stats strong { display: block; color: var(--ink); font-size: 18px; }
.hero-panel { position: relative; min-height: 440px; border-radius: 8px; overflow: hidden; box-shadow: 0 24px 60px rgba(12, 90, 219, .18); }
.hero-panel img { width: 100%; height: 440px; object-fit: cover; }
.service-card { position: absolute; left: 24px; bottom: 24px; right: 24px; background: rgba(255,255,255,.93); border-radius: 8px; padding: 18px; box-shadow: 0 12px 30px rgba(23,32,51,.16); }
.service-card strong { display: block; font-size: 20px; }
.service-card span { color: var(--muted); }

.section { padding: 58px 0; }
.section + .service-section { padding-top: 0; }
.section-title, .item-title { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; border-bottom: 2px solid var(--line); padding-bottom: 12px; }
.section-title span { color: var(--blue); font-weight: 800; }
.section-title h1, .section-title h2, .item-title h2 { margin: 0; line-height: 1.2; font-size: 30px; }
.section-title a, .item-title a { color: var(--blue); font-weight: 700; }
.section-title.compact { align-items: center; }
.service-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.service-grid article, .listing-grid article, .portal-side, .portal-main, .dash-side, .dash-main, .auth-card, .contact-form {
    background: #fff; border: 1px solid var(--line); border-radius: 8px;
}
.service-grid article { padding: 24px; min-height: 210px; }
.service-grid b { color: var(--cyan); font-size: 28px; }
.service-grid h3 { margin: 14px 0 8px; font-size: 22px; }
.service-grid p, .listing-grid p, .portal-side p { color: var(--muted); margin: 0; }

.band { background: #fff; padding: 54px 0; border-block: 1px solid var(--line); }
.home-category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.home-category-panel { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.home-category-panel .item-title { align-items: center; margin-bottom: 12px; padding-bottom: 10px; }
.home-category-panel .item-title h2 { font-size: 21px; }
.headline-list { list-style: none; margin: 0; padding: 0; }
.headline-list li { border-bottom: 1px dashed var(--line); }
.headline-list li:last-child { border-bottom: 0; }
.headline-list a { display: block; padding: 10px 0; color: #26344d; font-weight: 700; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.headline-list a:hover { color: var(--blue); }
.portal-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; }
.portal-main, .portal-side { padding: 22px; }
.feature-row { display: grid; grid-template-columns: minmax(0, 1fr) 52px; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.feature-row:last-child { border-bottom: 0; }
.feature-row strong { display: block; font-size: 18px; }
.feature-row em { display: block; color: var(--muted); font-style: normal; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feature-row small { color: var(--orange); font-weight: 700; text-align: right; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.news-list { list-style: none; padding: 0; margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 18px 22px; }
.news-list li { display: flex; justify-content: space-between; gap: 18px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.news-list li:last-child { border-bottom: 0; }
.news-list a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-list span { color: var(--muted); white-space: nowrap; }

.listing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.listing-grid article { padding: 20px; }
.listing-grid small { color: #fff; background: var(--green); border-radius: 4px; padding: 3px 8px; }
.listing-grid h3 { margin: 14px 0 8px; font-size: 19px; }
.listing-grid span { color: var(--muted); font-size: 13px; }

.about-band { background: #0f274a; color: #fff; padding: 62px 0; }
.about-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 40px; align-items: center; }
.about-grid h2 { font-size: 34px; line-height: 1.2; margin: 12px 0; }
.about-grid p { color: #d8e4f0; }
.about-points { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.about-points span { background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.16); border-radius: 8px; padding: 16px; }

.contact, .publish-layout { display: grid; grid-template-columns: .82fr 1.18fr; gap: 32px; align-items: start; }
.contact h2, .publish-layout h1 { font-size: 34px; line-height: 1.2; margin: 12px 0; }
.contact-form { padding: 24px; display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 700; color: #344054; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 11px 12px; font: inherit; background: #fff; }
textarea { resize: vertical; }
.notice-ok, .notice-error { border-radius: 6px; padding: 10px 12px; }
.notice-ok { background: #ecfdf3; color: #027a48; }
.notice-error { background: #fff1f3; color: #b42318; }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 30px; }
.article, .sidebar, .article-list a { background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.article { padding: 34px; }
.article h1 { font-size: 38px; line-height: 1.2; margin: 10px 0; }
.meta { color: var(--muted); margin-bottom: 22px; }
.sidebar { padding: 22px; align-self: start; }
.sidebar a { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
.article-list { display: grid; gap: 14px; }
.article-list a {
    display: flex !important;
    width: 100%;
    min-height: auto;
    padding: 20px 24px;
    align-items: flex-start;
}
.article-list-body {
    display: block !important;
    flex: 1 1 auto;
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
}
.article-list strong, .article-list em, .article-list small { display: block; width: 100%; }
.article-list strong { font-size: 21px; line-height: 1.35; }
.article-list em {
    color: var(--muted);
    font-style: normal;
    margin: 7px 0 8px;
    max-width: none;
    line-height: 1.65;
}
.empty { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 22px; }

.auth-page { min-height: 60vh; display: grid; place-items: center; padding: 54px 18px; }
.auth-card { width: min(430px, 100%); padding: 28px; display: grid; gap: 14px; box-shadow: 0 16px 50px rgba(23,32,51,.08); }
.auth-card h1 { margin: 0; }
.auth-card p { margin: 0; color: var(--muted); }
.auth-card a { color: var(--blue); font-weight: 700; }

.dashboard { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.dash-side { padding: 22px; position: sticky; top: 150px; }
.dash-side h2 { margin-top: 0; }
.dash-side a { display: block; border-top: 1px solid var(--line); padding: 11px 0; color: var(--blue); font-weight: 700; }
.dash-main { padding: 24px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f8fafc; color: #344054; white-space: nowrap; }
td a { color: var(--blue); font-weight: 700; margin-right: 8px; }
.inline-form { display: inline-flex; margin: 0 8px 0 0; }
.inline-form button { border: 0; background: none; padding: 0; color: var(--blue); font: inherit; font-weight: 700; cursor: pointer; }
.admin-form { display: grid; gap: 14px; max-width: 760px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-grid article { background: #f8fbff; border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.stat-grid strong { display: block; color: var(--blue); font-size: 34px; }
.admin-tip { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; border-radius: 8px; padding: 14px; }

.footer { background: #111827; color: #d1d5db; margin-top: 30px; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 28px; padding: 40px 0; }
.footer h3, .footer h4 { color: #fff; margin-top: 0; }
.footer a { color: #fff; }
.copyright { text-align: center; border-top: 1px solid rgba(255,255,255,.12); padding: 16px; font-size: 13px; color: #9ca3af; }
.copyright a { color: #dbeafe; margin-left: 12px; white-space: nowrap; }

@media (max-width: 920px) {
    .header-inner, .topbar-inner { flex-direction: column; align-items: stretch; padding: 14px 0; }
    .search { width: 100%; }
    .hero-grid, .portal-grid, .two-col, .about-grid, .contact, .publish-layout, .article-layout, .dashboard { grid-template-columns: 1fr; }
    .service-grid, .listing-grid, .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-stats { grid-template-columns: 1fr; }
    .dash-side { position: static; }
}

@media (max-width: 620px) {
    .wrap { width: min(100% - 24px, 1200px); }
    .brand { min-width: 0; }
    .brand strong { font-size: 18px; }
    .nav a { padding: 12px 14px; }
    .hero { padding: 34px 0; }
    .hero-panel, .hero-panel img { min-height: 280px; height: 280px; }
    .service-grid, .listing-grid, .about-points, .footer-grid, .home-category-grid { grid-template-columns: 1fr; }
    .feature-row { grid-template-columns: 1fr; }
    .feature-row small { display: none; }
    .article-list a { grid-template-columns: 1fr; }
    .article { padding: 22px; }
    .article h1 { font-size: 28px; }
    th, td { min-width: 120px; }
}
