/* PlantHelper 管理后台 - 移动优先全局样式 */
/* 基于 Framework7 iOS 主题，补充管理端特有样式 */

:root {
    --f7-theme-color: #34C759;
    --f7-theme-color-rgb: 52, 199, 89;
    --f7-theme-color-shade: #2DB14E;
    --f7-theme-color-tint: #5EDC7A;
    --f7-panel-width: 260px;
    --card-radius: 12px;
    --card-shadow: 0 1px 4px rgba(0,0,0,0.08);
    --page-bg: #f5f5f5;
    --search-bg: #efeff4;
    --danger-color: #FF3B30;
    --warning-color: #FF9500;
    --success-color: #34C759;
    --info-color: #007AFF;
}

/* === 基础重置 === */
html, body {
    height: 100%;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

body {
    background: var(--page-bg);
    overscroll-behavior: none;
}

/* === 登录页 === */
.login-page {
    background: linear-gradient(135deg, #34C759 0%, #2DB14E 50%, #1A8D34 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 32px 24px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    text-align: center;
}

.login-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #34C759, #2DB14E);
    border-radius: 18px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    box-shadow: 0 4px 16px rgba(52,199,89,0.35);
}

.login-title {
    font-size: 22px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 13px;
    color: #8E8E93;
    margin-bottom: 28px;
}

.login-card .item-content {
    padding-left: 0;
}

.login-card .list {
    margin: 0 0 20px;
}

.login-card .login-btn {
    width: 100%;
    height: 48px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

.login-tip {
    margin-top: 20px;
    font-size: 12px;
    color: #AEAEB2;
}

.login-error {
    color: var(--danger-color);
    font-size: 13px;
    margin-top: 12px;
    min-height: 20px;
}

/* === 面板导航 === */
.panel .page {
    background: #fff;
}

/* === 页面内操作栏 === */
.page-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.page-title-text {
    font-size: 18px;
    font-weight: 700;
    color: #000;
    margin: 0;
}

/* 独立标题（无操作栏） */
.page-content > .page-title-text {
    padding: 12px 16px 4px;
}

.page-toolbar {
    padding: 8px 16px;
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* 导航栏图标 */
.nav-icon {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--f7-theme-color);
    font-style: normal;
}

.panel .user-info {
    padding: 20px 16px;
    background: linear-gradient(135deg, #34C759, #2DB14E);
    color: #fff;
}

.panel .user-info .user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.panel .user-info .user-name {
    font-size: 16px;
    font-weight: 600;
}

.panel .user-info .user-role {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 2px;
}

/* 自定义侧边栏导航 */
.sidebar-nav {
    padding: 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #333;
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
}

.sidebar-item:hover {
    background: rgba(0,0,0,0.03);
}

.sidebar-item.active {
    background: rgba(52,199,89,0.08);
    color: var(--f7-theme-color);
    font-weight: 600;
}

.sidebar-item .sidebar-icon {
    width: 24px;
    text-align: center;
    margin-right: 10px;
    font-size: 16px;
    flex-shrink: 0;
}

/* 分组 */
.sidebar-group {
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.sidebar-title {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #333;
    font-size: 15px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.sidebar-title:hover {
    background: rgba(0,0,0,0.03);
}

.sidebar-title .sidebar-icon {
    width: 24px;
    text-align: center;
    margin-right: 10px;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-arrow {
    margin-left: auto;
    font-size: 10px;
    color: #999;
    transition: transform 0.2s;
}

.sidebar-group.open .sidebar-arrow {
    transform: rotate(180deg);
}

.sidebar-sub {
    display: none;
    background: #f8f8f8;
}

.sidebar-group.open .sidebar-sub {
    display: block;
}

.sidebar-sub .sidebar-item {
    padding-left: 50px;
    font-size: 14px;
    color: #555;
}

.sidebar-sub .sidebar-item.active {
    background: rgba(52,199,89,0.06);
    color: var(--f7-theme-color);
}

/* === 页面容器 === */
.page-content {
    background: var(--page-bg);
    padding-bottom: 20px;
}

.page-header-bar {
    padding: 16px 16px 0;
}

.page-header-bar h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0;
}

.page-header-bar .page-subtitle {
    font-size: 13px;
    color: #8E8E93;
    margin-top: 2px;
}

/* === 统计卡片 === */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px;
}

.stat-card {
    background: #fff;
    border-radius: var(--card-radius);
    padding: 18px 16px;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -12px;
    right: -12px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    opacity: 0.12;
}

.stat-card.stat-users::after { background: var(--f7-theme-color); }
.stat-card.stat-plants::after { background: #11998e; }
.stat-card.stat-goods::after { background: #FF9500; }
.stat-card.stat-just::after { background: #007AFF; }

.stat-card .stat-icon {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

.stat-card .stat-title {
    font-size: 12px;
    color: #8E8E93;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1d1d1f;
    margin-top: 2px;
}

.stat-card .stat-desc {
    font-size: 11px;
    color: #AEAEB2;
    margin-top: 4px;
}

.stat-card.stat-users .stat-value { color: #34C759; }
.stat-card.stat-plants .stat-value { color: #11998e; }
.stat-card.stat-goods .stat-value { color: #FF9500; }
.stat-card.stat-just .stat-value { color: #007AFF; }

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* === 搜索区域 === */
.search-section {
    padding: 8px 16px;
}

.searchbar {
    background: var(--search-bg);
    border-radius: 10px;
    margin: 0;
}

.searchbar .searchbar-input-wrap {
    height: 36px;
}

.searchbar input[type="search"] {
    font-size: 14px;
    height: 36px;
}

.search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.search-filters input,
.search-filters select {
    flex: 1;
    min-width: 100px;
    height: 36px;
    border: 1px solid #E5E5EA;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 13px;
    background: #fff;
    color: #333;
    -webkit-appearance: none;
    appearance: none;
}

.search-filters 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='%238E8E93' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.search-filters .btn-search {
    height: 36px;
    padding: 0 16px;
    background: var(--f7-theme-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

.search-filters .btn-reset {
    height: 36px;
    padding: 0 16px;
    background: #E5E5EA;
    color: #333;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}

/* === 数据卡片（替代表格） === */
.data-cards {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.data-card {
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.data-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.data-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
    display: flex;
    align-items: center;
    gap: 8px;
}

.data-card-body {
    padding: 12px 16px;
}

.data-card-row {
    display: flex;
    align-items: flex-start;
    padding: 6px 0;
    font-size: 13px;
}

.data-card-label {
    color: #8E8E93;
    min-width: 70px;
    flex-shrink: 0;
}

.data-card-value {
    color: #333;
    word-break: break-all;
}

.data-card-actions {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid #f0f0f0;
    justify-content: flex-end;
}

.data-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #E5E5EA;
}

.data-card-img {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
}

/* === 空状态 === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #AEAEB2;
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 14px;
    margin: 0;
}

/* === 按钮 === */
.btn-sm {
    height: 30px;
    line-height: 30px;
    padding: 0 12px;
    font-size: 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-primary { background: var(--f7-theme-color); color: #fff; }
.btn-danger { background: var(--danger-color); color: #fff; }
.btn-warning { background: var(--warning-color); color: #fff; }
.btn-info { background: var(--info-color); color: #fff; }
.btn-outline { background: transparent; color: #333; border: 1px solid #D1D1D6; }
.btn-default { background: #E5E5EA; color: #333; }

.btn-sm:active {
    opacity: 0.7;
    transform: scale(0.97);
}

/* === Badge 标签 === */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
}

.badge-success { background: rgba(52,199,89,0.12); color: #34C759; }
.badge-danger { background: rgba(255,59,48,0.12); color: #FF3B30; }
.badge-warning { background: rgba(255,149,0,0.12); color: #FF9500; }
.badge-info { background: rgba(0,122,255,0.12); color: #007AFF; }
.badge-default { background: #E5E5EA; color: #8E8E93; }

/* === 标签 tag === */
.tag-item {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(52,199,89,0.1);
    color: #34C759;
    border-radius: 4px;
    margin: 2px;
    font-size: 11px;
}

/* === 分页 === */
.pagination-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 16px;
    flex-wrap: wrap;
}

.pagination-bar button {
    min-width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #D1D1D6;
    background: #fff;
    color: #333;
    font-size: 13px;
    cursor: pointer;
}

.pagination-bar button.active {
    background: var(--f7-theme-color);
    color: #fff;
    border-color: var(--f7-theme-color);
}

.pagination-bar button:disabled {
    opacity: 0.4;
    cursor: default;
}

.pagination-bar .page-info {
    font-size: 12px;
    color: #8E8E93;
    margin: 0 8px;
}

/* === Sheet 弹窗表单 === */
.sheet-form-content {
    padding: 8px 16px 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.sheet-form-content .item-content {
    padding-left: 0;
}

.sheet-form-content .list {
    margin: 0;
}

.sheet-form-content textarea {
    width: 100%;
    min-height: 80px;
    border: 1px solid #D1D1D6;
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.sheet-form-content .form-group {
    margin-bottom: 14px;
}

.sheet-form-content .form-label {
    display: block;
    font-size: 13px;
    color: #8E8E93;
    margin-bottom: 6px;
    font-weight: 500;
}

.sheet-form-content .form-input {
    width: 100%;
    height: 40px;
    border: 1px solid #D1D1D6;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 14px;
    background: #fff;
    color: #333;
}

.sheet-form-content .form-input:focus {
    border-color: var(--f7-theme-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(52,199,89,0.15);
}

.sheet-form-content .form-submit {
    width: 100%;
    height: 44px;
    background: var(--f7-theme-color);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
}

.sheet-form-content .form-row {
    display: flex;
    gap: 8px;
}

.sheet-form-content .form-row > * {
    flex: 1;
}

/* === 信息详情面板 === */
.info-panel {
    padding: 8px 0;
}

.info-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: #8E8E93;
    min-width: 72px;
    flex-shrink: 0;
}

.info-value {
    color: #333;
    word-break: break-all;
}

/* === 图片列表 === */
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.image-gallery img {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    border: 1px solid #E5E5EA;
}

/* === Toast 样式 === */
.toast-check .toast-text { color: #34C759; }
.toast-error .toast-text { color: #FF3B30; }
.toast-warning .toast-text { color: #FF9500; }

/* === 审核状态颜色 === */
.status-pending { color: #FF9500; }
.status-approved { color: #34C759; }
.status-rejected { color: #FF3B30; }

/* === 快捷操作区 === */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
}

.quick-action-btn {
    flex: 1;
    min-width: 70px;
    padding: 10px;
    background: #fff;
    border: 1px solid #E5E5EA;
    border-radius: 10px;
    text-align: center;
    font-size: 12px;
    color: #333;
    cursor: pointer;
    box-shadow: var(--card-shadow);
}

.quick-action-btn .action-icon {
    font-size: 22px;
    display: block;
    margin-bottom: 4px;
}

/* === 系统信息表 === */
.sys-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.sys-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.sys-table td:first-child {
    color: #8E8E93;
    width: 80px;
}

.sys-table tr:last-child td {
    border-bottom: none;
}

/* === 区块卡片 === */
.block-card {
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    margin: 0 16px 12px;
    overflow: hidden;
}

.block-card-header {
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
    border-bottom: 1px solid #f0f0f0;
}

.block-card-body {
    padding: 12px 16px;
}

/* === Action Bar === */
.action-bar {
    display: flex;
    gap: 8px;
    padding: 0 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.action-bar .btn-sm {
    flex: 1;
    min-width: 80px;
    justify-content: center;
}

/* === 植物请求卡片 === */
.plant-request-grid {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.plant-req-card {
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.plant-req-header {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f0f0f0;
    flex-wrap: wrap;
    gap: 8px;
}

.plant-req-name {
    font-size: 16px;
    font-weight: 700;
    color: #1d1d1f;
}

.plant-req-count {
    font-size: 13px;
    background: rgba(255,149,0,0.1);
    color: #FF9500;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.plant-req-actions {
    display: flex;
    gap: 6px;
}

.plant-req-list {
    background: #fafafa;
}

.plant-req-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.plant-req-item:last-child {
    border-bottom: none;
}

.plant-req-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #E8F8ED;
    color: #34C759;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    flex-shrink: 0;
}

.plant-req-info {
    flex: 1;
    min-width: 0;
}

.plant-req-user {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.plant-req-time {
    font-size: 12px;
    color: #AEAEB2;
    margin-top: 2px;
}

.plant-req-remind {
    text-align: center;
    flex-shrink: 0;
}

.plant-req-remind .count {
    font-size: 18px;
    font-weight: 700;
    color: #FF3B30;
}

.plant-req-remind .label {
    font-size: 11px;
    color: #AEAEB2;
}

/* === 审核弹窗图片 === */
.audit-preview-img {
    width: 100%;
    max-height: 240px;
    object-fit: contain;
    border-radius: 12px;
    margin-bottom: 12px;
    background: #f0f0f0;
}

/* === 响应式增强 === */
@media (min-width: 768px) {
    .data-cards {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .search-filters input,
    .search-filters select {
        min-width: 140px;
        flex: 0 1 auto;
    }

    .search-filters .btn-search,
    .search-filters .btn-reset {
        flex: 0 0 auto;
    }
}

@media (min-width: 1024px) {
    .data-cards {
        grid-template-columns: repeat(3, 1fr);
    }

    .page-header-bar h2 {
        font-size: 28px;
    }
}

/* === iOS 风格滚动条 === */
::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* === 过渡动画 === */
.data-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.data-card:active {
    transform: scale(0.98);
}

/* === 面板遮罩 === */
.panel-backdrop {
    background: rgba(0,0,0,0.4);
}

/* === 图片预览 === */
.photo-browser-dark .photo-browser-of {
    background: #000;
}

/* === 上传审核状态栏 === */
.filter-bar {
    display: flex;
    gap: 8px;
    padding: 0 16px 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.filter-chip {
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    background: #E5E5EA;
    color: #333;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.filter-chip.active {
    background: var(--f7-theme-color);
    color: #fff;
}

/* === Toolbar（顶部操作栏） === */
.page-toolbar {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    flex-wrap: wrap;
}

.toolbar-search {
    display: flex;
    gap: 6px;
    flex: 1;
    min-width: 200px;
}

.toolbar-search input {
    flex: 1;
    height: 32px;
    padding: 0 12px;
    border: 1px solid #e5e5ea;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.toolbar-search input:focus {
    border-color: #07c160;
}

/* === Popup 自定义 === */
.custom-popup {
    border-radius: 16px 16px 0 0;
    max-height: 80vh;
}

.custom-popup .page-content {
    padding: 0;
}

/* === 日期范围选择器 === */
.date-range-picker {
    display: flex;
    gap: 8px;
    align-items: center;
}

.date-range-picker input {
    flex: 1;
}

.date-range-picker .sep {
    color: #8E8E93;
    font-size: 14px;
}

/* === Switch/Toggle === */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.toggle-row .toggle-label {
    font-size: 14px;
    color: #333;
}

/* === 覆盖 Framework7 默认样式 === */
.navbar .title {
    font-weight: 700;
}

.list .item-title {
    font-weight: 400;
}

.block {
    margin: 0;
}

.block-title {
    font-size: 14px;
    color: #8E8E93;
    text-transform: none;
    margin-bottom: 8px;
}

/* 去除 Framework7 列表项的左侧线和外边距 */
.list .item-content {
    padding-left: 0;
}

/* FAB 按钮 */
.fab {
    background: var(--f7-theme-color);
}

.fab i {
    font-size: 24px;
}

/* === Sheet-modal 限制高度并滚动 === */
.sheet-modal-inner {
    max-height: 80vh !important;
    overflow-y: auto !important;
    border-radius: 16px 16px 0 0;
}
