/* style.css - 完整修复版本 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #ededed;
    color: #000;
    height: 100vh;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* 顶部导航 */
.nav-header {
    background: #ededed;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 0.5px solid #d6d6d6;
    position: sticky;
    top: 0;
    z-index: 100;
    height: 44px;
}

.nav-header h1 {
    font-size: 17px;
    font-weight: 600;
}

.nav-header .actions {
    display: flex;
    gap: 16px;
    font-size: 20px;
}

.nav-header .actions span {
    cursor: pointer;
}

/* 搜索栏 */
.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: #ededed;
    border-bottom: 0.5px solid #d6d6d6;
}

.search-bar input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: #fff;
    font-size: 15px;
    outline: none;
}

.search-bar span {
    color: #576b95;
    font-size: 15px;
    cursor: pointer;
    white-space: nowrap;
}

/* 主内容区 */
.content {
    height: calc(100vh - 44px - 56px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.content::-webkit-scrollbar { 
    display: none; 
}

/* 列表项 */
.list-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 0.5px solid #e5e5e5;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.list-item:active { 
    background: #e5e5e5; 
}

.item-avatar {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-right: 12px;
    flex-shrink: 0;
    background: #f5f5f5;
}

.item-body {
    flex: 1;
    min-width: 0;
}

.item-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.item-name {
    font-size: 16px;
    color: #000;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-time {
    font-size: 12px;
    color: #b2b2b2;
    flex-shrink: 0;
    margin-left: 8px;
}

.item-desc {
    font-size: 14px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 角标 */
.badge {
    position: absolute;
    top: 8px;
    left: 52px;
    min-width: 18px;
    height: 18px;
    background: #fa5151;
    color: #fff;
    font-size: 12px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    font-weight: 500;
}

/* 状态指示器 */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.status-dot.online { 
    background: #07c160; 
}

.status-dot.active { 
    background: #10aeff; 
}

.status-dot.idle { 
    background: #ffc300; 
}

.status-dot.offline { 
    background: #999; 
}

/* 分组标题 */
.section-title {
    padding: 20px 16px 8px;
    font-size: 13px;
    color: #999;
    background: #ededed;
}

/* ==================== 底部导航 - 关键修复 ==================== */

.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #f7f7f7;
    border-top: 0.5px solid #d6d6d6;
    display: flex;
    /* 三等分关键 */
    flex-direction: row;
    padding-bottom: env(safe-area-inset-bottom);
}

.tab-item {
    /* 强制每个标签等宽 */
    flex: 1 1 0;
    width: 33.333%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    color: #999;
    transition: color 0.2s;
    position: relative;
    /* 重置所有padding和margin */
    padding: 0;
    margin: 0;
    height: 100%;
}

.tab-item.active { 
    color: #07c160; 
}

.tab-item .tab-icon {
    font-size: 24px;
    line-height: 1;
    margin-bottom: 3px;
    display: block;
}

.tab-item .tab-label {
    font-size: 11px;
    line-height: 1;
    display: block;
}

/* 角标定位 */
.tab-badge {
    position: absolute;
    top: 4px;
    /* 基于图标居中偏右 */
    left: 50%;
    margin-left: 6px;
    min-width: 16px;
    height: 16px;
    background: #fa5151;
    color: #fff;
    font-size: 11px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-weight: 500;
}

/* ==================== 功能按钮 ==================== */

.action-buttons {
    display: flex;
    background: #fff;
    margin: 10px 0;
    padding: 16px;
    gap: 16px;
    justify-content: space-around;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    flex: 1;
}

.action-btn .icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
}

.action-btn .label {
    font-size: 12px;
    color: #666;
}

/* 设置项 */
.settings-list {
    background: #fff;
    margin-top: 10px;
}

.settings-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 0.5px solid #e5e5e5;
}

.settings-item .icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 18px;
}

.settings-item .content {
    flex: 1;
}

.settings-item .content .title {
    font-size: 16px;
}

.settings-item .arrow {
    color: #c5c5c5;
    font-size: 14px;
}

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

.empty-state .icon { 
    font-size: 64px; 
    margin-bottom: 16px; 
}

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

/* 页面切换动画 */
.page-slide {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: translateX(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

/* 返回按钮 */
.back-btn {
    color: #576b95;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* 子页面头部 */
.sub-header {
    background: #ededed;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 0.5px solid #d6d6d6;
    height: 44px;
}

.sub-header h2 {
    font-size: 17px;
    font-weight: 600;
    flex: 1;
    text-align: center;
    margin-right: 60px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 子页面内容 */
.sub-content {
    height: calc(100vh - 44px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 相册网格 */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 2px;
}

.photo-grid .photo {
    aspect-ratio: 1;
    background: #ddd;
    position: relative;
    overflow: hidden;
}

.photo-grid .photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-grid .photo .photo-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 4px 4px;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    color: #fff;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 按钮 */
.btn-primary {
    padding: 12px 32px;
    background: #07c160;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
}

.btn-primary:active { 
    opacity: 0.8; 
}

.btn-danger {
    padding: 12px 32px;
    background: #fa5151;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
}

/* 表单 */
.form-group {
    padding: 12px 16px;
    background: #fff;
    border-bottom: 0.5px solid #e5e5e5;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: #999;
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 0;
    border: none;
    font-size: 16px;
    outline: none;
    background: transparent;
}

/* 隐藏文件输入 */
.file-input { 
    display: none; 
}

