/* =====================================================================
   前台公共样式 common.css
   校园官方简约商务风格,电脑手机自适应
   ===================================================================== */

/* ---- 重置 ---- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    color: #2c3e50; background: #f7f9fc; line-height: 1.6; font-size: 15px;
}
a { color: #1a73e8; text-decoration: none; transition: color .2s; }
a:hover { color: #0d5bce; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* ---- 通用容器 ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.wrap { background: #fff; border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,.05); padding: 28px 32px; margin: 24px 0; }

/* ---- 顶部导航 ---- */
.site-header { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.06); position: sticky; top: 0; z-index: 100; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo .badge { width: 42px; height: 42px; background: linear-gradient(135deg,#1a73e8,#4a90d9); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: bold; font-size: 20px; }
.logo .title { font-size: 19px; font-weight: 700; color: #2c3e50; }
.logo .title small { display: block; font-size: 12px; color: #8a94a6; font-weight: normal; }
.nav-menu { display: flex; gap: 6px; }
.nav-menu a { padding: 8px 16px; border-radius: 6px; color: #4a5568; font-size: 15px; font-weight: 500; }
.nav-menu a:hover, .nav-menu a.active { background: #eef4ff; color: #1a73e8; }

/* ---- 轮播图 ---- */
.banner { position: relative; max-height: 360px; overflow: hidden; background: #1a3a5f; }
.banner .slides { display: flex; transition: transform .6s ease; }
.banner .slides .slide { min-width: 100%; height: 360px; display: flex; align-items: center; justify-content: center; background-size: cover; background-position: center; }
.banner .slide .caption { color: #fff; text-align: center; padding: 0 30px; }
.banner .slide .caption h2 { font-size: 32px; margin-bottom: 12px; text-shadow: 0 2px 8px rgba(0,0,0,.4); }
.banner .slide .caption p { font-size: 16px; opacity: .9; text-shadow: 0 2px 8px rgba(0,0,0,.4); }
.banner .dots { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.banner .dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.5); cursor: pointer; }
.banner .dots span.active { background: #fff; }
.banner .arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; background: rgba(0,0,0,.3); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 22px; }
.banner .arrow.prev { left: 16px; }
.banner .arrow.next { right: 16px; }

/* ---- 标题区 ---- */
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 32px 0 18px; }
.section-title h3 { font-size: 22px; color: #2c3e50; position: relative; padding-left: 14px; }
.section-title h3::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 4px; height: 22px; background: #1a73e8; border-radius: 2px; }
.section-title .more { font-size: 14px; color: #8a94a6; }

/* ---- 首页板块网格 ---- */
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* 卡片 */
.card { background: #fff; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.05); overflow: hidden; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(0,0,0,.1); }
.card .thumb { height: 160px; background-size: cover; background-position: center; background-color: #eef2f7; }
.card .body { padding: 16px 18px; }
.card .body h4 { font-size: 16px; color: #2c3e50; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .body p { font-size: 13px; color: #8a94a6; }
.card .body .meta { margin-top: 10px; font-size: 12px; color: #aab2c0; display: flex; justify-content: space-between; }

/* ---- 简介 ---- */
.intro-box { display: flex; gap: 30px; align-items: center; }
.intro-box .text { flex: 1; }
.intro-box .text p { color: #5a6478; margin-bottom: 12px; }
.intro-box .img { width: 380px; height: 220px; border-radius: 8px; background: linear-gradient(135deg,#1a73e8,#4a90d9); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 40px; }

/* ---- 通知/新闻列表 ---- */
.list { }
.list li { padding: 14px 0; border-bottom: 1px dashed #e8edf3; display: flex; justify-content: space-between; align-items: center; }
.list li:last-child { border-bottom: none; }
.list li a { color: #4a5568; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list li a:hover { color: #1a73e8; }
.list li .date { color: #aab2c0; font-size: 13px; margin-left: 16px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; background: #eef4ff; color: #1a73e8; margin-right: 8px; }

/* ---- 分页 ---- */
.pagination { display: flex; gap: 6px; justify-content: center; align-items: center; margin: 24px 0; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid #e0e6ef; border-radius: 4px; background: #fff; color: #4a5568; font-size: 14px; }
.pagination a:hover { background: #eef4ff; border-color: #1a73e8; color: #1a73e8; }
.pagination .cur { background: #1a73e8; color: #fff; border-color: #1a73e8; }
.pagination .page-info { border: none; background: transparent; color: #8a94a6; }

/* ---- 详情页 ---- */
.detail-header { text-align: center; padding: 24px 0; border-bottom: 1px solid #e8edf3; }
.detail-header h1 { font-size: 26px; color: #2c3e50; margin-bottom: 12px; }
.detail-header .meta { color: #8a94a6; font-size: 14px; }
.detail-content { padding: 24px 0; line-height: 1.9; color: #3a4254; }
.detail-content img { margin: 16px auto; border-radius: 6px; }
.detail-content p { margin-bottom: 14px; }

/* ---- 表单 ---- */
.form-box { max-width: 760px; margin: 30px auto; }
.form-row { margin-bottom: 20px; }
.form-row label { display: block; margin-bottom: 8px; font-weight: 600; color: #2c3e50; }
.form-row label .req { color: #e74c3c; }
.form-row input[type=text], .form-row input[type=tel], .form-row input[type=number],
.form-row input[type=date], .form-row select, .form-row textarea {
    width: 100%; padding: 10px 12px; border: 1px solid #d8dee8; border-radius: 6px; font-size: 15px; background: #fff; transition: border-color .2s;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: #1a73e8; outline: none; box-shadow: 0 0 0 3px rgba(26,115,232,.1); }
.form-row textarea { min-height: 120px; resize: vertical; }
.form-row .hint { font-size: 13px; color: #8a94a6; margin-top: 6px; }
.form-row .err { color: #e74c3c; font-size: 13px; margin-top: 6px; display: none; }
.btn { display: inline-block; padding: 11px 28px; border: none; border-radius: 6px; cursor: pointer; font-size: 15px; font-weight: 600; transition: opacity .2s, transform .1s; }
.btn:active { transform: scale(.98); }
.btn-primary { background: #1a73e8; color: #fff; }
.btn-primary:hover { background: #0d5bce; }
.btn-success { background: #27ae60; color: #fff; }
.btn-warn { background: #e67e22; color: #fff; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-ghost { background: #fff; color: #4a5568; border: 1px solid #d8dee8; }
.btn-ghost:hover { background: #f7f9fc; }
.form-actions { text-align: center; margin-top: 28px; }
.form-actions .btn { margin: 0 8px; }

/* ---- 上传区域 ---- */
.upload-area { border: 2px dashed #c8d2e0; border-radius: 8px; padding: 24px; text-align: center; background: #fafbfc; transition: border-color .2s; }
.upload-area:hover { border-color: #1a73e8; }
.upload-area .ico { font-size: 40px; color: #1a73e8; margin-bottom: 8px; }
.upload-area .txt { color: #5a6478; }
.upload-area .txt b { color: #1a73e8; }
.upload-area input[type=file] { display: none; }

/* 图片预览网格 */
.preview-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(140px,1fr)); gap: 12px; margin-top: 16px; }
.preview-item { position: relative; border-radius: 6px; overflow: hidden; border: 1px solid #e8edf3; aspect-ratio: 1; }
.preview-item img { width: 100%; height: 100%; object-fit: cover; }
.preview-item .remove { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; background: rgba(0,0,0,.6); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 14px; }
.preview-item .photo-tag { position: absolute; bottom: 4px; left: 4px; background: rgba(26,115,232,.85); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 3px; }

/* 拍照模块 */
.camera-box { background: #000; border-radius: 8px; overflow: hidden; position: relative; }
.camera-box video { width: 100%; display: block; }
.camera-box .cam-actions { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; }
.camera-box .cam-actions button { padding: 8px 16px; border-radius: 20px; border: none; background: rgba(255,255,255,.9); cursor: pointer; font-size: 14px; }

/* ---- 单号展示 ---- */
.apply-no-box { text-align: center; padding: 40px 20px; background: linear-gradient(135deg,#eef4ff,#f0f7ff); border-radius: 10px; margin: 30px 0; }
.apply-no-box .label { color: #5a6478; font-size: 14px; margin-bottom: 8px; }
.apply-no-box .no { font-size: 30px; font-weight: 700; color: #1a73e8; letter-spacing: 2px; }
.apply-no-box .tip { color: #8a94a6; margin-top: 12px; font-size: 13px; }

/* ---- 状态标签 ---- */
.status { padding: 3px 10px; border-radius: 4px; font-size: 13px; font-weight: 600; }
.status-0 { background: #fff3cd; color: #856404; }   /* 待审核 */
.status-1 { background: #d4edda; color: #155724; }   /* 通过 */
.status-2 { background: #f8d7da; color: #721c24; }   /* 驳回 */
.status-3 { background: #e2e3e5; color: #383d41; }   /* 暂存 */

/* ---- 页脚 ---- */
.site-footer { background: #2c3e50; color: #c2cad6; padding: 30px 0; margin-top: 40px; text-align: center; }
.site-footer .info { line-height: 2; font-size: 14px; }
.site-footer a { color: #c2cad6; }

/* ---- 移动端汉堡按钮 ---- */
.nav-toggle { display: none; background: none; border: none; font-size: 26px; color: #2c3e50; cursor: pointer; padding: 4px 8px; line-height: 1; }

/* ---- 响应式 ---- */
@media (max-width: 900px) {
    .grid-3 { grid-template-columns: repeat(2,1fr); }
    .grid-2 { grid-template-columns: 1fr; }
    .intro-box { flex-direction: column; }
    .intro-box .img { width: 100%; height: 180px; }
    .section-title h3 { font-size: 18px; }
    .card .thumb { height: 130px; }
}
@media (max-width: 640px) {
    .container { padding: 0 12px; }
    .site-header .container { height: auto; padding: 10px 12px; flex-wrap: wrap; }
    .logo .title { font-size: 15px; }
    .logo .title small { font-size: 11px; }
    .logo .badge { width: 36px; height: 36px; font-size: 17px; }

    .nav-toggle { display: block; }
    .nav-menu { display: none; flex-direction: column; width: 100%; gap: 0; padding-top: 8px; }
    .nav-menu.open { display: flex; }
    .nav-menu a { padding: 10px 14px; font-size: 14px; border-bottom: 1px solid #eef2f7; border-radius: 0; }
    .nav-menu a:last-child { border-bottom: none; }

    .grid-3 { grid-template-columns: 1fr; gap: 14px; }
    .grid-2 { grid-template-columns: 1fr; gap: 14px; }
    .card .thumb { height: 150px; }
    .card .body { padding: 12px 14px; }
    .card .body[style*="padding:30px"] { padding: 16px !important; }

    .banner { max-height: 260px; }
    .banner .slides .slide { height: 260px; }
    .banner .slide .caption h2 { font-size: 20px; }
    .banner .slide .caption p { font-size: 14px; }
    .banner .arrow { width: 36px; height: 36px; font-size: 18px; }
    .banner .arrow.prev { left: 8px; }
    .banner .arrow.next { right: 8px; }

    .wrap { padding: 16px 14px; margin: 14px 0; border-radius: 6px; }
    .form-box { margin: 14px 0; }
    .form-row input[type=text], .form-row input[type=tel], .form-row input[type=number],
    .form-row input[type=date], .form-row select, .form-row textarea { font-size: 16px; padding: 9px 10px; }
    .form-row textarea { min-height: 100px; }
    .form-row { margin-bottom: 16px; }

    .section-title { margin: 24px 0 14px; }
    .section-title h3 { font-size: 17px; padding-left: 10px; }
    .section-title h3::before { width: 3px; height: 18px; }

    .preview-grid { grid-template-columns: repeat(auto-fill,minmax(100px,1fr)); gap: 8px; }
    .upload-area { padding: 16px 12px; }
    .upload-area .ico { font-size: 32px; }

    .list li { padding: 10px 0; flex-wrap: wrap; gap: 4px; }
    .list li .date { margin-left: 0; font-size: 12px; }

    .detail-header h1 { font-size: 20px; }
    .detail-content { padding: 16px 0; }

    .apply-no-box { padding: 28px 16px; margin: 20px 0; }
    .apply-no-box .no { font-size: 24px; }

    .site-footer { padding: 20px 0; margin-top: 24px; }
    .site-footer .info { font-size: 12px; line-height: 1.8; }

    .btn { padding: 10px 20px; font-size: 14px; }
    .btn-sm { padding: 6px 12px; font-size: 12px; }
    .form-actions { margin-top: 20px; }
    .form-actions .btn { margin: 4px; }

    .pagination { gap: 4px; }
    .pagination a, .pagination span { padding: 5px 9px; font-size: 13px; }

    /* 搜索表单横排改竖排 */
    form[style*="display:flex"] { flex-direction: column !important; }
    form[style*="display:flex"] .btn { width: 100%; }

    /* 详情网格(查询页)自适应 */
    .detail-grid { grid-template-columns: 1fr; gap: 6px; padding: 10px 0; }
    .detail-grid .k { font-weight: 600; }

    /* 内边距较大的卡片自适应 */
    .wrap[style*="padding:40px"], .wrap[style*="padding:40"] { padding: 24px 16px !important; }
}
