/* ==================== 手机界面 ==================== */
.phone-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.phone-container {
    animation: phoneIn 0.4s ease;
}

@keyframes phoneIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.phone-frame {
    width: 375px;
    height: 750px;
    background: #000;
    border-radius: 40px;
    padding: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), inset 0 0 0 2px #333;
    position: relative;
}

.phone-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1.5rem;
    color: var(--white);
    font-size: 0.85rem;
    background: #1a1a2e;
    border-radius: 28px 28px 0 0;
}

.phone-content {
    height: calc(100% - 140px);
    background: var(--bg);
    overflow-y: auto;
    overflow-x: hidden;
}

.phone-nav {
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    background: var(--white);
    border-top: 1px solid var(--light);
}

.phone-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--gray);
    font-size: 1.2rem;
    transition: color 0.3s;
}

.phone-nav-btn span {
    font-size: 0.7rem;
}

.phone-nav-btn.active {
    color: var(--primary);
}

.phone-close {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.6rem 2rem;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 20px;
    color: var(--white);
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.phone-close:hover {
    background: rgba(255,255,255,0.3);
}

/* ==================== 手机聊天界面 ==================== */
.phone-chat-list {
    padding: 1rem;
}

.phone-chat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s;
}

.phone-chat-item:hover {
    background: var(--white);
}

.phone-chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    position: relative;
}

.phone-chat-avatar .online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: var(--success);
    border-radius: 50%;
    border: 2px solid var(--white);
}

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

.phone-chat-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.phone-chat-preview {
    font-size: 0.8rem;
    color: var(--gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.phone-chat-meta {
    text-align: right;
}

.phone-chat-time {
    font-size: 0.75rem;
    color: var(--gray);
}

.phone-chat-badge {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    background: var(--danger);
    color: var(--white);
    border-radius: 9px;
    font-size: 0.7rem;
    text-align: center;
    line-height: 18px;
    margin-top: 4px;
}

/* 聊天窗口 */
.phone-chat-window {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.phone-chat-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--white);
    border-bottom: 1px solid var(--light);
}

.phone-chat-back {
    border: none;
    background: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--primary);
}

.phone-chat-title {
    font-weight: 600;
}

.phone-chat-status {
    font-size: 0.75rem;
    color: var(--success);
}

.phone-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.chat-message {
    display: flex;
    gap: 0.5rem;
    max-width: 80%;
}

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

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

.chat-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.chat-bubble {
    padding: 0.8rem 1rem;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.chat-message.received .chat-bubble {
    background: var(--white);
    border-top-left-radius: 4px;
}

.chat-message.sent .chat-bubble {
    background: var(--primary);
    color: var(--white);
    border-top-right-radius: 4px;
}

.chat-message-time {
    font-size: 0.7rem;
    color: var(--gray);
    margin-top: 4px;
    text-align: right;
}

.phone-chat-input {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--white);
    border-top: 1px solid var(--light);
}

.phone-chat-input input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 20px;
    background: var(--bg);
    font-size: 0.9rem;
}

.phone-chat-input input:focus {
    outline: none;
}

.phone-chat-send {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    cursor: pointer;
    font-size: 1rem;
}

/* ==================== 动态/朋友圈界面 ==================== */
.phone-feed {
    padding: 1rem;
}

.feed-composer {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--white);
    border-radius: 12px;
    margin-bottom: 1rem;
    cursor: pointer;
}

.feed-composer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.feed-composer-text {
    color: var(--gray);
    font-size: 0.9rem;
}

.feed-post {
    background: var(--white);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.feed-post-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.feed-post-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.feed-post-info {
    flex: 1;
}

.feed-post-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.feed-post-time {
    font-size: 0.75rem;
    color: var(--gray);
}

.feed-post-anonymous {
    font-size: 0.7rem;
    color: var(--accent);
    background: #FD79A820;
    padding: 2px 8px;
    border-radius: 10px;
}

.feed-post-content {
    margin-bottom: 0.8rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

.feed-post-image {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 0.8rem;
    background: var(--bg);
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.feed-post-actions {
    display: flex;
    gap: 2rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--bg);
}

.feed-action {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--gray);
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    background: none;
}

.feed-action:hover {
    color: var(--primary);
}

.feed-action.liked {
    color: var(--accent);
}

.feed-comments {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--bg);
}

