* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif; background: #f5f6fa; color: #333; font-size: 15px; max-width: 480px; margin: 0 auto; min-height: 100vh; }

.view { display: none; min-height: 100vh; flex-direction: column; }
.view.active { display: flex; }

/* Login */
.login-header { text-align: center; padding: 60px 24px 40px; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; }
.login-header .logo { font-size: 48px; margin-bottom: 12px; }
.login-header h1 { font-size: 24px; font-weight: 600; }
.login-header p { opacity: .8; margin-top: 8px; font-size: 14px; }
.login-form { padding: 32px 24px; }
.input-group { margin-bottom: 16px; }
.input-group input { width: 100%; padding: 14px 16px; border: 1px solid #e0e0e0; border-radius: 10px; font-size: 16px; background: #fff; }
.code-group { display: flex; gap: 10px; }
.code-group input { flex: 1; }
.btn-code { white-space: nowrap; padding: 0 16px; border: 1px solid #667eea; background: #fff; color: #667eea; border-radius: 10px; font-size: 14px; cursor: pointer; }
.btn-code:disabled { opacity: .5; }
.btn-primary { width: 100%; padding: 14px; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border: none; border-radius: 10px; font-size: 16px; cursor: pointer; margin-top: 8px; }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.login-hint { margin-top: 16px; text-align: center; font-size: 13px; color: #999; }
.login-hint strong { color: #667eea; }
.btn-outline { width: 100%; padding: 14px; background: #fff; color: #667eea; border: 1px solid #667eea; border-radius: 10px; font-size: 16px; cursor: pointer; margin-top: 8px; }

/* Header */
.app-header { display: flex; align-items: center; justify-content: center; padding: 14px 16px; background: #fff; position: relative; box-shadow: 0 1px 4px rgba(0,0,0,.06); font-weight: 500; }
.btn-back { position: absolute; left: 12px; background: none; border: none; font-size: 16px; color: #667eea; cursor: pointer; padding: 4px 8px; }
.btn-icon { position: absolute; right: 12px; background: none; border: none; font-size: 20px; cursor: pointer; }
.badge { position: absolute; right: 48px; background: #ff4d4f; color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 10px; }
.badge.hidden { display: none; }
.hidden { display: none !important; }

/* Tab */
.tab-content { flex: 1; overflow-y: auto; padding-bottom: 60px; display: none; }
.tab-content.active { display: block; }
.tab-bar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; display: flex; background: #fff; border-top: 1px solid #eee; z-index: 10; }
.tab-bar .tab { flex: 1; padding: 12px; border: none; background: none; font-size: 15px; color: #999; cursor: pointer; }
.tab-bar .tab.active { color: #667eea; font-weight: 600; }

/* Message list */
.msg-list { padding: 8px 12px; }
.msg-item { background: #fff; border-radius: 10px; padding: 14px 16px; margin-bottom: 8px; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.04); position: relative; }
.msg-item.unread { border-left: 3px solid #667eea; }
.msg-item.unread::before { content: ''; position: absolute; top: 16px; right: 16px; width: 8px; height: 8px; background: #ff4d4f; border-radius: 50%; }
.msg-item .title { font-weight: 500; margin-bottom: 6px; padding-right: 16px; }
.msg-item .summary { color: #999; font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.msg-item .meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: #bbb; }
.msg-item .priority-high { color: #fa8c16; }
.msg-item .priority-urgent { color: #ff4d4f; }
.empty-state { text-align: center; padding: 60px 24px; color: #ccc; }

/* Detail */
.detail-content { padding: 16px; flex: 1; overflow-y: auto; }
.detail-content h2 { font-size: 18px; margin-bottom: 8px; }
.detail-content .meta-bar { display: flex; gap: 12px; font-size: 13px; color: #999; margin-bottom: 16px; flex-wrap: wrap; }
.detail-content .body { background: #fff; padding: 16px; border-radius: 10px; line-height: 1.6; }
.detail-content .body img { max-width: 100%; }
.todo-actions { padding: 16px; background: #fff; border-top: 1px solid #eee; }

/* Profile */
.profile-card { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; padding: 32px; text-align: center; }
.profile-card .avatar { font-size: 48px; margin-bottom: 8px; }
.profile-card .phone { font-size: 18px; font-weight: 500; }
.profile-card .name { opacity: .8; margin-top: 4px; font-size: 14px; }
.profile-menu { margin: 16px 12px; background: #fff; border-radius: 10px; overflow: hidden; }
.menu-item { display: block; width: 100%; padding: 16px; border: none; background: none; text-align: left; font-size: 15px; border-bottom: 1px solid #f5f5f5; cursor: pointer; }
.menu-item.danger { color: #ff4d4f; }
.menu-item.menu-info { color: #999; font-size: 13px; cursor: default; }
.menu-item.menu-info span { color: #667eea; }

.sound-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid #f5f5f5;
}
.sound-picker.hidden { display: none; }
.sound-opt {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    background: #fafafa;
    font-size: 13px;
    cursor: pointer;
}
.sound-opt.active {
    border-color: #667eea;
    background: #eef1ff;
    color: #667eea;
}
.ws-status { text-align: center; padding: 20px; font-size: 13px; color: #999; }
.ws-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.ws-dot.online { background: #52c41a; }
.ws-dot.offline { background: #ccc; }

/* Toast */
.toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,.75); color: #fff; padding: 12px 24px; border-radius: 8px; font-size: 14px; z-index: 999; }
.toast.hidden { display: none; }

.todo-status { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.todo-status-1 { background: #fff7e6; color: #fa8c16; }
.todo-status-2 { background: #e6f7ff; color: #1890ff; }
.todo-status-3 { background: #f6ffed; color: #52c41a; }
.todo-status-4 { background: #fff2f0; color: #ff4d4f; }
