/* iOS风格灰白简约样式 */

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

/* 颜色变量 */
:root {
    --ios-bg-primary: #f2f2f7;
    --ios-bg-secondary: #ffffff;
    --ios-bg-tertiary: #f2f2f7;
    --ios-text-primary: #000000;
    --ios-text-secondary: #8e8e93;
    --ios-text-tertiary: #c7c7cc;
    --ios-border: #c6c6c8;
    --ios-blue: #007aff;
    --ios-green: #34c759;
    --ios-red: #ff3b30;
    --ios-yellow: #ffcc00;
    --ios-gray: #8e8e93;
    --ios-light-gray: #f2f2f7;
    --ios-dark-gray: #3a3a3c;
    --ios-chat-incoming: #e5e5ea;
    --ios-chat-outgoing: #007aff;
    --ios-chat-outgoing-text: #ffffff;
}

/* 全局样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--ios-bg-primary);
    color: var(--ios-text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 容器样式 */
.container {
    max-width: 100%;
    margin: 0 auto;
}

/* 卡片样式 */
.card {
    background-color: var(--ios-bg-secondary);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--ios-blue);
    color: white;
}

.btn-primary:hover {
    background-color: #0066cc;
}

.btn-secondary {
    background-color: var(--ios-light-gray);
    color: var(--ios-text-primary);
}

.btn-secondary:hover {
    background-color: #e5e5ea;
}

.btn-danger {
    background-color: var(--ios-red);
    color: white;
}

.btn-danger:hover {
    background-color: #cc332a;
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--ios-text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--ios-border);
    border-radius: 8px;
    font-size: 16px;
    background-color: var(--ios-bg-secondary);
    color: var(--ios-text-primary);
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--ios-blue);
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

/* 聊天页面样式（模仿TG风格） */
.chat-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--ios-bg-primary);
}

.chat-header {
    background-color: var(--ios-bg-secondary);
    padding: 16px;
    border-bottom: 1px solid var(--ios-border);
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.chat-header-back {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--ios-light-gray);
    cursor: pointer;
}

.chat-header-back:hover {
    background-color: #e5e5ea;
}

.chat-header-info {
    flex: 1;
}

.chat-header-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--ios-text-primary);
}

.chat-header-status {
    font-size: 13px;
    color: var(--ios-text-secondary);
}

.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 80%;
}

.chat-message-incoming {
    align-self: flex-start;
}

.chat-message-outgoing {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--ios-light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    color: var(--ios-text-secondary);
}

.chat-message-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 16px;
    line-height: 1.4;
    position: relative;
}

.chat-message-incoming .chat-message-bubble {
    background-color: var(--ios-chat-incoming);
    color: var(--ios-text-primary);
    border-bottom-left-radius: 4px;
}

.chat-message-outgoing .chat-message-bubble {
    background-color: var(--ios-chat-outgoing);
    color: var(--ios-chat-outgoing-text);
    border-bottom-right-radius: 4px;
}

.chat-message-time {
    font-size: 11px;
    color: var(--ios-text-secondary);
    margin: 0 4px;
    align-self: flex-end;
}

.chat-input {
    background-color: var(--ios-bg-secondary);
    padding: 12px 16px;
    border-top: 1px solid var(--ios-border);
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.chat-input-textarea {
    flex: 1;
    min-height: 40px;
    max-height: 120px;
    padding: 10px 14px;
    border: 1px solid var(--ios-border);
    border-radius: 20px;
    font-size: 16px;
    background-color: var(--ios-light-gray);
    color: var(--ios-text-primary);
    resize: none;
    transition: all 0.2s ease;
}

.chat-input-textarea:focus {
    outline: none;
    border-color: var(--ios-blue);
    background-color: var(--ios-bg-secondary);
}

.chat-input-send {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background-color: var(--ios-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-input-send:hover {
    background-color: #0066cc;
    transform: scale(1.05);
}

.chat-input-send:disabled {
    background-color: var(--ios-light-gray);
    color: var(--ios-text-secondary);
    cursor: not-allowed;
}

/* 列表样式 */
.list {
    background-color: var(--ios-bg-secondary);
    border-radius: 12px;
    overflow: hidden;
}

.list-item {
    padding: 16px;
    border-bottom: 1px solid var(--ios-border);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.list-item:hover {
    background-color: var(--ios-light-gray);
}

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

.list-item-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--ios-light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    color: var(--ios-text-secondary);
}

.list-item-info {
    flex: 1;
}

.list-item-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--ios-text-primary);
    margin-bottom: 4px;
}

.list-item-subtitle {
    font-size: 14px;
    color: var(--ios-text-secondary);
}

.list-item-badge {
    font-size: 12px;
    color: var(--ios-text-secondary);
}

/* 导航栏样式 */
.navbar {
    background-color: var(--ios-bg-secondary);
    border-top: 1px solid var(--ios-border);
    padding: 8px 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.navbar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.navbar-item:hover {
    background-color: var(--ios-light-gray);
    border-radius: 8px;
}

.navbar-item.active {
    color: var(--ios-blue);
}

.navbar-item-icon {
    font-size: 24px;
}

.navbar-item-label {
    font-size: 12px;
}

/* 模态框样式 */
.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: 100;
}

.modal-content {
    background-color: var(--ios-bg-secondary);
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: modalFadeIn 0.3s ease;
}

.modal-header {
    margin-bottom: 20px;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--ios-text-primary);
    text-align: center;
}

.modal-body {
    margin-bottom: 24px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* 动画 */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chat-message {
        max-width: 85%;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--ios-light-gray);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--ios-border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ios-text-secondary);
}

/* 工具类 */
.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 4px;
}

.mt-2 {
    margin-top: 8px;
}

.mt-3 {
    margin-top: 12px;
}

.mt-4 {
    margin-top: 16px;
}

.mb-1 {
    margin-bottom: 4px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-3 {
    margin-bottom: 12px;
}

.mb-4 {
    margin-bottom: 16px;
}

.p-1 {
    padding: 4px;
}

.p-2 {
    padding: 8px;
}

.p-3 {
    padding: 12px;
}

.p-4 {
    padding: 16px;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 4px;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.gap-4 {
    gap: 16px;
}

.flex-1 {
    flex: 1;
}

.rounded {
    border-radius: 8px;
}

.rounded-full {
    border-radius: 50%;
}

.shadow {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.bg-white {
    background-color: var(--ios-bg-secondary);
}

.bg-gray {
    background-color: var(--ios-light-gray);
}

.text-primary {
    color: var(--ios-text-primary);
}

.text-secondary {
    color: var(--ios-text-secondary);
}

.text-blue {
    color: var(--ios-blue);
}

.border {
    border: 1px solid var(--ios-border);
}

.border-top {
    border-top: 1px solid var(--ios-border);
}

.border-bottom {
    border-bottom: 1px solid var(--ios-border);
}

.hidden {
    display: none;
}

.block {
    display: block;
}

.inline-block {
    display: inline-block;
}
