/* 全局公共样式 - 移动端自适应 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f6fa;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}

/* 容器 */
.container {
    max-width: 750px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
}

/* 顶部标题栏 */
.header {
    background: linear-gradient(135deg, #4a90d9, #357abd);
    color: #fff;
    padding: 16px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 卡片 */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* 表单 */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #555;
    font-size: 14px;
    font-weight: 500;
}
.form-group label .required {
    color: #e74c3c;
    margin-left: 2px;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    background: #fafafa;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #4a90d9;
    background: #fff;
}
.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    text-align: center;
    transition: opacity 0.2s;
}
.btn:active { opacity: 0.8; }
.btn-primary {
    background: linear-gradient(135deg, #4a90d9, #357abd);
    color: #fff;
    width: 100%;
}
.btn-success { background: #27ae60; color: #fff; width: 100%; }
.btn-default { background: #ecf0f1; color: #333; }
.btn-danger { background: #e74c3c; color: #fff; }

/* 图片上传 */
.image-upload {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.image-upload .img-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}
.image-upload .img-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.image-upload .img-item .del {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    font-size: 12px;
    cursor: pointer;
}
.image-upload .add-btn {
    width: 80px;
    height: 80px;
    border: 1px dashed #ccc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 28px;
    cursor: pointer;
}

/* 状态标签 */
.status-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
}
.status-pending { background: #fff3cd; color: #856404; }
.status-processing { background: #d1ecf1; color: #0c5460; }
.status-replied { background: #d4edda; color: #155724; }
.status-completed { background: #d4edda; color: #155724; }
.status-closed { background: #e2e3e5; color: #383d41; }

/* 消息气泡 */
.chat-box {
    padding: 12px;
    background: #f5f6fa;
    border-radius: 8px;
    margin: 8px 0;
}
.msg-item {
    display: flex;
    margin-bottom: 12px;
}
.msg-item.me { justify-content: flex-end; }
.msg-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 12px;
    word-break: break-all;
}
.msg-item.me .msg-bubble {
    background: #95ec69;
    color: #000;
    border-bottom-right-radius: 4px;
}
.msg-item.other .msg-bubble {
    background: #fff;
    color: #333;
    border-bottom-left-radius: 4px;
}
.msg-meta {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

/* 列表项 */
.list-item {
    background: #fff;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.list-item .title {
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}
.list-item .desc {
    color: #666;
    font-size: 13px;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.list-item .meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
}

/* 加载提示 */
.loading {
    text-align: center;
    padding: 20px;
    color: #999;
}

/* 空状态 */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}
.empty .icon { font-size: 48px; margin-bottom: 12px; }

/* Toast */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 9999;
    font-size: 14px;
}

/* 隐藏 */
.hidden { display: none !important; }

/* 管理后台样式 */
.admin-layout {
    display: flex;
    min-height: 100vh;
    background: #f0f2f5;
}
.admin-sidebar {
    width: 200px;
    background: #001529;
    color: #fff;
    padding: 16px 0;
}
.admin-sidebar .menu-item {
    padding: 12px 20px;
    cursor: pointer;
    color: #bbb;
}
.admin-sidebar .menu-item.active,
.admin-sidebar .menu-item:hover {
    background: #1890ff;
    color: #fff;
}
.admin-content {
    flex: 1;
    padding: 20px;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}
.admin-table th, .admin-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}
.admin-table th {
    background: #fafafa;
    font-weight: 600;
    color: #555;
}
