/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f2f2f2;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

/* 页面切换基础样式 */
.page {
    display: none;
    position: relative;
    width: 100%;
    min-height: 100vh;
    flex-direction: column;
    background-color: #f7f7f7;
    margin: 0;
    padding: 0;
}

#app-page {
    margin: 0;
    padding: 0;
    position: relative;
}

/* iOS顶部安全区域填充 */
.app-header-top {
    margin-top: 0 !important;
    padding-top: max(env(safe-area-inset-top), 0.75rem) !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 100;
}

/* 确保header覆盖顶部白色区域（iOS刘海屏） */
#app-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: max(env(safe-area-inset-top), 0);
    background-color: #07C160;
    z-index: 99;
}

#app-page header {
    margin-top: 0;
}

/* 为主内容区域添加顶部padding，避免被固定header遮挡 */
#app-page main {
    padding-top: calc(3rem + max(env(safe-area-inset-top), 0.75rem));
}

.page.active {
    display: flex;
}

#app-page {
    padding-bottom: 60px;
}

/* 登录和注册页面样式 */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #07C160 0%, #06b357 100%);
}

.app-title {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.login-form {
    background: white;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-form:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

.form-group input:focus {
    outline: none;
    border-color: #07C160;
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
    background-color: white;
}

/* 按钮样式 */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: #07C160;
    color: white;
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.3);
}

.btn-primary:hover {
    background-color: #06b357;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(7, 193, 96, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-back {
    background-color: #f0f0f0;
    color: #333;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 8px;
}

.btn-back:hover {
    background-color: #e0e0e0;
    transform: translateY(-1px);
}

.btn-small {
    background-color: #07C160;
    color: white;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-small:hover {
    background-color: #06b357;
    transform: translateY(-1px);
}

.switch-page {
    text-align: center;
    margin-top: 1.5rem;
    color: #666;
    font-size: 0.9rem;
}

.switch-page a {
    color: #07C160;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.switch-page a:hover {
    text-decoration: underline;
    color: #06b357;
}

/* 主应用页面样式 */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #07C160;
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.app-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-btn {
    background: transparent;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.header-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 主内容区域 */
.app-main {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
    background-color: #fff;
    position: relative;
}

/* 消息界面布局 */
.message-view {
    display: flex;
    height: 100%;
    background-color: #fff;
}

/* 左侧消息列表 */
.message-list-container {
    width: 100%;
    max-width: 100%;
    border-right: none;
    display: flex;
    flex-direction: column;
    background-color: #fafafa;
}

.search-bar {
    padding: 1rem;
    border-bottom: 1px solid #e5e5e5;
    background-color: #fff;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 3rem;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 0.9rem;
    background-color: #f5f5f5;
    transition: all 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: #07C160;
    background-color: #fff;
    box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.1);
}

.message-list {
    flex: 1;
    overflow-y: auto;
}

/* 消息列表项 - 优化为微信风格 */
.message-item {
    display: flex;
    align-items: center;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: white;
}

.message-item:hover {
    background-color: #f8f8f8;
}

.message-item.active {
    background-color: #e8f5e8;
}

.message-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #07C160, #06b357);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    margin-right: 0.85rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.message-sender {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-time {
    font-size: 0.75rem;
    color: #999;
    white-space: nowrap;
}

.message-preview {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 100%;
    word-break: break-all;
}

.unread-badge {
    background-color: #FF3B30;
    color: white;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    margin-left: 0.5rem;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(255, 59, 48, 0.3);
}

/* 右侧内容区域 */
.content-container {
    flex: 1;
    display: none;
    flex-direction: column;
    height: 100%;
    background-color: #fff;
    position: relative;
}

.content-container.active {
    display: flex;
}

/* 个人信息页面 */
.profile-container {
    padding: 0;
    background-color: #f7f7f7;
    height: 100%;
    overflow-y: auto;
}

.profile-hero {
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    position: relative;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    border: none !important;
    border-bottom: none !important;
    overflow: hidden !important;
}

