* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    line-height: 1.6;
    color: #333;
}

/* 自适应容器 - 针对375px-430px宽度优化 */
.app-container {
    width: 100%;
    max-width: 430px;
    min-width: 375px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    position: relative;
}

/* 顶部导航栏 */
.header-nav {
    height: 60px;
    background: white;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8.5px;
}

.nav-content {
    width: 395px;
    height: 32px;
    position: relative;
}

.menu-icon {
    position: absolute;
    left: 0px;
    top: 0px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    z-index: 2;
}

.search-box {
    position: absolute;
    left: 32px;
    top: 0px;
    width: 205px;
    height: 32px;
    background: #E2E2E2;
    border-radius: 12px;
    display: flex;
    align-items: center;
}

.search-icon {
    width: 20px;
    height: 20px;
    margin-left: 8px;
    margin-right: 4px;
    flex-shrink: 0;
}

.search-placeholder {
    color: #A6A6A6;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    color: #333;
    font-size: 14px;
    padding: 0 4px;
    width: 100%;
}

.search-input::placeholder {
    color: #A6A6A6;
}

.search-box {
    position: relative;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
}

.search-suggestions.show {
    display: block;
}

.search-suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.2s;
}

.search-suggestion-item:hover {
    background-color: #f5f5f5;
}

.search-suggestion-item:last-child {
    border-bottom: none;
}

.search-suggestion-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.search-suggestion-text {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.search-suggestion-type {
    font-size: 12px;
    color: #999;
    padding: 2px 6px;
    background: #f0f0f0;
    border-radius: 4px;
}

.nav-right {
    position: absolute;
    right: 0px;
    top: 0px;
    height: 32px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.star-icon {
    width: 32px;
    height: 32px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.3s ease;
    border-radius: 50%;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 122, 255, 0.05);
}

.star-icon:hover {
    background: rgba(0, 122, 255, 0.15);
    transform: scale(1.05);
}

.star-icon.active {
    background: #007AFF;
}

.star-icon.active img {
    filter: brightness(0) invert(1);
}

.star-icon:active {
    transform: scale(0.95);
}

.star-icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.share-button {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 24px;
    padding: 0 8px;
    cursor: pointer;
    flex-shrink: 0;
}

.share-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.share-text {
    font-size: 15px;
    color: #333;
    white-space: nowrap;
}

.more-icon {
    width: 24px;
    height: 24px;
    cursor: pointer;
    flex-shrink: 0;
}

/* 文章容器 */
.article-container {
    padding: 0 clamp(8px, 12px, 16px);
    margin-top: clamp(30px, 66px, 10px);
}

/* 文章头部信息 */
.article-header {
    padding: 0 4px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 37px;
    margin-bottom: 14px;
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f0;
}

.author-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.author-name {
    font-size: 14px;
    color: #333;
    font-weight: 400;
}

.publish-time {
    font-size: 12px;
    color: #4E4E4E;
}

.follow-button {
    width: 55px;
    height: 20px;
    background: #D0D0D0;
    border-radius: 6px;
    border: none;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    margin-left: auto;
    transition: all 0.3s ease;
}

.follow-button:hover {
    background: #007AFF;
    color: white;
}

/* 文章标题 */
.article-title {
    font-size: clamp(15px, 16px, 18px);
    font-weight: 700;
    color: #333;
    line-height: 1.5;
    margin-bottom: clamp(16px, 20px, 24px);
    padding: 0 4px;
}

/* 文章内容 */
.article-content {
    font-size: clamp(14px, 15px, 17px);
    line-height: clamp(1.6, 1.8, 2);
    color: #333;
    padding: 0 4px;
}

/* 文章内容中的图片自适应 */
.article-content img,
.article-section img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block;
    margin: 16px 0;
    border-radius: 8px;
    box-sizing: border-box;
    object-fit: contain;
}

/* 确保图片容器不会溢出 */
.article-content,
.article-section {
    overflow-wrap: break-word;
    word-wrap: break-word;
    overflow-x: hidden;
}

.article-section {
    margin-bottom: clamp(16px, 24px, 32px);
}

.section-title {
    font-weight: 600;
    margin-bottom: 12px;
    display: block;
}

.section-content {
    margin-bottom: 8px;
}

.highlight {
    background: #f8f8f8;
    padding: 12px;
    border-radius: 8px;
    margin: 16px 0;
    border-left: 4px solid #007AFF;
}

