/* i四班代办平台 公共样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f6fa;
    color: #333;
    font-size: 14px;
}

/* 底部导航栏 */
.tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #fff;
    border-top: 1px solid #e5e5e5;
    display: flex;
    z-index: 1000;
}

.tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #999;
    font-size: 11px;
}

.tabbar-item.active {
    color: #4a90d9;
}

.tabbar-item .icon {
    font-size: 22px;
    margin-bottom: 2px;
}

/* 页面容器 */
.page-container {
    max-width: 480px;
    margin: 0 auto;
    padding-bottom: 70px;
    min-height: 100vh;
}

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

/* 按钮 */
.btn {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: opacity 0.2s;
}

.btn-primary {
    background: #4a90d9;
    color: #fff;
}

.btn-success {
    background: #52c41a;
    color: #fff;
}

.btn-danger {
    background: #ff4d4f;
    color: #fff;
}

.btn-warning {
    background: #faad14;
    color: #fff;
}

.btn-default {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
}

.btn:active {
    opacity: 0.8;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #4a90d9;
}

/* 列表项 */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.list-item .label {
    color: #666;
}

.list-item .value {
    font-weight: 500;
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.tag-blue { background: #e6f7ff; color: #1890ff; }
.tag-green { background: #f6ffed; color: #52c41a; }
.tag-orange { background: #fff7e6; color: #fa8c16; }
.tag-red { background: #fff1f0; color: #f5222d; }
.tag-gray { background: #f5f5f5; color: #999; }

/* 价格 */
.price {
    color: #ff4d4f;
    font-weight: bold;
}

.price::before {
    content: '¥';
    font-size: 12px;
}

/* 头部导航 */
.navbar {
    background: #4a90d9;
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .back {
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    margin-right: 12px;
}

.navbar .title {
    font-size: 17px;
    font-weight: 500;
}

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

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

/* 网格布局 */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

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

/* 服务入口卡片 */
.service-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px 12px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.service-card:active {
    transform: scale(0.95);
}

.service-card .icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.service-card .name {
    font-size: 14px;
    font-weight: 500;
}

/* 地址选择项 */
.address-item {
    display: block;
    padding: 14px 16px;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 0;
    cursor: pointer;
    transition: background 0.15s;
    background: #fff;
    margin-left: -16px;
    margin-right: -16px;
    width: calc(100% + 32px);
    box-sizing: border-box;
}

.address-item:first-child {
    margin-top: -12px;
}

.address-item:last-child {
    border-bottom: none;
    margin-bottom: -12px;
    border-radius: 0 0 10px 10px;
}

.address-item.selected {
    background: #f0f7ff;
}

.address-item .addr-name {
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 15px;
    color: #333;
}

.address-item .addr-detail {
    font-size: 13px;
    color: #888;
}

/* 隐藏单选框默认样式 */
.address-item input[type="radio"],
.address-item input[type="checkbox"] {
    display: none;
}

/* 图片上传预览 */
.upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.upload-preview img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.upload-btn {
    width: 80px;
    height: 80px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 24px;
    cursor: pointer;
}

/* 聊天页面 */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 110px);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.chat-msg {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
}

.chat-msg.self {
    justify-content: flex-end;
}

.chat-msg .bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 16px;
    background: #fff;
    word-break: break-word;
    line-height: 1.4;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.chat-msg.self .bubble {
    background: #95ec69;
}

.chat-msg:not(.self) .bubble {
    border-top-left-radius: 4px;
}

.chat-msg.self .bubble {
    border-top-right-radius: 4px;
}

.chat-msg .bubble img {
    max-width: 200px;
    border-radius: 8px;
    display: block;
}

.chat-input-bar {
    padding: 10px 12px;
    background: #f5f5f5;
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-input-bar input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 20px;
    outline: none;
}

/* 后台通用样式 */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    background: #1a1a2e;
    color: #fff;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    font-size: 20px;
}

.admin-header a {
    color: #fff;
    text-decoration: none;
    margin-left: 15px;
}

.admin-table {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.admin-table th,
.admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}

.admin-table tr:hover {
    background: #f8f9fa;
}

/* 响应式 */
@media (max-width: 480px) {
    .page-container {
        padding-bottom: 60px;
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}