/* 让下方内容区域无缝衔接，消除白色间隙 */
.profile-hero + div {
    margin-top: 0 !important;
    padding-top: 0 !important;
    border-top: none !important;
    background: transparent !important;
    position: relative;
    z-index: 1;
}

.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: transparent !important;
    overflow: hidden;
    border: none !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.avatar:hover {
    transform: scale(1.03);
}

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

.profile-hero-overlay {
    background: linear-gradient(135deg, rgba(7, 193, 96, 0.85), rgba(6, 179, 87, 0.85));
    mix-blend-mode: multiply;
    pointer-events: none;
}

.edit-pen {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(0,0,0,0.04);
    color: #6b7280;
    font-size: 14px;
    transition: all 0.2s ease;
}

.edit-pen:hover {
    background: rgba(7, 193, 96, 0.12);
    color: #07C160;
}

/* 强制通知列表浅色风格，避免不同浏览器黑白交替 */
:root {
    color-scheme: light;
}

#messages-container,
.message-list,
.message-item,
.content-view,
main,
body {
    background-color: #ffffff !important;
    color: #1f2933;
}

.message-item {
    border-bottom: 1px solid #f1f1f1;
}

/* 主题切换（简单版本） */
html[data-theme="dark"] body {
    background-color: #0f172a;
    color: #e2e8f0;
}

html[data-theme="dark"] .profile-container {
    background-color: #0f172a;
}

html[data-theme="dark"] .profile-card,
html[data-theme="dark"] .setting-item {
    background-color: #1e293b;
    border-color: #334155;
}

html[data-theme="dark"] .info-item {
    border-color: #334155;
}

html[data-theme="dark"] .setting-item:hover {
    background-color: #0f172a;
}

html[data-theme="dark"] .text-gray-800,
html[data-theme="dark"] .text-gray-900 {
    color: #e2e8f0;
}

html[data-theme="dark"] .text-gray-500 {
    color: #94a3b8;
}

.profile-card {
    overflow: hidden;
}

.profile-info-list .info-item div:last-child {
    text-align: right;
}

.api-key-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* API指南 */
.api-guide {
    background-color: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
}

.api-guide h3 {
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guide-item {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f5f5f5;
}

.guide-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.guide-item h4 {
    margin-bottom: 0.75rem;
    color: #555;
    font-size: 1rem;
    font-weight: 600;
}

.guide-item p {
    margin-bottom: 0.5rem;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

.guide-item code {
    display: block;
    background-color: #1e1e1e;
    color: #fff;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    overflow-x: auto;
    transition: all 0.3s ease;
}

.guide-item code:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 消息详情页面 */
.message-detail-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #fafafa;
    height: 100%;
}

.detail-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e5e5;
    background-color: white;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.detail-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #07C160;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
}

.detail-sender {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.detail-messages,
#detail-messages {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.detail-message-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 80%;
}

.detail-message-item.sent {
    align-self: flex-end;
}

.detail-message-item.received {
    align-self: flex-start;
}

.detail-message-content {
    padding: 0.85rem 1rem;
    border-radius: 18px;
    font-size: 0.95rem;
    font-weight: 500; /* 加粗字体 */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', '微软雅黑', 'SimSun', '宋体', 'SimHei', '黑体', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.5;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    max-width: 100%;
    overflow-x: hidden;
}

/* 聊天消息内容字体大小（可通过设置调整） */
.chat-message-content {
    font-size: 0.95rem; /* 默认中等大小 */
    font-weight: 500; /* 加粗字体 */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', '微软雅黑', 'SimSun', '宋体', 'SimHei', '黑体', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.detail-message-item.sent .detail-message-content {
    background-color: #07C160;
    color: white;
    border-bottom-right-radius: 4px;
}

