/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
       background: #f5f7fa; color: #2d2d2d; line-height: 1.6; font-size: 15px; }
a { color: #3b6fd4; text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }

/* ===== Layout ===== */
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.layout { display: grid; grid-template-columns: 1fr 260px; gap: 30px; padding: 30px 0; }
@media (max-width: 700px) { .layout { grid-template-columns: 1fr; } }

/* ===== Header ===== */
.site-header { background: #1e3a5f; padding: 14px 0; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.logo { color: #fff; font-size: 1.3rem; font-weight: 700; letter-spacing: .5px; }

/* ===== Section titles ===== */
.section-title { font-size: 1rem; font-weight: 700; text-transform: uppercase;
                 letter-spacing: .6px; color: #000; margin-bottom: 14px; }

/* ===== Question list ===== */
.question-list { display: flex; flex-direction: column; gap: 4px; }
.question-item { background: #fff; border-radius: 6px; padding: 10px 14px;
                 box-shadow: 0 1px 3px rgba(0,0,0,.06);
                 display: flex; align-items: flex-start; gap: 12px;
                 transition: box-shadow .15s; border-left: 3px solid transparent; }
.question-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,.11); border-left-color: #3b6fd4; }
.qi-avatar { flex-shrink: 0; }
.qi-avatar img { width: 42px; height: 42px; border-radius: 6px; object-fit: cover; display: block; }
.qi-avatar-ph { width: 42px; height: 42px; border-radius: 6px; background: #c5d0e8;
                display: flex; align-items: center; justify-content: center;
                font-weight: 700; color: #3b6fd4; font-size: 1.1rem; }
.qi-body { flex: 1; min-width: 0; }
.question-link { font-size: .97rem; font-weight: 600; color: #1a2a4a; display: block;
                 margin-bottom: 5px; line-height: 1.4; }
.question-link:hover { color: #3b6fd4; text-decoration: none; }
.question-meta { display: flex; align-items: center; gap: 10px; font-size: .78rem;
                 color: #333; flex-wrap: wrap; }
.qi-nick { color: #8b0000; font-weight: 600; }
.qi-time { color: #000; }
.cat-tag { background: #dde6f7; color: #0a2d6e; border-radius: 4px;
           padding: 1px 7px; font-size: .75rem; }
.ans-badge { color: #065a2a; font-weight: 600; }

/* ===== Sidebar ===== */
.sidebar { }
.cat-list li { display: flex; justify-content: space-between; align-items: center;
               padding: 9px 12px; background: #fff; border-radius: 6px; margin-bottom: 6px;
               box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.cat-list li a { color: #1e3a5f; font-weight: 500; }
.cat-count { background: #e8eef8; color: #3b6fd4; border-radius: 10px;
             padding: 2px 9px; font-size: .78rem; font-weight: 600; }

/* ===== Category page ===== */
.page-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 6px; color: #1e3a5f; }
.breadcrumb { font-size: .85rem; color: #888; margin-bottom: 20px; }
.breadcrumb a { color: #3b6fd4; }

/* ===== Question page ===== */
.question-text { font-size:1.2rem; font-weight:700; color:#1a1a2e; margin:0; line-height:1.5; }
.question-card { background: #fff; border-radius: 10px; padding: 26px 28px;
                 box-shadow: 0 2px 8px rgba(0,0,0,.08); margin-bottom: 30px; }
.question-info { margin-top: 12px; font-size: .83rem; color: #999; display: flex; gap: 14px; flex-wrap: wrap; }

.answers-title { font-size: 1rem; font-weight: 700; text-transform: uppercase;
                 letter-spacing: .5px; color: #888; margin-bottom: 16px; }
.answer-list { display: flex; flex-direction: column; gap: 14px; }
.answer-card { background: #fff; border-radius: 10px; padding: 18px 20px;
               box-shadow: 0 1px 4px rgba(0,0,0,.07); display: flex; gap: 16px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
          flex-shrink: 0; background: #dde4f0; }
.avatar-placeholder { width: 44px; height: 44px; border-radius: 50%; background: #c5d0e8;
                       display: flex; align-items: center; justify-content: center;
                       font-weight: 700; color: #3b6fd4; font-size: 1.1rem; flex-shrink: 0; }
.answer-body { flex: 1; }
.answer-author { font-weight: 700; color: #1e3a5f; font-size: .92rem; }
.answer-date { font-size: .78rem; color: #bbb; margin-left: 10px; }
.answer-text { margin-top: 8px; color: #333; line-height: 1.7; }

/* ===== Question author ===== */
.q-author { display:inline-flex; align-items:center; gap:5px; font-size:.82rem;
            font-weight:600; color:#1e3a5f; }
.q-author-av { width:20px; height:20px; border-radius:50%; object-fit:cover; flex-shrink:0; }
.q-author-ph { width:20px; height:20px; border-radius:50%; background:#c5d0e8;
               display:inline-flex; align-items:center; justify-content:center;
               font-weight:700; color:#3b6fd4; font-size:.68rem; flex-shrink:0; }

/* ===== Answer feed (sidebar) ===== */
.answer-feed { display:flex; flex-direction:column; gap:10px; }
.feed-item { background:#fff; border-radius:8px; padding:12px 14px;
             box-shadow:0 1px 3px rgba(0,0,0,.06); }
.feed-header { display:flex; align-items:center; gap:7px; margin-bottom:6px; }
.feed-avatar { width:26px; height:26px; border-radius:50%; object-fit:cover; flex-shrink:0; }
.feed-avatar-ph { background:#c5d0e8; display:flex; align-items:center; justify-content:center;
                  font-weight:700; color:#3b6fd4; font-size:.75rem; }
.feed-nick { font-weight:700; font-size:.82rem; color:#1e3a5f; }
.feed-time { font-size:.73rem; color:#333; margin-left:auto; }
.feed-question { display:block; font-size:.78rem; color:#3b6fd4; margin-bottom:4px;
                 line-height:1.4; }
.feed-question:hover { text-decoration:underline; }
.feed-text { font-size:.8rem; color:#444; line-height:1.5; margin:0; }
.empty { color: #aaa; font-style: italic; padding: 20px 0; }

/* ===== Admin ===== */
.adm-body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
            background: #f0f2f5; color: #2d2d2d; font-size: 14px; line-height: 1.5; }
.adm-wrap { display: flex; min-height: 100vh; }
.adm-nav { width: 260px; background: #1e3a5f; flex-shrink: 0; display:flex; flex-direction:column; }
.adm-nav .brand { color: #fff; font-size: 1.1rem; font-weight: 700; padding: 20px 18px;
                  border-bottom: 1px solid rgba(255,255,255,.1); display: block; }
.adm-nav ul { padding: 10px 0; }
.adm-nav ul li a { display: block; padding: 11px 18px; color: #b8c8e0; font-size: .9rem;
                   transition: background .15s; }
.adm-nav ul li a:hover, .adm-nav ul li a.active { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.adm-main { flex: 1; padding: 30px; min-width: 0; }
.adm-section { display: none; }
.adm-section.visible { display: block; }
.adm-title { font-size: 1.3rem; font-weight: 700; color: #1e3a5f; margin-bottom: 24px; }
.adm-card { background: #fff; border-radius: 8px; padding: 22px 24px;
            box-shadow: 0 1px 4px rgba(0,0,0,.08); margin-bottom: 22px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 5px; font-size: .88rem; color: #555; }
.form-group input[type=text],
.form-group input[type=password],
.form-group input[type=number],
.form-group textarea,
.form-group select { width: 100%; padding: 9px 11px; border: 1px solid #d0d7e3;
                      border-radius: 6px; font-size: .9rem; background: #fafbfc;
                      transition: border .15s; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus
  { outline: none; border-color: #3b6fd4; background: #fff; }
.form-group textarea { resize: vertical; min-height: 100px; }
.btn { display: inline-block; padding: 9px 20px; border: none; border-radius: 6px;
       cursor: pointer; font-size: .9rem; font-weight: 600; transition: opacity .15s; }
.btn:hover { opacity: .85; }
.btn-primary { background: #3b6fd4; color: #fff; }
.btn-danger  { background: #e74c3c; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.adm-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.adm-table th { background: #f0f2f5; font-weight: 600; text-align: left;
                padding: 10px 12px; border-bottom: 2px solid #e0e4eb; color: #555; }
.adm-table td { padding: 10px 12px; border-bottom: 1px solid #eef0f5; vertical-align: middle; }
.adm-table tr:hover td { background: #fafbfe; }
.status-badge { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: .77rem; font-weight: 600; }
.status-published { background: #d4edda; color: #155724; }
.status-pending   { background: #fff3cd; color: #856404; }
.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: .9rem; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: #fff; border-radius: 10px; padding: 36px 40px; width: 340px;
             box-shadow: 0 4px 20px rgba(0,0,0,.12); }
.login-box h1 { font-size: 1.3rem; font-weight: 700; color: #1e3a5f; margin-bottom: 24px; text-align: center; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
@media (max-width: 600px) { .settings-grid { grid-template-columns: 1fr; } }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .form-group { margin-bottom: 0; flex: 1; min-width: 160px; }

/* ===== Pagination ===== */
.pagination { display:flex; gap:6px; justify-content:center; flex-wrap:wrap;
              padding:24px 0 8px; }
.page-link, .page-current { display:inline-flex; align-items:center; justify-content:center;
              min-width:34px; height:34px; padding:0 8px; border-radius:6px;
              font-size:.88rem; font-weight:600; }
.page-link { background:#fff; color:#3b6fd4; box-shadow:0 1px 3px rgba(0,0,0,.08);
             transition:background .15s; }
.page-link:hover { background:#e8eef8; text-decoration:none; }
.page-current { background:#3b6fd4; color:#fff; cursor:default; }

/* ===== Footer ===== */
.site-footer { background:#1e3a5f; color:#e8f0f8; padding:22px 0; margin-top:40px; font-size:.88rem; }
.site-footer .container { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; }
.footer-links { display:flex; align-items:center; gap:10px; }
.footer-links a { color:#c8dff0; transition:color .15s; }
.footer-links a:hover { color:#fff; text-decoration:none; }
.footer-sep { color:#8ab8d8; }
.footer-copy { color:#c8d8e8; }
.static-content { line-height:1.8; color:#333; }
.static-content p { margin-bottom:12px; }
.static-content h2 { font-size:1.1rem; font-weight:700; margin:20px 0 8px; color:#1e3a5f; }
.static-content h3 { font-size:1rem; font-weight:700; margin:16px 0 6px; color:#1e3a5f; }
.static-content ul, .static-content ol { margin:10px 0 14px 22px; padding:0; }
.static-content ul { list-style:disc; }
.static-content ol { list-style:decimal; }
.static-content li { margin-bottom:6px; }
.static-content a { color:#3b6fd4; text-decoration:underline; }
.static-content strong, .static-content b { font-weight:700; }
.alert { padding:10px 14px; border-radius:6px; margin-bottom:16px; font-size:.9rem; }
.alert-success { background:#d4edda; color:#155724; border:1px solid #c3e6cb; }
.alert-error   { background:#f8d7da; color:#721c24; border:1px solid #f5c6cb; }

/* ===== Logo ===== */
.logo-img img {
  width: 160px;
  height: 50px;
  object-fit: contain;
  object-position: left center;
  display: block;
}
@media (max-width: 500px) {
  .logo-img img { width: 110px; height: 36px; }
}

/* ===== Offers widget ===== */
.offers-widget { border:2px solid #e0e0e0; border-radius:12px; overflow:hidden; margin-bottom:28px; background:#fff; }
.offer-row { display:flex; align-items:center; gap:16px; padding:14px 18px; border-bottom:1px solid #f0f0f0; }
.offer-row:last-child { border-bottom:none; }
.offer-logo-wrap { flex-shrink:0; border:2px dashed #e03a7a; border-radius:8px; padding:6px; display:flex;
                   width:150px; height:60px; align-items:center; justify-content:center; }
.offer-logo { width:150px; height:60px; object-fit:contain; display:block; }
.offer-logo-ph { font-size:.8rem; color:#444; font-weight:700; }
.offer-stars { flex-shrink:0; display:flex; gap:2px; min-width:100px; }
.star { font-size:1.3rem; }
.star.full  { color:#a06800; }
.star.half  { color:#a06800; opacity:.8; }
.star.empty { color:#333; }
.offer-text { flex:1; font-size:.9rem; color:#333; text-align:center; line-height:1.4; }
.offer-btn  { flex-shrink:0; background:linear-gradient(135deg,#e03a7a,#ff6eb4);
              color:#fff; font-weight:800; font-size:.88rem; letter-spacing:.5px;
              padding:11px 22px; border-radius:8px; border:2px solid #c0306a;
              text-decoration:none; white-space:nowrap; box-shadow:0 3px 8px rgba(224,58,122,.35);
              transition:opacity .15s; }
.offer-btn:hover { opacity:.88; text-decoration:none; }
@media (max-width:600px) {
  .offer-row { flex-wrap:wrap; gap:10px; }
  .offer-text { text-align:left; }
}

/* ===== Similar questions ===== */
.similar-questions { margin-top:32px; }
.similar-title { font-size:1rem; font-weight:700; text-transform:uppercase;
                 letter-spacing:.6px; color:#333; margin-bottom:14px; }
.similar-list { list-style:none; display:flex; flex-direction:column; gap:8px; }
.similar-item { background:#fff; border-radius:8px; padding:12px 16px;
                box-shadow:0 1px 4px rgba(0,0,0,.07);
                display:flex; align-items:center; justify-content:space-between; gap:12px; }
.similar-link { font-size:1rem; font-weight:600; color:#1e3a5f; flex:1; }
.similar-link:hover { color:#3b6fd4; text-decoration:none; }
.similar-meta { font-size:.78rem; color:#333; white-space:nowrap; flex-shrink:0; }

/* ===== Ask block ===== */
.ask-block { border:1px solid #c8d0dc; border-radius:6px; padding:16px 18px;
             background:#fff; margin-bottom:20px; cursor:pointer;
             transition:border-color .15s, box-shadow .15s; }
.ask-block:hover { border-color:#3b6fd4; box-shadow:0 2px 8px rgba(59,111,212,.12); }
.ask-line1 { color:#444; font-size:.95rem; margin-bottom:4px; }
.ask-line2 { color:#444; font-size:.95rem; margin-bottom:8px; }
.ask-cta   { color:#333; font-size:.9rem; font-weight:600; letter-spacing:.3px; margin:0; }
