﻿/* ============================================================
   驻马店区域内中药材质量安全追溯体系信息平台
   中医药文化 + 政府监管 · 稳重 · 科技感
   ============================================================ */

* { margin:0; padding:0; box-sizing:border-box; }

body {
    font-family: "Microsoft YaHei", "SimSun", "PingFang SC", sans-serif;
    color: #2b2b2b;
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    /* 背景：中药材种植田（可替换为黄芪/白芷等药材田或驻马店农业景观照片） */
    background: url('../images/tu/background.jpg') no-repeat center center fixed;
    background-size: cover;
}

/* 半透明白色遮罩，保证文字清晰 */
.bg-overlay {
    position: fixed;
    top:0; left:0; right:0; bottom:0;
    background: rgba(255,255,255,0.88);
    z-index: -1;
}

/* ============================================================
   顶部导航栏 Header
   ============================================================ */
.site-header {
    background: rgba(255,255,255,0.92);
    box-shadow: 0 2px 14px rgba(0,0,0,0.08);
    padding-top: 18px;
    position: sticky;
    top: 0;
    z-index: 500;
    border-bottom: 3px solid #8a6d3b;
}

.header-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.logo-wrap {
    display: flex;
    align-items: center;
    gap: 18px;
}

.logo-img {
    width: 78px;
    height: 78px;
    object-fit: contain;
    flex-shrink: 0;
}

.title-wrap {
    display: flex;
    flex-direction: column;
}

.site-title {
    font-size: 30px;
    font-weight: 800;
    color: #1a1a1a;
    letter-spacing: 2px;
    line-height: 1.35;
    font-family: "SimHei", "Microsoft YaHei", sans-serif;
}

.site-subtitle {
    font-size: 12.5px;
    color: #7a7a7a;
    letter-spacing: 0.6px;
    margin-top: 4px;
}

/* --- 6个导航模块 --- */
.main-nav {
    max-width: 1100px;
    margin: 16px auto 0;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.main-nav a {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
    color: #2b2b2b;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s;
    position: relative;
}

.main-nav > a::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: #8a6d3b;
    transition: width 0.3s;
}

.main-nav a:hover {
    color: #8a6d3b;
    background: rgba(138,109,59,0.08);
}

.main-nav a:hover::after {
    width: 70%;
}

/* 当前页高亮 */
.main-nav a.active {
    color: #8a6d3b;
    background: rgba(138,109,59,0.08);
}

.main-nav a.active::after {
    width: 70%;
}

/* ============================================================
   首页主布局：左侧功能卡片 + 右侧查询面板
   ============================================================ */
.home-main {
    max-width: 1100px;
    margin: 40px auto 20px;
    padding: 0 20px;
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.home-left {
    flex: 0 0 62%;
}

.home-title {
    font-size: 22px;
    color: #4a3a1f;
    letter-spacing: 2px;
    margin-bottom: 18px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.func-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    border-radius: 14px;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.3s;
    min-height: 120px;
}

.func-card:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0,0,0,0.15); }

.card-icon { font-size: 36px; margin-bottom: 8px; }
.card-label { letter-spacing: 1px; }

