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

/* Apple风格：极简、留白、质感 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    background: #f5f5f7;
    min-height: 100vh;
    padding: 0;
    color: #1d1d1f;
    line-height: 1.47059;
    font-weight: 400;
    letter-spacing: -0.022em;
}

.container {
    max-width: 1680px;
    margin: 0 auto;
    padding: 60px 80px;
}

/* 头部样式 - 极简大气 */
header {
    text-align: center;
    margin-bottom: 60px;
}

header h1 {
    font-size: 56px;
    line-height: 1.07143;
    font-weight: 600;
    letter-spacing: -0.005em;
    color: #1d1d1f;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.logo-icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}

.subtitle {
    font-size: 21px;
    line-height: 1.381;
    font-weight: 400;
    letter-spacing: 0.011em;
    color: #86868b;
}

.author-info {
    font-size: 17px;
    line-height: 1.47059;
    font-weight: 600;
    letter-spacing: 0.011em;
    background: linear-gradient(135deg, #0071e3 0%, #00a8e3 50%, #ff6b35 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: 8px;
}

/* 主内容区域 - 三栏布局 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr 180px;
    gap: 24px;
}

.input-section,
.preview-section,
.style-selector {
    background: #ffffff;
    border-radius: 18px;
    padding: 32px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.input-section:hover,
.preview-section:hover,
.style-selector:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

/* 样式选择器 - 窄且竖版 */
.style-selector {
    padding: 24px 20px;
}

.style-selector .section-header {
    margin-bottom: 20px;
}

.style-selector .section-header h2 {
    font-size: 21px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 28px;
    line-height: 1.14286;
    font-weight: 600;
    letter-spacing: 0.007em;
    background: linear-gradient(135deg, #0071e3 0%, #00a8e3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 8px rgba(0, 113, 227, 0.15);
    filter: drop-shadow(0 2px 4px rgba(0, 113, 227, 0.1));
}

/* 按钮样式 - 苹果蓝 */
button {
    padding: 10px 20px;
    border: none;
    border-radius: 980px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.6, 1);
    letter-spacing: -0.016em;
}

.btn-clear {
    background: #f5f5f7;
    color: #1d1d1f;
    border: 1px solid #d2d2d7;
}

.btn-clear:hover {
    background: #e8e8ed;
    border-color: #b8b8bd;
}

.btn-clear:active {
    transform: scale(0.96);
}

.btn-copy {
    background: #0071e3;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.25);
}

.btn-copy:hover {
    background: #0077ed;
    box-shadow: 0 4px 16px rgba(0, 113, 227, 0.35);
}

.btn-copy:active {
    transform: scale(0.96);
}

/* 输入区域 - 极简边框 */
.input-area {
    width: 100%;
    flex: 1;
    border: 1px solid #d2d2d7;
    border-radius: 12px;
    padding: 16px;
    font-size: 15px;
    line-height: 1.6;
    resize: none;
    font-family: inherit;
    transition: all 0.2s ease;
    background: #fbfbfd;
    color: #1d1d1f;
    min-height: 600px;
}

.input-area:focus {
    outline: none;
    border-color: #0071e3;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.08);
}

.input-area::placeholder {
    color: #86868b;
}

/* 样式分类Tab - 折叠菜单 */
.style-tabs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    max-height: calc(100vh - 380px);
}

/* 样式更新提示 */
.style-update-notice {
    margin-top: 16px;
    padding: 16px 12px;
    text-align: center;
    background: linear-gradient(135deg, rgba(0, 113, 227, 0.05) 0%, rgba(255, 107, 53, 0.05) 100%);
    border-radius: 12px;
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
}

.style-update-notice::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(135deg, #0071e3 0%, #00a8e3 50%, #ff6b35 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.style-update-notice p {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #0071e3 0%, #00a8e3 50%, #ff6b35 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.category-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.category-tab {
    padding: 12px 16px;
    background: #f5f5f7;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    font-size: 22px;
    transition: all 0.2s ease;
    color: #1d1d1f;
    font-weight: 600;
    letter-spacing: -0.016em;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    text-align: left;
    width: 100%;
    position: relative;
}

.category-tab::after {
    content: '▼';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    transition: transform 0.2s ease;
    font-size: 10px;
}

.category-tab.active::after {
    transform: translateY(-50%) rotate(0deg);
}

.category-tab:hover {
    background: #e8e8ed;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.category-tab.active {
    background: linear-gradient(135deg, #1d1d1f 0%, #2d2d2f 100%);
    color: #f5f5f7;
    border-color: #1d1d1f;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.templates-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    padding-left: 12px;
}

.templates-container.expanded {
    max-height: 1000px;
    opacity: 1;
    margin-top: 4px;
}

.tab {
    padding: 12px 16px;
    background: #f5f5f7;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    color: #1d1d1f;
    font-weight: 500;
    letter-spacing: -0.016em;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    text-align: center;
    width: 100%;
}

.tab:hover {
    background: #e8e8ed;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transform: translateX(2px);
}

.secondary-tab {
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 400;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    border-radius: 8px;
    background: #fbfbfd;
}

.secondary-tab:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    background: #f5f5f7;
}

.secondary-tab.active {
    background: linear-gradient(135deg, #0071e3 0%, #0077ed 100%);
    color: #ffffff;
    border-color: #0071e3;
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.3);
}

/* 预览区域 - 纯净背景 */
.preview-area {
    flex: 1;
    border: 1px solid #d2d2d7;
    border-radius: 12px;
    padding: 32px;
    background: #ffffff;
    overflow-y: auto;
    min-height: 600px;
    transition: all 0.2s ease;
}

.preview-area:hover {
    border-color: #b8b8bd;
}

.preview-area .placeholder {
    color: #86868b;
    text-align: center;
    padding: 60px 20px;
    font-size: 17px;
    line-height: 1.47059;
    letter-spacing: -0.022em;
}

/* 页脚 - 极简 */
footer {
    background: transparent;
    padding: 40px 20px 20px;
    text-align: center;
    color: #86868b;
    font-size: 12px;
    line-height: 1.33337;
    letter-spacing: -0.01em;
}

/* 响应式设计 */
@media (max-width: 1400px) {
    .main-content {
        grid-template-columns: 1fr 1fr 150px;
        gap: 20px;
    }

    .style-selector {
        padding: 20px 16px;
    }
}

@media (max-width: 1068px) {
    .container {
        padding: 40px 40px;
    }

    header h1 {
        font-size: 40px;
    }

    .subtitle {
        font-size: 19px;
    }

    .main-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .style-tabs {
        flex-direction: row;
        flex-wrap: wrap;
        max-height: none;
    }

    .primary-tabs,
    .secondary-tabs {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .tab {
        width: auto;
    }
}

@media (max-width: 734px) {
    .container {
        padding: 24px 20px;
    }

    header {
        margin-bottom: 32px;
    }

    header h1 {
        font-size: 32px;
    }

    .subtitle {
        font-size: 17px;
    }

    .input-section,
    .preview-section {
        padding: 20px;
    }

    .section-header h2 {
        font-size: 21px;
    }

    .input-area,
    .preview-area {
        min-height: 400px;
    }
}

/* 滚动条样式 - 极简 */
.preview-area::-webkit-scrollbar {
    width: 8px;
}

.preview-area::-webkit-scrollbar-track {
    background: transparent;
}

.preview-area::-webkit-scrollbar-thumb {
    background: #d2d2d7;
    border-radius: 4px;
}

.preview-area::-webkit-scrollbar-thumb:hover {
    background: #b8b8bd;
}

/* 公众号样式预览基础样式 */
.wechat-content {
    background: white;
    padding: 20px;
    line-height: 1.8;
    color: #333;
}