.detail-message-item.received .detail-message-content {
    background-color: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.detail-message-time {
    font-size: 0.75rem;
    color: #999;
    text-align: right;
}

/* 聊天界面 */
.chat-view {
    display: none;
    flex-direction: column;
    height: 100%;
    background-color: #fafafa;
}

.chat-view.active {
    display: flex;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 2rem;
    color: #999;
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: #666;
    font-size: 1.2rem;
}

.empty-state p {
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 300px;
}

/* 分页样式 */
.pagination {
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    background-color: white;
    border-top: 1px solid #e5e5e5;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: white;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #f5f5f5;
    border-color: #07C160;
    color: #07C160;
}

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

.pagination-info {
    color: #666;
    font-size: 0.9rem;
}

/* 消息提示 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    background-color: #333333;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 80%;
    word-wrap: break-word;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background-color: #07C160;
}

.toast.error {
    background-color: #FF3B30;
}

.toast.warning {
    background-color: #FF9500;
}

.toast.info {
    background-color: #007AFF;
}

/* 底部导航栏 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #ffffff !important;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
    flex: 1;
}

.nav-item:hover {
    color: #333;
    background-color: rgba(0, 0, 0, 0.02);
}

.nav-item.active {
    color: #333;
    background-color: rgba(0, 0, 0, 0.03);
    font-weight: 600;
}

.nav-item i {
    display: none;
}

.nav-item span {
    font-size: 0.9rem;
    font-weight: 500;
}

/* 响应式设计优化 */
@media (max-width: 768px) {
    .app-main {
        flex-direction: column;
    }
    
    .message-list-container {
        width: 100%;
        max-width: none;
        border-right: none;
        height: 100%;
    }
    
    .content-container {
        height: 100%;
    }
    
    .profile-container {
        padding: 1rem;
    }
    
    .profile-info,
    .api-guide {
        margin-bottom: 1rem;
        padding: 1rem;
    }
    
    .login-form {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .app-title {
        font-size: 2rem;
    }
    
    /* 移动端toast样式优化 */
    .toast {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* 内容视图 */
.content-view {
    display: none !important;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.content-view.active {
    display: flex !important;
}

/* 主内容区域 */
main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    background-color: #fff;
}

/* 为主内容区域添加顶部padding，避免被固定header遮挡 */
#app-page main {
    padding-top: calc(3rem + max(env(safe-area-inset-top), 0.75rem));
}

/* 消息详情界面布局优化 */
#message-detail {
    display: none !important;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
}

#message-detail.active {
    display: flex !important;
}

/* 确保消息详情界面的头部和底部不伸缩 */
#message-detail > div:first-child {
    flex-shrink: 0;
    z-index: 10;
}

#message-detail > div:last-child {
    flex-shrink: 0;
    z-index: 10;
}

/* 滚动条样式优化 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(7, 193, 96, 0.1);
    border-radius: 50%;
    border-top-color: #07C160;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 平滑过渡动画 */