.card-green  { background: linear-gradient(135deg, #27ae60, #1e8449); }
.card-blue   { background: linear-gradient(135deg, #2980b9, #1a5276); }
.card-purple { background: linear-gradient(135deg, #8e44ad, #6c3483); }
.card-orange { background: linear-gradient(135deg, #e67e22, #ba4a00); }
.card-red    { background: linear-gradient(135deg, #c0392b, #922b21); }
.card-teal   { background: linear-gradient(135deg, #16a085, #0e6655); }

/* 右侧查询面板 */
.home-right {
    flex: 0 0 35%;
    position: sticky;
    top: 120px;
}

.query-panel {
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.10);
    border: 1px solid rgba(138,109,59,0.2);
    text-align: center;
}

.query-title {
    font-size: 22px;
    color: #4a3a1f;
    letter-spacing: 3px;
    margin-bottom: 6px;
}

.query-desc {
    font-size: 12px;
    color: #8a8a8a;
    margin-bottom: 20px;
}

/* ============================================================
   输入框 + 搜索按钮（键盘/输入框复用原样式）
   ============================================================ */
.trace-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}

.trace-input-wrap input {
    flex: 1;
    padding: 13px 16px;
    font-size: 20px;
    text-align: center;
    letter-spacing: 6px;
    border: 2px solid #d8cdb8;
    border-radius: 8px;
    outline: none;
    background: #fff;
    color: #2b2b2b;
    transition: border-color 0.3s;
    font-family: inherit;
}

.trace-input-wrap input:focus {
    border-color: #8a6d3b;
}

.search-btn {
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 8px;
    background: #8a6d3b;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.search-btn:hover {
    background: #6f5730;
    transform: translateY(-1px);
}

/* 数字键盘 */
.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 320px;
    margin: 0 auto;
}

.key {
    padding: 15px 0;
    font-size: 22px;
    font-weight: 600;
    border: 1px solid #d8cdb8;
    border-radius: 8px;
    background: #fff;
    color: #2b2b2b;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.key:hover {
    background: #f5efe3;
    border-color: #8a6d3b;
}

.key:active {
    background: #8a6d3b;
    color: #fff;
    transform: scale(0.96);
}

.key-clear {
    color: #b3541e;
    font-weight: 700;
}

.key-back {
    font-size: 20px;
}

/* ============================================================
   追溯结果展示区
   ============================================================ */
.result-section {
    max-width: 860px;
    margin: 0 auto 50px;
    padding: 0 20px;
    width: 100%;
    flex: 1;
}

.trace-result {
    display: none;
    background: rgba(255,255,255,0.97);
    border-radius: 12px;
    border: 1px solid #e2d9c8;
    padding: 28px;
    box-shadow: 0 6px 30px rgba(0,0,0,0.1);
}

.trace-result.show { display: block; animation: fadeUp 0.4s ease; }

@keyframes fadeUp {
    from { opacity:0; transform:translateY(16px); }
    to { opacity:1; transform:translateY(0); }
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #e2d9c8;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.result-header h3 { color: #4a3a1f; font-size: 18px; }

.result-header .status {
    background: #27ae60;
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.result-grid .item {
    display: flex;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px dashed #eee3d0;
}

.result-grid .item .label {
    color: #8a8a8a;
    font-size: 14px;
    min-width: 76px;
    flex-shrink: 0;
}

.result-grid .item .value {
    color: #2b2b2b;
    font-size: 14px;
    font-weight: 500;
}

/* 按钮 */
.btn-detail {
    background: #8a6d3b;
    color: #fff;
    border: none;
    padding: 10px 32px;
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    font-family: inherit;
}

.btn-detail:hover { background: #6f5730; transform: translateY(-1px); }

.detail-divider {
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: #4a3a1f;
    margin: 20px 0 16px;
    padding: 8px 0;
    border-top: 2px solid #e2d9c8;
    border-bottom: 2px solid #e2d9c8;
}

/* 图谱 */
.result-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 16px;
}

.chart-box {
    background: #fff;
    border: 1px solid #e2d9c8;
    border-radius: 10px;
    padding: 14px;
}

.chart-box .chart-title {
    text-align: center;
    font-size: 14px;
    color: #4a3a1f;
    margin-bottom: 10px;
    font-weight: 600;
}

.chart-placeholder {
    min-height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #faf6ee;
    border: 1px solid #e2d9c8;
    border-radius: 6px;
    padding: 14px;
}

.chart-placeholder img { width: 100%; border-radius: 6px; }

.no-image { color: #b8b0a0; font-size: 14px; }

.image-desc {
    margin-top: 8px;
    font-size: 13px;
    color: #555;
    background: #faf6ee;
    padding: 8px 12px;
    border-radius: 6px;
    line-height: 1.6;
}

/* ============================================================
   内容区块（平台介绍 / 新闻 / 政策 / 下载）
   ============================================================ */
.content-section {
    max-width: 860px;
    margin: 30px auto;
    padding: 26px 30px;
    background: rgba(255,255,255,0.94);
    border-radius: 12px;
    border: 1px solid #e2d9c8;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.section-title {
    font-size: 20px;
    color: #4a3a1f;
    letter-spacing: 2px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #8a6d3b;
    display: inline-block;
}

.section-text {
    font-size: 14px;
    color: #555;
    line-height: 1.9;
}

.news-list { list-style: none; }

.news-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed #eee3d0;
}

.news-list li a {
    color: #2b2b2b;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.news-list li a:hover { color: #8a6d3b; }

.news-list .news-date {
    font-size: 12px;
    color: #999;
    background: #f5efe3;
    padding: 2px 10px;
    border-radius: 10px;
}

/* ============================================================
   页脚
   ============================================================ */
.site-footer {
    background: rgba(42,42,42,0.92);
    color: #d8d0c0;
    text-align: center;
    padding: 22px 20px;
    font-size: 13px;
    line-height: 1.9;
    margin-top: auto;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 768px) {
    .site-title { font-size: 20px; }
    .site-subtitle { font-size: 10px; }
    .logo-img { width: 52px; height: 52px; }
    .main-nav { flex-wrap: wrap; gap: 4px; }
    .main-nav a { flex: 1 1 30%; font-size: 14px; padding: 10px 4px; }
    .trace-section { margin-top: 30px; }
    .result-grid, .result-charts { grid-template-columns: 1fr; }
}

/* ============================================================
   独立页面（药材种类/平台介绍/新闻/政策/下载）
   ============================================================ */
.page-main {
    max-width: 1000px;
    margin: 40px auto 50px;
    padding: 0 20px;
    width: 100%;
    flex: 1;
}

/* 药材种类卡片 */
.herb-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 22px;
}

.herb-card {
    background: #faf6ee;
    border: 1px solid #e2d9c8;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s;
}

.herb-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    border-color: #8a6d3b;
}

.herb-card h3 {
    font-size: 18px;
    color: #4a3a1f;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #8a6d3b;
    display: inline-block;
}

.herb-card p {
    font-size: 13px;
    color: #666;
    line-height: 1.9;
}

/* 平台介绍功能卡片 */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-top: 10px;
}

.feature-item {
    background: #faf6ee;
    border: 1px solid #e2d9c8;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s;
}

.feature-item:hover {
    border-color: #8a6d3b;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

.feature-item h3 {
    font-size: 16px;
    color: #4a3a1f;
    margin-bottom: 8px;
}

.feature-item p {
    font-size: 13px;
    color: #666;
    line-height: 1.8;
}

/* 新闻摘要 */
.news-summary {
    font-size: 12px;
    color: #999;
    line-height: 1.7;
    margin-top: 4px;
}

/* 独立页面响应式 */
@media (max-width: 768px) {
    .home-main { flex-direction: column; }
    .home-left, .home-right { flex: 1 1 auto; width: 100%; }
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .herb-grid, .feature-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Admin 登录模态框
   ============================================================ */
.admin-modal-mask {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}


.admin-modal {
    background: #fff;
    border-radius: 12px;
    padding: 34px 32px 28px;
    width: 340px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
    border-top: 4px solid #8a6d3b;
    animation: fadeUp 0.3s ease;
}

.admin-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}

.admin-modal-close:hover { color: #e53935; }

.admin-modal-title {
    font-size: 20px;
    color: #4a3a1f;
    letter-spacing: 2px;
    margin-bottom: 22px;
}

.admin-modal input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #d8cdb8;
    border-radius: 6px;
    font-size: 15px;
    outline: none;
    margin-bottom: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.admin-modal input:focus { border-color: #8a6d3b; }

.admin-modal-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #8a6d3b, #4a3a1f);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s;
}

.admin-modal-btn:hover { background: linear-gradient(135deg, #4a3a1f, #3a2f1a); }

.admin-modal-error {
    color: #e53935;
    font-size: 13px;
    margin-top: 10px;
    min-height: 18px;
}

/* ============================================================
   页脚"提出意见"标签
   ============================================================ */
.footer-feedback {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 26px;
    border: 1px solid #8a6d3b;
    border-radius: 16px;
    color: #e8dcc2;
    font-size: 13px;
    letter-spacing: 1px;
    text-decoration: none;
    transition: all 0.3s;
}

.footer-feedback:hover {
    background: #8a6d3b;
    color: #fff;
}

/* ============================================================
   提出意见页面
   ============================================================ */
.fb-step { margin-bottom: 36px; }

.fb-step-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 16px;
    line-height: 1.7;
}

.fb-type-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.fb-type-option input { display: none; }

.fb-type-option span {
    display: block;
    text-align: center;
    padding: 12px 8px;
    border: 1px solid #d8cdb8;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    transition: all 0.25s;
}

.fb-type-option:hover span { border-color: #8a6d3b; }

.fb-type-option input:checked + span {
    border-color: #8a6d3b;
    background: #f5efe3;
    color: #8a6d3b;
    font-weight: 700;
}

.fb-upload-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.fb-upload {
    width: 108px;
    height: 108px;
    flex-shrink: 0;
    border: 1.5px dashed #d9d9d9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #faf6ee;
    position: relative;
    overflow: hidden;
}

.fb-upload:hover { border-color: #8a6d3b; }

.fb-upload .fb-upload-plus {
    font-size: 32px;
    color: #b8b0a0;
    line-height: 1;
}

.fb-upload img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fb-upload.has-img .fb-upload-plus { display: none; }

.fb-upload-remove {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 12px;
    padding: 2px 10px;
    border-bottom-left-radius: 8px;
    display: none;
}

.fb-upload.has-img:hover .fb-upload-remove { display: block; }

.fb-upload-tip {
    font-size: 12px;
    color: #999;
    line-height: 1.7;
}

.fb-textarea {
    width: 100%;
    min-height: 140px;
    padding: 12px 14px;
    border: 1px solid #d8cdb8;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    resize: vertical;
    line-height: 1.7;
    transition: border-color 0.3s;
    background: #fff;
}

.fb-textarea:focus { border-color: #8a6d3b; }

.fb-input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #d8cdb8;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s;
    background: #fff;
}

.fb-input:focus { border-color: #8a6d3b; }

.fb-counter {
    text-align: right;
    font-size: 12px;
    color: #bfbfbf;
    margin-top: 6px;
}

.fb-submit {
    display: block;
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #8a6d3b, #4a3a1f);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 3px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s;
}

.fb-submit:hover {
    background: linear-gradient(135deg, #4a3a1f, #3a2f1a);
    transform: translateY(-1px);
}

.fb-result {
    display: none;
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
}

.fb-result.success {
    display: block;
    background: #e6f7ed;
    border: 1px solid #b7ebcc;
    color: #27ae60;
}

.fb-result.error {
    display: block;
    background: #fde8e8;
    border: 1px solid #f5c6c6;
    color: #e53935;
}

@media (max-width: 768px) {
    .fb-type-grid { grid-template-columns: repeat(2, 1fr); }
}
