/* 微信小程序原型 - 公共样式 */

* {
    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-color: #f5f5f5;
    color: #333;
    line-height: 1.5;
}

/* 页面容器 */
.page {
    max-width: 414px;
    margin: 0 auto;
    background-color: #fff;
    position: relative;
}

.page-no-nav {
    padding-bottom: 0;
}

/* 导航栏 */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: #fff;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 80px;
}

.navbar-title {
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.navbar-right {
    min-width: 80px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* 微信小程序胶囊 */
.capsule {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    width: 80px;
    position: relative;
    height: 30px;
}

.capsule::after {
    content: '胶囊';
    position: absolute;
    top: 40%;
    right: 10px;
    transform: translateY(-50%);
    font-size: 12px;
    height: 12px;
    border-radius: 50%;
}

.capsule-dot {
    display: flex;
    gap: 3px;
    cursor: pointer;
    position: relative;
    left: 10px;
}

.capsule-dot span {
    display: block;
    width: 4px;
    height: 4px;
    background-color: #333;
    border-radius: 50%;
}

/* 浅色背景导航栏中的胶囊 */
.navbar-light .capsule {
    background-color: rgba(255, 255, 255, 0.9);
}

.capsule-dot span {
    background-color: #333;
}

/* 返回按钮 */
.back-btn {
    display: flex;
    align-items: center;
    color: #333;
    text-decoration: none;
    font-size: 14px;
}

.back-icon {
    font-size: 20px;
}

/* 底部导航栏 */
.tabbar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 414px;
    height: 55px;
    background-color: #fff;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
}

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

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

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

/* 卡片样式 */
.card {
    background-color: #fff;
    border-radius: 8px;
    padding: 16px;
    margin: 12px 16px;
}

/* 列表项 */
.list-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background-color: #fff;
    border-bottom: 1px solid #f5f5f5;
}

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

.list-item:active {
    background-color: #f9f9f9;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-primary {
    background-color: #07c160;
    color: #fff;
}

.btn-secondary {
    background-color: #fff;
    color: #333;
    border: 1px solid #ddd;
}

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

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-large {
    padding: 14px 32px;
    font-size: 17px;
    width: 100%;
}

.btn:active {
    opacity: 0.8;
}

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

.tag-success {
    background-color: #e6f7e6;
    color: #07c160;
}

.tag-warning {
    background-color: #fff7e6;
    color: #faad14;
}

.tag-danger {
    background-color: #fff1f0;
    color: #ff4d4f;
}

.tag-info {
    background-color: #e6f7ff;
    color: #1890ff;
}

/* 输入框 */
.input-group {
    margin-bottom: 16px;
}

.input-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
}

.input:focus {
    outline: none;
    border-color: #07c160;
}

/* 文本 */
.text-primary {
    color: #07c160;
}

.text-danger {
    color: #ff4d4f;
}

.text-warning {
    color: #faad14;
}

.text-muted {
    color: #999;
}

.text-small {
    font-size: 12px;
}

.text-large {
    font-size: 18px;
}

/* 金额 */
.price {
    color: #ff4d4f;
    font-weight: 600;
}

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

.price-large {
    font-size: 24px;
}

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

.empty-icon {
    font-size: 64px;
    color: #ddd;
    margin-bottom: 16px;
}

.empty-text {
    color: #999;
    font-size: 14px;
}

/* 分割线 */
.divider {
    height: 8px;
    background-color: #f5f5f5;
}

.line-divider {
    height: 1px;
    background-color: #eee;
    margin: 12px 0;
}

/* 加载中 */
.loading {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
}

/* 宫格布局 */
.grid {
    display: grid;
    gap: 12px;
}

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

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

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

/* Tab切换 */
.tab-switch {
    display: flex;
    background-color: #fff;
    border-bottom: 1px solid #eee;
}

.tab-item {
    flex: 1;
    text-align: center;
    padding: 14px 0;
    font-size: 14px;
    color: #666;
    text-decoration: none;
    position: relative;
}

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

.tab-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background-color: #07c160;
}

/* 头像 */
.avatar {
    border-radius: 50%;
    object-fit: cover;
}

.avatar-small {
    width: 32px;
    height: 32px;
}

.avatar-medium {
    width: 48px;
    height: 48px;
}

.avatar-large {
    width: 64px;
    height: 64px;
}

/* 徽标 */
.badge {
    position: relative;
}

.badge::after {
    content: attr(data-badge);
    position: absolute;
    top: -4px;
    right: -8px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background-color: #ff4d4f;
    color: #fff;
    font-size: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 复选框 */
.checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}

.checkbox.checked {
    background-color: #07c160;
    border-color: #07c160;
}

.checkbox.checked::after {
    content: '✓';
    color: #fff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
}

/* 响应式 */
@media (max-width: 374px) {
    .navbar-title {
        font-size: 16px;
    }
}
