/* ===== 基础 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: #f2f4f8; color: #333; line-height: 1.6; }
a { color: #2b6cb0; text-decoration: none; }
a:hover { color: #1a4e8a; }
.container { max-width: 1000px; margin: 0 auto; padding: 0 16px; }
img { max-width: 100%; }

/* ===== 前台头部 ===== */
.site-header { background: linear-gradient(135deg, #2b6cb0, #4299e1); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { color: #fff; font-size: 22px; font-weight: bold; }
.logo:hover { color: #fff; }
.main-nav a { color: rgba(255,255,255,.85); margin-left: 22px; padding: 4px 2px; }
.main-nav a:hover, .main-nav a.active { color: #fff; border-bottom: 2px solid #fff; }
.main-content { padding: 20px 16px 40px; min-height: 60vh; }
.site-footer { background: #2d3748; color: #a0aec0; text-align: center; padding: 20px 0; font-size: 14px; }

/* ===== 首页 ===== */
.vote-reminder { background: #fff8e1; border: 1px solid #f6d55c; border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; }
.carousel { position: relative; border-radius: 10px; overflow: hidden; height: 300px; background: #dde3ea; }
.carousel .slide { display: none; position: absolute; inset: 0; }
.carousel .slide.on { display: block; }
.carousel .slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel .slide-title { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.5); color: #fff; padding: 10px 16px; font-size: 15px; }
.placeholder-slide .gradient, .activity-photo.gradient { background: linear-gradient(135deg, #4299e1, #9f7aea); width: 100%; height: 100%; }
.quick-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 20px 0; }
.quick-item { background: #fff; border-radius: 10px; padding: 20px 10px; text-align: center; color: #333; font-size: 15px; box-shadow: 0 1px 4px rgba(0,0,0,.06); transition: transform .15s; }
.quick-item:hover { transform: translateY(-3px); color: #2b6cb0; }
.qi-icon { display: inline-flex; width: 52px; height: 52px; border-radius: 50%; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 8px; color: #fff; }
.quick-item .qi-icon { display: flex; margin: 0 auto 8px; }
.bg-blue { background: #4299e1; } .bg-green { background: #48bb78; } .bg-orange { background: #ed8936; } .bg-purple { background: #9f7aea; }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ===== 卡片与列表 ===== */
.card { background: #fff; border-radius: 10px; padding: 18px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.card-title { font-size: 17px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #4299e1; padding-bottom: 8px; }
.card-title .more { font-size: 13px; font-weight: normal; }
.simple-list li, .notice-list li { list-style: none; padding: 10px 0; border-bottom: 1px dashed #e2e8f0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.simple-list li:last-child, .notice-list li:last-child { border-bottom: none; }
.simple-list time, .meta { color: #718096; font-size: 13px; margin-left: auto; }
.notice-list .meta { margin-left: auto; }
.item-title { font-size: 16px; color: #2d3748; }
.item-title:hover { color: #2b6cb0; }
.badge-top { background: #e53e3e; color: #fff; font-size: 12px; padding: 1px 6px; border-radius: 4px; }
.cat-badge { background: #ebf4ff; color: #2b6cb0; font-size: 12px; padding: 1px 8px; border-radius: 4px; }
.status-going { background: #c6f6d5; color: #276749; font-size: 12px; padding: 1px 8px; border-radius: 4px; }
.status-done { background: #e2e8f0; color: #718096; font-size: 12px; padding: 1px 8px; border-radius: 4px; }
.empty { color: #a0aec0; text-align: center; padding: 30px 0; }
.page-title { font-size: 22px; margin-bottom: 16px; border-left: 4px solid #4299e1; padding-left: 10px; }
.tabs { margin-bottom: 16px; }
.tab { display: inline-block; padding: 6px 16px; border-radius: 20px; background: #fff; margin-right: 8px; color: #4a5568; font-size: 14px; }
.tab.active { background: #4299e1; color: #fff; }

/* ===== 新闻 / 活动 ===== */
.news-item { display: flex; gap: 14px; margin-bottom: 14px; }
.news-cover { width: 180px; height: 120px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.news-body { flex: 1; }
.news-summary { color: #718096; font-size: 14px; margin: 8px 0; }
.activity-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.activity-card { display: block; padding: 0; overflow: hidden; color: #333; transition: transform .15s; }
.activity-card:hover { transform: translateY(-3px); color: #333; }
.activity-photo { width: 100%; height: 160px; object-fit: cover; }
.activity-body { padding: 14px; }
.activity-body h3 { font-size: 16px; margin-bottom: 6px; }
.signup-badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 4px; margin-top: 6px; }
.signup-badge.open { background: #c6f6d5; color: #276749; }
.signup-badge.closed { background: #e2e8f0; color: #718096; }

/* ===== 详情页 ===== */
.detail h1 { font-size: 24px; margin-bottom: 10px; }
.detail-meta { color: #718096; font-size: 14px; margin-bottom: 16px; }
.detail-content { font-size: 16px; line-height: 1.9; color: #2d3748; word-break: break-word; }
.detail-cover { border-radius: 8px; margin-bottom: 16px; max-height: 420px; object-fit: cover; width: 100%; }
.divider { border: none; border-top: 1px solid #e2e8f0; margin: 24px 0; }
.gallery { height: 400px; margin-bottom: 16px; }
.signup-title { font-size: 18px; margin-bottom: 12px; }
.contact-box { background: #f7fafc; border-radius: 8px; padding: 14px; }

/* ===== 表单 ===== */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; margin-bottom: 4px; font-size: 14px; color: #4a5568; }
.form-row label.inline { display: inline; }
.form-row em { color: #e53e3e; font-style: normal; }
.form-row input[type=text], .form-row input[type=password], .form-row input[type=number],
.form-row input[type=tel], .form-row input[type=date], .form-row input[type=datetime-local],
.form-row select, .form-row textarea { width: 100%; max-width: 520px; padding: 8px 10px; border: 1px solid #cbd5e0; border-radius: 6px; font-size: 14px; font-family: inherit; }
.form-row textarea { max-width: 100%; }
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { outline: none; border-color: #4299e1; }
.hint { color: #a0aec0; font-size: 12px; margin-left: 8px; }
.btn { display: inline-block; padding: 8px 18px; border: 1px solid #cbd5e0; background: #fff; border-radius: 6px; cursor: pointer; font-size: 14px; color: #4a5568; }
.btn:hover { background: #f7fafc; }
.btn-primary { background: #4299e1; border-color: #4299e1; color: #fff; }
.btn-primary:hover { background: #3182ce; }
.btn-danger { background: #e53e3e; border-color: #e53e3e; color: #fff; }
.btn-sm { padding: 3px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { background: #e2e8f0; border-color: #e2e8f0; color: #a0aec0; cursor: not-allowed; }
.signup-form .btn { margin-top: 6px; }

/* ===== 投票 ===== */
.vote-option { display: block; background: #f7fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer; }
.vote-option:hover { border-color: #4299e1; }
.vote-option input { margin-right: 8px; }
.vote-form .btn { margin-top: 10px; }
.vote-bar-row { margin-bottom: 12px; }
.vote-bar-label { font-size: 14px; margin-bottom: 4px; }
.vote-bar-track { background: #edf2f7; border-radius: 6px; height: 20px; overflow: hidden; }
.vote-bar-fill { background: linear-gradient(90deg, #4299e1, #63b3ed); height: 100%; border-radius: 6px; transition: width .5s; }
.vote-bar-num { font-size: 13px; color: #718096; margin-top: 2px; }

/* ===== 分页 ===== */
.pagination { margin-top: 20px; text-align: center; }
.pagination a, .pagination .dots { display: inline-block; padding: 6px 12px; margin: 0 2px; background: #fff; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 14px; }
.pagination a.active { background: #4299e1; color: #fff; border-color: #4299e1; }

/* ===== 提示 ===== */
.flash { padding: 10px 16px; border-radius: 8px; margin-bottom: 14px; }
.flash-success { background: #c6f6d5; color: #276749; }
.flash-error { background: #fed7d7; color: #9b2c2c; }

/* ===== 登录 ===== */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #2b6cb0, #4299e1); }
.login-box { background: #fff; border-radius: 12px; padding: 36px; width: 380px; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.login-box h1 { font-size: 20px; text-align: center; margin-bottom: 20px; }
.captcha-row { display: flex; gap: 10px; }
.captcha-row input { width: 120px; }
.captcha-row img { height: 40px; border-radius: 6px; cursor: pointer; border: 1px solid #e2e8f0; }

/* ===== 后台 ===== */
.admin-body { background: #f2f4f8; }
.admin-header { background: #2d3748; color: #fff; height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; }
.admin-header .logo { font-size: 17px; }
.admin-user a, .admin-user span { color: #cbd5e0; margin-left: 16px; font-size: 14px; }
.admin-user a:hover { color: #fff; }
.admin-wrap { display: flex; min-height: calc(100vh - 54px); }
.admin-side { width: 200px; background: #fff; padding: 16px 0; box-shadow: 1px 0 4px rgba(0,0,0,.05); flex-shrink: 0; }
.admin-side a { display: block; padding: 11px 20px; color: #4a5568; font-size: 14px; }
.admin-side a:hover { background: #f7fafc; }
.admin-side a.active { background: #ebf4ff; color: #2b6cb0; border-right: 3px solid #4299e1; }
.admin-main { flex: 1; padding: 22px; overflow-x: auto; }
.admin-title { font-size: 20px; }
.admin-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.admin-toolbar .admin-title { margin-right: auto; }
.search-form input { padding: 7px 10px; border: 1px solid #cbd5e0; border-radius: 6px; font-size: 14px; }
.admin-table { width: 100%; background: #fff; border-radius: 10px; border-collapse: collapse; box-shadow: 0 1px 4px rgba(0,0,0,.06); overflow: hidden; }
.admin-table th, .admin-table td { padding: 10px 12px; text-align: left; font-size: 14px; border-bottom: 1px solid #edf2f7; }
.admin-table th { background: #f7fafc; color: #4a5568; white-space: nowrap; }
.admin-table .ops { white-space: nowrap; }
.admin-table .ops form { display: inline; }
.thumb { width: 64px; height: 44px; object-fit: cover; border-radius: 4px; }
.img-list { display: flex; gap: 10px; flex-wrap: wrap; }
.img-item { text-align: center; }
.admin-form { background: #fff; border-radius: 10px; padding: 24px; max-width: 760px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.option-row { display: flex; gap: 8px; margin-bottom: 8px; max-width: 520px; }
.option-row input { flex: 1; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 16px; }
.stat-card { border-radius: 10px; padding: 26px 18px; color: #fff; text-align: center; }
.stat-num { font-size: 34px; font-weight: bold; }
.stat-label { font-size: 14px; opacity: .9; margin-top: 4px; }

/* ===== 响应式 ===== */
@media (max-width: 800px) {
  .home-grid, .stat-grid { grid-template-columns: 1fr 1fr; }
  .activity-grid { grid-template-columns: 1fr 1fr; }
  .quick-links { grid-template-columns: repeat(2, 1fr); }
  .news-item { flex-direction: column; }
  .news-cover { width: 100%; height: 180px; }
  .admin-side { width: 60px; }
  .admin-side a { font-size: 0; text-align: center; }
  .admin-side a::first-letter { font-size: 18px; }
  .main-nav a { margin-left: 10px; font-size: 13px; }
}
