/* =========================================================
   Civic service desk redesign
   Stable homepage/header/footer layout in one stylesheet
   ========================================================= */
:root {
    --civic-blue: #1455d9;
    --civic-blue-deep: #0b2f76;
    --civic-ink: #17223b;
    --civic-line: #d9e3f0;
    --civic-card: #ffffff;

    --ink: #0d0f14;
    --muted: #6b7280;
    --line: #e2e4e8;
    --bg: #f5f6f8;
    --accent: #1a2b4c;
    --accent-deep: #101d34;
    --footer-bg: #14161b;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    min-height: 100%;
    margin: 0;
    color: var(--civic-ink);
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover, a:focus { text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; }
button, input { font-family: inherit; }
button:focus, input:focus, a:focus { outline: 2px solid rgba(20, 85, 217, .28); outline-offset: 2px; }
.overflow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clearfix { clear: both; }

#topbar {
    min-height: 36px;
    height: auto;
    line-height: 36px;
    color: rgba(255,255,255,.76);
    border: 0;
    background: var(--civic-blue-deep);
    font-size: 12px;
}
#topbar .left-name,
#topbar .links > li,
#topbar a { color: rgba(255,255,255,.76); }
#topbar a:hover,
#topbar .color-text { color: #fff; }
#topbar .dropdown-menu a { color: var(--civic-ink); }

#main { min-height: 520px; padding-bottom: 44px; }
#content.info-content { width: 100%; }
.breadcrumb,
.panel,
.well {
    border: 1px solid var(--civic-line);
    border-radius: 16px;
    background: var(--civic-card);
    box-shadow: 0 10px 30px rgba(23, 34, 59, .06);
}

/* Header */
.site-header {
    border-bottom: 1px solid var(--line);
    background: #fff;
}
.site-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.site-header-row-top {
    padding: 18px 0 14px;
}
.site-header-row-bottom {
    padding: 14px 0 18px;
    border-top: 1px solid var(--line);
}
.site-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.site-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    background: var(--accent);
}
.site-brand-name {
    color: var(--ink);
    font-size: 18px;
    font-weight: 700;
}
.site-nav {
    display: flex;
    gap: 26px;
}
.site-nav a {
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}
.site-nav a:hover { color: var(--accent); }
.site-search {
    display: flex;
    align-items: center;
    flex: 0 1 480px;
    min-width: 260px;
    min-height: 40px;
    border: 1px solid var(--line);
}
.site-search i { padding: 0 12px; color: var(--muted); }
.site-search input {
    flex: 1;
    height: 40px;
    border: 0;
    color: var(--ink);
    background: transparent;
    font-size: 14px;
}
.site-search input::placeholder { color: #9aa1ab; }
.site-search button {
    height: 40px;
    padding: 0 18px;
    border: 0;
    border-left: 1px solid var(--line);
    color: var(--ink);
    background: transparent;
    font-weight: 700;
}
.site-search button:hover { color: var(--accent); }
.site-header-links {
    display: flex;
    align-items: center;
    gap: 14px;
}
.site-post-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 18px;
    color: #fff;
    background: var(--accent);
    font-weight: 700;
    white-space: nowrap;
}
.site-post-btn:hover { background: var(--accent-deep); }
.site-shop-link {
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}
.site-shop-link:hover { color: var(--accent); }

/* Homepage */
.home-page { padding: 28px 0 40px; }
.home-utility-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}
.home-intro { margin: 0; color: var(--muted); font-size: 14px; }
.home-quicklinks { display: flex; gap: 22px; }
.home-quicklinks a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
}
.home-quicklinks a:hover { color: var(--accent); }
.home-ad-banner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin: 20px 0;
    min-height: 100px;
}
.home-ad-item { display: block; border: 1px solid var(--line); }
.home-ad-item img { display: block; width: 100%; height: 100px; object-fit: cover; }
.home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 32px;
    align-items: start;
}
.home-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; min-width: 0; }
.home-panel { border-top: 1px solid var(--line); padding-top: 16px; }
.home-panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 10px;
}
.home-panel-head h3 { margin: 0; color: var(--ink); font-size: 17px; font-weight: 700; }
.home-panel-head a { color: var(--muted); font-size: 13px; }
.home-panel-head a:hover { color: var(--accent); }
.home-list { display: grid; grid-template-columns: minmax(0, 1fr); }
.home-list li + li { border-top: 1px solid var(--line); }
.home-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 40px;
    padding: 9px 0;
    color: var(--ink);
}
.home-list a:hover { color: var(--accent); }
.home-list a span { min-width: 0; }
.home-list a time { flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.home-sidebar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; position: sticky; top: 16px; }
.home-sidebar-block { border-top: 1px solid var(--line); padding-top: 16px; }
.home-sidebar-block h4 { margin: 0 0 12px; color: var(--ink); font-size: 14px; font-weight: 700; }
.home-sidebar-block a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    color: var(--muted);
    font-size: 13px;
}
.home-sidebar-block a:hover { color: var(--accent); }
.home-sidebar-cta p { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.home-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 16px;
    color: #fff;
    background: var(--accent);
    font-size: 13px;
    font-weight: 700;
}
.home-cta-btn:hover { background: var(--accent-deep); }