.feed-comment {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.feed-comment-author {
    font-weight: 600;
    color: var(--primary);
}

/* ==================== 发现界面 ==================== */
.phone-discover {
    padding: 1rem;
}

.discover-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.discover-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s;
}

.discover-card:hover {
    transform: translateY(-4px);
}

.discover-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.discover-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.discover-desc {
    font-size: 0.75rem;
    color: var(--gray);
    margin-top: 0.3rem;
}

/* 树洞 */
.tree-hole-list {
    padding: 1rem;
}

.tree-hole-item {
    background: var(--white);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.tree-hole-content {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.tree-hole-time {
    font-size: 0.75rem;
    color: var(--gray);
}

.tree-hole-tag {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--info);
    background: #74B9FF20;
    padding: 2px 8px;
    border-radius: 10px;
    margin-right: 0.5rem;
}

/* 投票 */
.vote-item {
    background: var(--white);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.vote-title {
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.vote-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.vote-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem;
    background: var(--bg);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.vote-option:hover {
    background: var(--light);
}

.vote-option.selected {
    background: var(--primary);
    color: var(--white);
}

.vote-bar {
    flex: 1;
    height: 6px;
    background: var(--light);
    border-radius: 3px;
    overflow: hidden;
}

.vote-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
}

/* 二手交易 */
.market-item {
    display: flex;
    gap: 1rem;
    background: var(--white);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.market-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.market-info {
    flex: 1;
}

.market-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.market-price {
    color: var(--danger);
    font-weight: bold;
    font-size: 1.1rem;
    margin: 0.3rem 0;
}

.market-seller {
    font-size: 0.8rem;
    color: var(--gray);
}

.market-tag {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg);
    color: var(--gray);
    margin-right: 0.3rem;
}

/* ==================== 我的界面 ==================== */
.phone-me {
    padding: 1rem;
}

.me-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    margin-bottom: 1rem;
    color: var(--white);
}

.me-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.me-info {
    flex: 1;
}

.me-name {
    font-size: 1.2rem;
    font-weight: bold;
}

.me-id {
    font-size: 0.8rem;
    opacity: 0.8;
}

.me-stats {
    display: flex;
    justify-content: space-around;
    padding: 1rem;
    background: var(--white);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.me-stat {
    text-align: center;
}

.me-stat-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary);
}

.me-stat-label {
    font-size: 0.75rem;
    color: var(--gray);
}

.me-menu {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
}

.me-menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--bg);
    cursor: pointer;
    transition: background 0.3s;
}

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

.me-menu-item:hover {
    background: var(--bg);
}

.me-menu-icon {
    font-size: 1.3rem;
}

.me-menu-text {
    flex: 1;
    font-size: 0.95rem;
}

.me-menu-arrow {
    color: var(--gray);
}

/* ==================== 弹窗通知 ==================== */
.phone-notification {
    position: absolute;
    top: 60px;
    left: 20px;
    right: 20px;
    background: rgba(0,0,0,0.8);
    border-radius: 12px;
    padding: 1rem;
    color: var(--white);
    display: flex;
    gap: 0.8rem;
    align-items: center;
    animation: notifIn 0.3s ease;
    z-index: 100;
}

@keyframes notifIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notif-icon {
    font-size: 1.5rem;
}

.notif-content {
    flex: 1;
}

.notif-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.notif-preview {
    font-size: 0.8rem;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== 响应式 ==================== */
@media (max-width: 480px) {
    .phone-frame {
        width: 100%;
        height: 100vh;
        border-radius: 0;
        padding: 0;
    }

    .phone-status-bar {
        border-radius: 0;
    }

    .phone-close {
        bottom: 20px;
    }
}
