/* =============================================
   WordPress 古腾堡编辑器全局样式
   editor-styles.css - 适用于前后端样式统一
   ============================================= */

/**
 * 一、基础重置与容器样式
 */
.editor-styles-wrapper,
.wp-block {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #1e1e1e;
    max-width: 840px;
    margin: 0 auto;
    padding: 20px;
}

.editor-styles-wrapper *,
.editor-styles-wrapper *:before,
.editor-styles-wrapper *:after {
    box-sizing: border-box;
}

/**
 * 二、通用区块样式
 */
.wp-block {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* 对齐方式 */
.wp-block[data-align="wide"] {
    max-width: 1100px;
}

.wp-block[data-align="full"] {
    max-width: none;
}

/* 文本对齐 */
.has-text-align-center { text-align: center; }
.has-text-align-left { text-align: left; }
.has-text-align-right { text-align: right; }

/**
 * 三、具体区块样式
 */

/* 1. 段落 */
.wp-block-paragraph {
    font-size: 16px;
    line-height: 1.6;
    margin-top: 0;
    margin-bottom: 1.5em;
}

.has-drop-cap:not(:focus)::first-letter {
    font-size: 3em;
    line-height: 0.8;
    margin: 0.1em 0.1em 0 0;
    float: left;
}

/* 2. 标题 */
.wp-block-heading h1,
.wp-block-heading h2,
.wp-block-heading h3,
.wp-block-heading h4,
.wp-block-heading h5,
.wp-block-heading h6 {
    font-weight: 600;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.3;
}
.wp-block-heading{padding: 30px 0px;}
.wp-block-heading h1 { font-size: 2.5em; }
.wp-block-heading h2 { font-size: 2em; }
.wp-block-heading h3 { font-size: 1.75em; }
.wp-block-heading h4 { font-size: 1.5em; }
.wp-block-heading h5 { font-size: 1.25em; }
.wp-block-heading h6 { font-size: 1em; }

/* 3. 列表 */
.wp-block-list {
    padding-left: 2.5em;
    margin-top: 0;
    /* margin-bottom: 1.5em; */
}

.wp-block-list ul,
.wp-block-list ol {
    margin-top: 0;
    margin-bottom: 0;
}

.wp-block-list li {
    margin-bottom: 0.5em;
}

.wp-block-list ul {
    list-style-type: disc;
}

.wp-block-list ol {
    list-style-type: decimal;
}

.wp-block-list ul ul,
.wp-block-list ol ul {
    list-style-type: circle;
}

/* 4. 图片 */
.wp-block-image {
    margin-top: 1.5em;
    margin-bottom: 1.5em;
}

.wp-block-image img {
    max-width: 100%;
    height: auto;
    vertical-align: bottom;
}

.wp-block-image figcaption {
    font-size: 0.8em;
    text-align: center;
    color: #555;
    margin-top: 0.5em;
}

/* 5. 按钮 */
.wp-block-button__link {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 4px;
    background: #32373c;
    color: white;
    text-decoration: none;
    font-size: 1em;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.wp-block-button__link:hover {
    opacity: 0.85;
}

.is-style-outline .wp-block-button__link {
    background: transparent;
    border: 2px solid currentColor;
    color: inherit;
}

/* 6. 引用 */
.wp-block-quote {
    border-left: 4px solid currentColor;
    margin: 1.5em 0;
    padding-left: 1em;
}

.wp-block-quote cite {
    font-style: normal;
    font-size: 0.8em;
    color: #666;
}

.wp-block-quote.is-style-large {
    padding: 2em;
    font-size: 1.2em;
}

/* 7. 表格 */
.wp-block-table {
    width: 100%;
    margin: 1.5em 0;
    border-collapse: collapse;
}

.wp-block-table table {
    width: 100%;
}

.wp-block-table td,
.wp-block-table th {
    padding: 0.5em;
    border: 1px solid #ddd;
}

.wp-block-table th {
    background: #f5f5f5;
}

.is-style-stripes tbody tr:nth-child(odd) {
    background-color: #f9f9f9;
}

/* 8. 分组 */
.wp-block-group {
    padding: 20px;
    margin-bottom: 1.5em;
}

.wp-block-group.has-background {
    padding: 20px;
    border-radius: 4px;
}

/* 9. 列 */
.wp-block-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 2em;
    margin-bottom: 1.5em;
}

.wp-block-column {
    flex: 1;
    min-width: 0;
}

/**
 * 四、颜色预设
 */
.has-primary-color { color: #0073aa; }
.has-primary-background-color { background-color: #0073aa; }

.has-secondary-color { color: #006ba1; }
.has-secondary-background-color { background-color: #006ba1; }

.has-dark-color { color: #1e1e1e; }
.has-dark-background-color { background-color: #1e1e1e; }

.has-light-color { color: #f5f5f5; }
.has-light-background-color { background-color: #f5f5f5; }

/**
 * 五、字体大小预设
 */
.has-small-font-size { font-size: 13px; }
.has-medium-font-size { font-size: 20px; }
.has-large-font-size { font-size: 36px; }
.has-huge-font-size { font-size: 48px; }

/**
 * 六、响应式设计
 */
@media (max-width: 782px) {
    .wp-block-columns:not(.is-not-stacked-on-mobile) {
        flex-direction: column;
    }
    
    .wp-block-column {
        flex-basis: 100% !important;
    }
}

@media (min-width: 600px) {
    .editor-styles-wrapper {
        padding: 40px;
    }
}

/**
 * 七、实用工具类
 */
.wp-block-spacer {
    clear: both;
}

.wp-block-separator {
    border: none;
    border-bottom: 2px solid #ddd;
    margin: 1.65em auto;
}

.wp-block-separator.is-style-wide {
    max-width: 100%;
}

.wp-block-separator.is-style-dots:before {
    content: "\00b7 \00b7 \00b7";
    font-size: 2em;
    letter-spacing: 2em;
    padding-left: 2em;
}