* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; line-height: 1.6; color: #222; background: #f8f9fa; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
header { background: #fff; border-bottom: 1px solid #eee; padding: 15px 0; }
.header-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; }
.logo { font-size: 20px; font-weight: bold; text-decoration: none; color: #0066cc; flex-shrink: 0; }
.main-nav a { margin-left: 15px; text-decoration: none; color: #444; font-size: 14px; }
.main-nav a:hover { color: #0066cc; }

/* Search */
.search-form { display: flex; flex: 1; max-width: 400px; min-width: 200px; }
.search-form input { flex: 1; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px 0 0 6px; font-size: 14px; }
.search-form input:focus { outline: none; border-color: #0066cc; }
.search-form button { padding: 8px 14px; background: #0066cc; color: #fff; border: none; border-radius: 0 6px 6px 0; cursor: pointer; font-size: 14px; }
.search-form button:hover { background: #0052a3; }

/* Layout */
.main-layout { display: grid; grid-template-columns: 1fr 300px; gap: 30px; padding: 30px 20px; }
@media (max-width: 900px) { .main-layout { grid-template-columns: 1fr; } }

.content h1 { margin-bottom: 20px; font-size: 28px; }
.lead { color: #555; font-size: 16px; margin-bottom: 25px; white-space: pre-wrap; }

/* Grid + cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.card { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); transition: box-shadow 0.2s; }
.card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.card h3 { margin-bottom: 8px; font-size: 16px; }
.card a { color: #0066cc; text-decoration: none; }
.card a:hover { text-decoration: underline; }
.card p { color: #666; font-size: 14px; margin: 8px 0; }
.card-category { display: inline-block; font-size: 11px; text-transform: uppercase; color: #0066cc; background: #e6f0fa; padding: 2px 8px; border-radius: 10px; margin: 5px 0; letter-spacing: 0.5px; }
.card-views { display: block; margin-top: 10px; font-size: 12px; color: #999; }

/* Breadcrumbs */
.breadcrumbs { font-size: 13px; color: #888; margin-bottom: 15px; }
.breadcrumbs a { color: #0066cc; text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

/* Calculator iframe */
.calc-frame-wrap { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 30px; }
.calc-frame { width: 100%; min-height: 500px; border: none; display: block; }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.widget { background: #fff; padding: 20px; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.widget h3 { font-size: 16px; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 2px solid #f0f0f0; }
.category-list, .random-list { list-style: none; }
.category-list li, .random-list li { margin-bottom: 8px; }
.category-list a, .random-list a { color: #444; text-decoration: none; font-size: 14px; display: flex; justify-content: space-between; align-items: center; padding: 4px 0; }
.category-list a:hover, .random-list a:hover { color: #0066cc; }
.category-list a.active { color: #0066cc; font-weight: 600; }
.count { background: #f0f0f0; color: #888; font-size: 11px; padding: 2px 8px; border-radius: 10px; }

/* Announcements */
/* Announcements */
.announcements { margin-bottom: 25px; background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); overflow: hidden; }
.announcements-header { background: linear-gradient(90deg, #fff8e1 0%, #fff 100%); padding: 12px 20px; font-weight: 600; font-size: 14px; color: #663c00; border-bottom: 1px solid #fef3c7; }
.announcement { border-bottom: 1px solid #f5f5f5; }
.announcement:last-child { border-bottom: none; }
.announcement-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; cursor: pointer; transition: background 0.15s; gap: 15px; }
.announcement-head:hover { background: #fffdf5; }
.announcement-title { font-weight: 500; color: #663c00; font-size: 14px; flex: 1; }
.announcement-toggle { color: #b08800; font-size: 12px; flex-shrink: 0; }
.announcement-body { padding: 0 20px 15px 20px; }
.announcement-text { font-size: 14px; color: #555; line-height: 1.6; white-space: pre-wrap; transition: max-height 0.2s ease; }
.announcement-more { background: none; border: none; color: #0066cc; cursor: pointer; padding: 5px 0 0 0; font-size: 13px; font-weight: 600; }
.announcement-more:hover { text-decoration: underline; }
.announcement-date { font-size: 12px; color: #999; margin-top: 10px; padding-top: 8px; border-top: 1px dashed #eee; }

/* Related */
.related { margin-top: 40px; }
.related h2 { font-size: 20px; margin-bottom: 20px; }

/* Ads */
.ad-slot { text-align: center; margin: 20px 0; }
.ad-slot.ad-top { margin: 15px auto; }
.ad-slot.ad-sidebar { margin-bottom: 0; }
.ad-slot.ad-in-content { margin: 25px 0; }
.ad-slot.ad-bottom { margin: 30px auto; padding: 15px 0; border-top: 1px solid #eee; border-bottom: 1px solid #eee; }


/* Muted */
.muted { color: #999; font-size: 14px; }

/* Footer */
footer { background: #fff; border-top: 1px solid #eee; padding: 20px 0; text-align: center; color: #888; font-size: 14px; margin-top: 40px; }