* {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

/* 卡片悬停效果 */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* 文本选择样式 */
::selection {
    background-color: rgba(7, 193, 96, 0.2);
    color: #07C160;
}

::-moz-selection {
    background-color: rgba(7, 193, 96, 0.2);
    color: #07C160;
}

/* 焦点样式优化 */
:focus {
    outline: none;
}

.focus-visible {
    outline: 2px solid #07C160;
    outline-offset: 2px;
}

/* 输入框占位符样式 */
::placeholder {
    color: #999;
    opacity: 1;
}

::-webkit-input-placeholder {
    color: #999;
}

::-moz-placeholder {
    color: #999;
    opacity: 1;
}

:-ms-input-placeholder {
    color: #999;
}

:-moz-placeholder {
    color: #999;
    opacity: 1;
}

/* 按钮禁用状态 */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 消息项动画 */
.message-item {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #666;
}

.modal-body {
    margin-bottom: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* 标签样式 */
.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tag-primary {
    background-color: rgba(7, 193, 96, 0.1);
    color: #07C160;
}

.tag-secondary {
    background-color: rgba(156, 163, 175, 0.1);
    color: #6b7280;
}

.tag-success {
    background-color: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.tag-warning {
    background-color: rgba(251, 191, 36, 0.1);
    color: #d97706;
}

.tag-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* 徽章样式 */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.5rem;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 20px;
}

.badge-primary {
    background-color: #07C160;
    color: white;
}

.badge-success {
    background-color: #22c55e;
    color: white;
}

.badge-warning {
    background-color: #f59e0b;
    color: white;
}

.badge-error {
    background-color: #ef4444;
    color: white;
}

/* 进度条样式 */
.progress {
    width: 100%;
    height: 6px;
    background-color: #f5f5f5;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #07C160;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* 工具提示样式 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background-color: #333;
    color: white;
    font-size: 0.8rem;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 0.5rem;
}

.tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
    z-index: 1000;
}

/* 辅助类 */
.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

/* 深色模式支持（可选） */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    
    .login-form {
        background-color: #2d2d2d;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    }
    
    .form-group input {
        background-color: #3a3a3a;
        border-color: #4a4a4a;
        color: #e0e0e0;
    }
    
    .form-group input:focus {
        background-color: #3a3a3a;
    }
    
    .switch-page {
        color: #b0b0b0;
    }
    
    .message-item {
        background-color: #2d2d2d;
        border-bottom-color: #3a3a3a;
    }
    
    .message-item:hover {
        background-color: #3a3a3a;
    }
    
    .message-item.active {
        background-color: rgba(7, 193, 96, 0.2);
    }
    
    .search-bar {
        background-color: #2d2d2d;
        border-bottom-color: #3a3a3a;
    }
    
    .search-bar input {
        background-color: #3a3a3a;
        border-color: #4a4a4a;
        color: #e0e0e0;
    }
    
    .search-bar input:focus {
        background-color: #3a3a3a;
    }
    
    .profile-info,
    .api-guide {
        background-color: #2d2d2d;
        border-color: #3a3a3a;
    }
    
    .info-item label {
        color: #b0b0b0;
    }
    
    .info-item span {
        color: #e0e0e0;
    }
    
    .guide-item code {
        background-color: #1a1a1a;
    }
    
    .bottom-nav {
        background-color: #ffffff !important;
        border-top-color: #f0f0f0 !important;
    }
    
    .nav-item {
        color: #666 !important;
    }
    
    .nav-item.active {
        color: #333 !important;
        background-color: rgba(0, 0, 0, 0.03) !important;
    }
}

/* PWA安装提示样式 */
.pwa-install-prompt {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    animation: fadeIn 0.3s ease-out;
}

.pwa-install-content {
    width: 100%;
    max-width: 500px;
    background-color: #ffffff;
    border-radius: 16px 16px 0 0;
    padding: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.3s ease-out;
}

.pwa-install-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.pwa-install-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    background-color: #07C160;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.pwa-install-text {
    flex: 1;
    min-width: 0;
}

.pwa-install-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
    line-height: 1.4;
}

.pwa-install-desc {
    font-size: 14px;
    color: #666666;
    line-height: 1.4;
}

.pwa-install-buttons {
    display: flex;
    gap: 12px;
}

.pwa-install-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px; /* 确保触摸目标足够大 */
}

.pwa-install-btn-close {
    background-color: #f5f5f5;
    color: #333333;
}

.pwa-install-btn-close:active {
    background-color: #e0e0e0;
}

.pwa-install-btn-confirm {
    background-color: #07C160;
    color: #ffffff;
}

.pwa-install-btn-confirm:active {
    background-color: #06ad56;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* 移动端优化 */
@media (max-width: 640px) {
    .pwa-install-content {
        border-radius: 20px 20px 0 0;
        padding: 16px;
    }
    
    .pwa-install-header {
        margin-bottom: 16px;
    }
    
    .pwa-install-icon {
        width: 44px;
        height: 44px;
        min-width: 44px;
        font-size: 22px;
    }
    
    .pwa-install-title {
        font-size: 17px;
    }
    
    .pwa-install-desc {
        font-size: 13px;
    }
    
    .pwa-install-buttons {
        gap: 10px;
    }
    
    .pwa-install-btn {
        padding: 14px 16px;
        font-size: 15px;
    }
}

/* 小屏幕进一步优化 */
@media (max-width: 375px) {
    .pwa-install-content {
        padding: 14px;
    }
    
    .pwa-install-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        font-size: 20px;
    }
    
    .pwa-install-title {
        font-size: 16px;
    }
    
    .pwa-install-desc {
        font-size: 12px;
    }
}