/* Footer */
.site-footer {
    margin-top: 40px;
    padding: 40px 0 24px;
    color: rgba(255,255,255,.72);
    background: var(--footer-bg);
}
.site-footer-grid {
    display: grid;
    grid-template-columns: minmax(220px, .9fr) minmax(320px, 1.3fr) minmax(180px, .6fr);
    gap: 32px;
}
.site-footer-about,
.site-footer-nav,
.site-footer-tools {
    padding: 0 28px 0 0;
    border-right: 1px solid rgba(255,255,255,.12);
}
.site-footer-tools { padding-right: 0; border-right: 0; }
.site-footer-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-bottom: 14px;
    color: #fff;
    background: var(--accent);
    font-size: 18px;
    font-weight: 700;
}
.site-footer h3,
.site-footer h4 { margin: 0 0 14px; color: #fff; font-weight: 700; }
.site-footer p { margin: 0; line-height: 1.8; color: rgba(255,255,255,.6); }
.site-footer-nav-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
}
.site-footer-nav a,
.site-footer-tools a {
    display: block;
    color: rgba(255,255,255,.72);
}
.site-footer-nav a:hover,
.site-footer-tools a:hover { color: #fff; }
.site-footer-tools a + a { margin-top: 10px; }
.site-footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px 18px;
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,.12);
    color: rgba(255,255,255,.5);
    font-size: 12px;
}
.site-footer-bottom a { color: rgba(255,255,255,.64); }
.site-footer-bottom a:hover { color: #fff; }
.footer-body,
.footer-links,
.footer-bottom,
.in-foot { display: none; }

/* Existing pages remain usable */
#toolbar { display: none; }
.filter dl dd a:hover,
.filter dl dd a.active,
.filter .search-filter button,
.btn-danger,
.pagination li.active a,
.pagination li.active a:hover,
.pagination li a:hover,
.show-number {
    border-color: var(--civic-blue);
    background-color: var(--civic-blue);
}
.about .panel-header { font-size: 26px; font-weight: 900; margin-bottom: 22px; }
.about .panel-body { display: flex; gap: 34px; align-items: center; }
.about .left-panel { width: 50%; }
.about .left-panel img { width: 100%; height: auto; border-radius: 18px; }
.about .right-panel { width: 45%; }
.about .right-panel p { line-height: 30px; }
#user_index #content { width: 850px; }
.wall {
    position: relative;
    width: 100%;
    min-height: 100vh;
    padding-top: 100px;
    background:
        linear-gradient(rgba(11, 47, 118, .55), rgba(11, 47, 118, .55)),
        url("../../img/user/login_bg.jpg") center/cover no-repeat;
}
.login, .register, .forget { width: 600px; margin-top: 0; }
#index_view .detail p { font-size: 16px; line-height: 32px; letter-spacing: 1px; }

@media (prefers-reduced-motion: reduce) {
    *, *:before, *:after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (max-width: 1199px) {
    .container { width: 100%; }
    .site-header-row { flex-wrap: wrap; }
    .site-nav { order: 3; width: 100%; }
    .home-layout { grid-template-columns: 1fr; }
    .home-sidebar { position: static; }
    .site-footer-grid { grid-template-columns: 1fr 1fr; }
    .site-footer-tools { grid-column: 1 / -1; padding-right: 0; border-right: 0; }
}
@media (max-width: 767px) {
    .container { width: 100%; padding-left: 14px; padding-right: 14px; }
    #topbar { display: none; }
    .site-header-row { padding: 12px 0; gap: 12px; }
    .site-nav { gap: 16px; overflow-x: auto; }
    .site-search { flex: 1 1 auto; min-width: 0; }
    .site-header-links { gap: 10px; }
    .site-shop-link { display: none; }
    .home-utility-bar { flex-direction: column; align-items: flex-start; gap: 10px; }
    .home-quicklinks { flex-wrap: wrap; gap: 14px; }
    .site-footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .site-footer-about,
    .site-footer-nav,
    .site-footer-tools { padding-right: 0; border-right: 0; }
    .site-footer-nav-cols { grid-template-columns: 1fr; }
    .site-footer-bottom { display: block; line-height: 1.9; }
    .about .panel-body { display: block; }
    .about .left-panel,
    .about .right-panel,
    #user_index #content,
    .login,
    .register,
    .forget { width: 100%; }
}