* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', system-ui, sans-serif;
    background: #ffffff;
    color: #1d2129;
    line-height: 1.5;
}

.container {
    margin: 0 auto;
    background: #ffffff;
    border-radius: 16px;
}

.header {
    background: #fff;
    padding: 20px;
    border-bottom: 1px solid #e5e6eb;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #1d2129;
}

.main-layout {
    display: grid;
    grid-template-columns: 36% 1fr;
    align-items: start;
    height: calc(100vh - 0px);
}
.wacg-left{
    float: left;
}
/* 左侧文本预览区域 */
.preview-panel {
    background: white;
    border-right: 1px solid #e5e6eb;
    overflow: hidden;
    position: sticky;
    top: 24px;
    height: calc(100vh - 0px);
    padding: 24px 12px;
}

.preview-header {
    background: #f7f8fa;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e6eb;
}

.preview-title {
    font-size: 14px;
    font-weight: 600;
    color: #1d2129;
}

.preview-content {}

.text-sample {
    margin-bottom: 20px;
    padding: 16px;
}

.text-sample:last-child {
    margin-bottom: 0;
}

.sample-label {
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 8px;
    font-weight: 500;
}

.sample-text {
    font-weight: 400;
}

.sample-xlarge {
    font-size: 24px;
    font-weight: 700;
}

.sample-large {
    font-size: 18px;
    font-weight: 600;
}

.sample-normal {
    font-size: 14px;
}

.sample-small {
    font-size: 12px;
}

/* 右侧主要内容区域 */
.content-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin: 0 auto;
    width: 80%;
    margin-top: 36px;
}

/* 对比度结果区域 */
.contrast-section {
    background: #f7f8fa;
    border-radius: 8px;
    padding: 24px;
}

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

.contrast-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d2129;
}

.contrast-display {
    text-align: center;
    margin-bottom: 24px;
}

.ratio-value {
    font-size: 42px;
    font-weight: 700;
    color: #165dff;
    margin-bottom: 4px;
}

.ratio-label {
    font-size: 14px;
    color: #86909c;
}

.wcag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.wcag-card {
    border: 1px solid #e5e6eb;
    border-radius: 6px;
    padding: 16px 12px;
    text-align: center;
    transition: all 0.2s;
}

.wcag-card.pass {
    border-color: #00b42a;
    background: #f6ffed;
}

.wcag-card.fail {
    border-color: #f53f3f;
    background: #ffece8;
}

.wcag-level {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #1d2129;
    text-align: left;
}

.wcag-requirement {
    font-size: 11px;
    color: #86909c;
}

.wcag-status {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    display: inline-block;
}

.wcag-status.pass {
    background: #00b42a;
    color: white;
    float: right;
    margin-top: 8px;
}

.wcag-status.fail {
    background: #f53f3f;
    color: white;
}

/* 颜色控制区域 */
.color-section {
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e6eb;
    padding: 20px;
}

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

.color-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d2129;
}

.color-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.color-item {
    display: flex;
    flex-direction: column;
}

.color-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #1d2129;
    margin-bottom: 12px;
}

.color-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #e5e6eb;
    border-radius: 4px;
    background: white;
    color: #4e5969;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    border-color: #165dff;
    color: #165dff;
}

.color-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.color-picker {
    width: 40px;
    height: 32px;
    border: 1px solid #e5e6eb;
    border-radius: 4px;
    cursor: pointer;
    background: none;
}

.color-input {
    flex: 1;
    height: 32px;
    padding: 0 12px;
    border: 1px solid #e5e6eb;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Monaco', 'Menlo', monospace;
    transition: border-color 0.2s;
}

.color-input:focus {
    outline: none;
    border-color: #165dff;
    box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.1);
}

.color-preview {
    height: 80px;
    border-radius: 6px;
    border: 1px solid #e5e6eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 12px;
}

.color-info {
    display: flex;
    gap: 12px;
    font-size: 12px;
}

.color-info-item {
    flex: 1;
    background: #f7f8fa;
    padding: 8px 10px;
    border-radius: 4px;
    text-align: center;
}

.info-label {
    color: #86909c;
    margin-bottom: 2px;
}

.info-value {
    font-family: 'Monaco', 'Menlo', monospace;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 900px) {
    .content-panel {
        width: 100%;
        padding: 0 24px 0 24px;
    }

    .preview-panel {

        height: auto;
    }

    .main-layout {
        grid-template-columns: 1fr;
        gap: 16px;
        height: auto;
    }

    .preview-panel {
        position: static;
        order: 3;
    }

    .contrast-section {
        order: 1;
    }

    .color-controls {
        order: 2;
    }

    .color-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .wcag-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {

    .wcag-grid {
        grid-template-columns: 1fr;
    }

    .color-controls {
        gap: 12px;
    }

    .color-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .header h1 {
        font-size: 24px;
    }

    .ratio-value {
        font-size: 28px;
    }
}