.article-reference {
    color: #666;
    font-size: 14px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

/* 底部操作按钮 */
.bottom-actions {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 999 !important;
}

.action-button {
    width: 48px !important;
    height: 48px !important;
    background: #007AFF !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3) !important;
    transition: all 0.3s ease !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.action-button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
}

.action-button img {
    filter: brightness(0) invert(1) !important;
    width: 24px !important;
    height: 24px !important;
}

/* 手机屏幕尺寸适配 - 375px-430px宽度，667px-932px高度 */
@media screen and (min-width: 375px) and (max-width: 430px) {
    .app-container {
        width: 100%;
        max-width: 430px;
        min-width: 375px;
        margin: 0 auto;
    }
}

/* 小屏幕手机适配 - 375px及以下 */
@media screen and (max-width: 375px) {
    .app-container {
        min-width: 320px;
        width: 100%;
    }
    
    .header-nav {
        height: 56px;
        padding: 0 4px;
    }
    
    .nav-content {
        width: calc(100vw - 8px);
        height: 32px;
    }
    
    .search-box {
        width: calc(100% - 140px);
        height: 28px;
    }
    
    .search-placeholder {
        font-size: 13px;
    }
    
    .star-icon, .more-icon {
        width: 28px;
        height: 28px;
        padding: 4px;
    }
    
    .share-button {
        padding: 0 6px;
        height: 20px;
    }
    
    .share-icon {
        width: 18px;
        height: 18px;
    }
    
    .share-text {
        font-size: 13px;
    }
    
    .article-container {
        padding: 0 8px;
        margin-top: 60px;
    }
    
    .article-title {
        font-size: 15px;
    }
    
    .article-content {
        font-size: 14px;
    }
    
    /* 移动端图片强制自适应 */
    .article-content img,
    .article-section img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        float: none !important;
        display: block !important;
        margin: 12px 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    
    .section-title {
        font-size: 14px;
    }
    
    .follow-button {
        width: 50px;
        height: 18px;
        font-size: 13px;
    }
}



/* 超大屏手机适配 - 430px+ */
@media screen and (min-width: 430px) {
    .app-container {
        max-width: 430px;
        box-shadow: 0 0 20px rgba(0,0,0,0.1);
    }
    
    .header-nav {
        padding: 0 8.5px;
    }
    
    .nav-content {
        width: 395px;
    }
    

    
    .article-container {
        padding: 0 16px;
    }
}

/* 高度适配 - 667px-932px */
@media screen and (max-height: 667px) {
    .article-section {
        margin-bottom: 16px;
    }
    
    .article-title {
        margin-bottom: 16px;
    }
    
    .header-nav {
        height: 56px;
    }
    
    .article-container {
        margin-top: 60px;
    }
}

@media screen and (min-height: 896px) {
    .article-section {
        margin-bottom: 28px;
    }
}

@media screen and (min-height: 932px) {
    .article-section {
        margin-bottom: 32px;
    }
}

/* 屏幕方向适配 */
@media screen and (orientation: landscape) and (max-height: 414px) {
    .header-nav {
        height: 48px;
        padding: 0 4px;
    }
    
    .nav-content {
        height: 28px;
    }
    
    .search-box {
        height: 24px;
        top: 0px;
    }
    
    .search-icon {
        top: 2px;
    }
    
    .search-placeholder {
        top: 2px;
        font-size: 12px;
    }
    
    .star-icon {
        top: 2px;
        width: 28px;
        height: 28px;
        padding: 4px;
    }
    
    .share-button {
        top: 2px;
        height: 20px;
    }
    
    .share-icon {
        width: 18px;
        height: 18px;
    }
    
    .share-text {
        font-size: 13px;
        top: 0px;
    }
    
    .more-icon {
        top: 2px;
        width: 20px;
        height: 20px;
    }
    
    .article-container {
        margin-top: 52px;
    }
    
    .article-section {
        margin-bottom: 12px;
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .author-avatar img,
    .menu-icon img,
    .search-icon img,
    .star-icon img,
    .share-icon img,
    .more-icon img,
    .action-button img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .follow-button:active,
    .share-button:active,
    .action-button:active {
        transform: scale(0.95);
        opacity: 0.8;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-section {
    animation: fadeIn 0.6s ease-out;
}

/* 分享模态框样式 */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.share-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s;
}

.share-modal-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    border-radius: 16px 16px 0 0;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    max-height: 80vh;
    overflow-y: auto;
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.share-modal-header h3 {
    font-size: 1.1rem;
    color: #333;
    font-weight: 600;
}

.share-modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #999;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.share-modal-close:hover {
    background: #f5f5f5;
}

.share-platforms {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 10px 0;
}

.share-platform {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.2s;
}

.share-platform:hover {
    background: #f5f5f5;
}

.share-platform:active {
    transform: scale(0.95);
}

.share-platform-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.share-platform span {
    font-size: 0.85rem;
    color: #666;
}