/* ========== 全局样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif;
    font-size: 16px;
    color: #333;
    background: #f5f5f5;
    line-height: 1.6;
}

a {
    color: #2c7be5;
    text-decoration: none;
}

/* ========== 容器 ========== */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 15px;
}

/* ========== 顶部栏 ========== */
.header {
    background: #2c7be5;
    color: #fff;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 18px;
    font-weight: 500;
}

.header a {
    color: #fff;
    font-size: 16px;
}

/* ========== 首页网格 ========== */
.home-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
}

.home-grid a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: calc(50% - 6px);
    height: 100px;
    background: #fff;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 500;
    color: #333;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.home-grid a .icon {
    font-size: 28px;
    margin-bottom: 6px;
}

/* ========== 表单 ========== */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 16px;
    color: #666;
    margin-bottom: 5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    -webkit-appearance: none;
    appearance: none;
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2c7be5;
}

/* ========== 按钮 ========== */
.btn {
    display: block;
    width: 100%;
    padding: 14px;
    font-size: 18px;
    font-weight: 500;
    color: #fff;
    background: #2c7be5;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
}

.btn:active {
    background: #1a68d1;
}

.btn-success {
    background: #00b894;
}

.btn-success:active {
    background: #00a381;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:active {
    background: #c0392b;
}

.btn-small {
    display: inline-block;
    width: auto;
    padding: 8px 16px;
    font-size: 15px;
}

/* ========== 消息提示 ========== */
.msg {
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 16px;
}

.msg-ok {
    background: #d4edda;
    color: #155724;
}

.msg-err {
    background: #f8d7da;
    color: #721c24;
}

/* ========== 列表 / 表格 ========== */
.list-card {
    background: #fff;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.list-card .title {
    font-size: 16px;
    font-weight: 500;
}

.list-card .meta {
    font-size: 15px;
    color: #999;
    margin-top: 4px;
}

.list-card .qty {
    font-size: 20px;
    font-weight: 600;
    color: #2c7be5;
}

.list-card .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ========== 统计卡片 ========== */
.stat-row {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.stat-card {
    flex: 1;
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.stat-card .num {
    font-size: 24px;
    font-weight: 600;
}

.stat-card .label {
    font-size: 15px;
    color: #999;
    margin-top: 4px;
}

.stat-card.green .num { color: #00b894; }
.stat-card.red .num { color: #e74c3c; }

/* ========== 图片预览 ========== */
.img-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 6px;
    margin-top: 8px;
}

/* ========== 标签 ========== */
.tag {
    display: inline-block;
    padding: 3px 10px;
    font-size: 14px;
    border-radius: 4px;
    color: #fff;
}

.tag-nongya { background: #e74c3c; }
.tag-zhongzi { background: #00b894; }
.tag-feiliao { background: #f39c12; }

/* ========== 空状态 ========== */
.empty {
    text-align: center;
    padding: 40px 0;
    color: #999;
    font-size: 16px;
}

/* ========== 电脑端适配 ========== */
@media (min-width: 768px) {
    .container {
        max-width: 700px;
        padding: 20px;
    }

    .home-grid a {
        height: 120px;
        font-size: 20px;
    }

    .btn {
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }
}
