/* css-learning.css - 当发网CSS学习频道*/

/* ===== CSS变量定义 ===== */
:root {
    --primary-color: #82255E;
    --primary-dark: #6a1e4c;
    --secondary-color: #B83B6A;
    --accent-color: #D1C39D;
    --dark-color: #2A101B;
    --light-color: #D9D0CA;
    --white: #FFFFFF;
    --gray-light: #f5f5f5;
    --gray-medium: #e0e0e0;
    --font-family: "微软雅黑", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --border-radius: 10px;
    --transition: all 0.3s ease;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.15);

    /* 交互演示专用变量 */
    --demo-primary: #82255E;
    --demo-spacing: 16px;
    --demo-radius: 5px;
    --demo-shadow: 5px;
    --demo-font-size: 16px;
    /* 高级CSS页面演示专用变量 */
    --pattern-svg: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><rect width="10" height="10" fill="%2382255E"/><rect x="10" y="10" width="10" height="10" fill="%23B83B6A"/></svg>');
}

/* ===== 重置样式 ===== */
body,
h1,
h2,
h3,
h4,
p,
ul,
li,
article,
header,
footer,
main,
nav,
div {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== 基础样式 ===== */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: #333;
    background-color: var(--gray-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 15px;
}

/* ===== 头部样式 ===== */
header {
    background-color: var(--primary-color);
    color: var(--accent-color);
    text-align: center;
    padding: 1.5rem 1rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.header-content {
    position: relative;
    z-index: 1;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 900;
    margin: 0 0 0.5rem 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

header p {
    font-size: 1rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.header-links,
.footer-nav-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.header-links a,
.footer-nav-links a {
    color: var(--accent-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid var(--accent-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-size: 0.9rem;
}

.header-links a:hover,
.footer-nav-links a:hover {
    background-color: var(--accent-color);
    color: var(--primary-color);
}

/* ===== 导航样式 ===== */
.main-nav {
    background-color: var(--dark-color);
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.nav-menu {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0;
    margin: 0;
    transition: var(--transition);
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    display: block;
    color: var(--light-color);
    text-decoration: none;
    padding: 0.8rem 1.2rem;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.95rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-menu a:hover,
.nav-menu a.active {
    background-color: var(--primary-color);
    color: var(--accent-color);
}

.hamburger {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: auto;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    transition: var(--transition);
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--accent-color);
    margin: 3px 0;
    transition: var(--transition);
    border-radius: 2px;
}

/* ===== 主内容区样式 ===== */
main {
    background-color: var(--secondary-color);
    padding: 1.5rem 1rem;
    flex-grow: 1;
}

/* ===== 英雄区域样式 ===== */
.hero-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 3rem;
}

.hero-content {
    background-color: var(--accent-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.hero-content h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.hero-content p {
    color: var(--dark-color);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--dark-color);
}

.hero-visual {
    display: flex;
    justify-content: center;
}

.code-preview {
    background-color: var(--dark-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 500px;
}

.code-title {
    color: var(--light-color);
    font-size: 0.9rem;
    font-weight: 500;
}

.code-content {
    padding: 1rem;
}

.code-content pre {
    margin: 0;
    overflow-x: auto;
}

.code-content code {
    display: block;
    color: var(--light-color);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre;
}

/* ===== 学习路径样式 ===== */
.learning-path {
    margin-bottom: 3rem;
}

.learning-path h2 {
    color: var(--accent-color);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.path-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.path-step {
    background-color: var(--accent-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: var(--transition);
}

.path-step:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.step-number {
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 1rem;
}

.path-step h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.path-step p {
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.step-link {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--accent-color);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.step-link:hover {
    background-color: var(--primary-dark);
}

/* ===== 特色卡片样式 ===== */
.featured-cards {
    margin-bottom: 3rem;
}

.featured-cards h2 {
    color: var(--accent-color);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.featured-card {
    background-color: var(--accent-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.featured-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.card-icon {
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.featured-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.featured-card p {
    color: var(--dark-color);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.card-link {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--accent-color);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.card-link:hover {
    background-color: var(--primary-dark);
}

/* ===== 快速链接样式 ===== */
.quick-links {
    margin-bottom: 2rem;
}

.quick-links h2 {
    color: var(--accent-color);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.quick-link {
    background-color: var(--accent-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.quick-link:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.link-title {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.link-desc {
    color: var(--dark-color);
    font-size: 0.9rem;
}

/* ===== 内容区块样式 ===== */
.content-section {
    background-color: var(--accent-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.content-section h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.6rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.content-section h3 {
    color: var(--primary-dark);
    margin: 1.5rem 0 1rem 0;
    font-size: 1.3rem;
}

.content-section p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.content-section ul,
.content-section ol {
    margin: 0 0 1rem 1.5rem;
}

.content-section li {
    margin-bottom: 0.5rem;
}

/* ===== 代码示例样式 ===== */
.code-example {
    background-color: var(--dark-color);
    color: var(--light-color);
    border-radius: var(--border-radius);
    margin: 1rem 0;
    overflow: hidden;
}

.code-header {
    background-color: #1a1a1a;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.code-title {
    color: var(--light-color);
    font-size: 0.9rem;
    font-weight: 500;
}

.code-content {
    padding: 1rem;
    overflow-x: auto;
}

.code-content pre {
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.code-content code {
    display: block;
    white-space: pre;
}

.line-number {
    display: inline-block;
    width: 2.5em;
    padding-right: 1em;
    margin-right: 1em;
    color: #6c757d;
    text-align: right;
    border-right: 1px solid #444;
    user-select: none;
}

.example-preview {
    background-color: var(--white);
    border: 1px solid var(--gray-medium);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

/* ===== 提示框样式 ===== */
.tip-box {
    background-color: #e8f4fd;
    border-left: 4px solid #2196F3;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.warning-box {
    background-color: #ffebee;
    border-left: 4px solid #f44336;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

/* ===== 表格样式 ===== */
.syntax-table,
.syntax-table table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background-color: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.syntax-table th,
.syntax-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-medium);
}

.syntax-table th {
    background-color: var(--primary-color);
    color: var(--accent-color);
    font-weight: 600;
}

.syntax-table tr:last-child td {
    border-bottom: none;
}

.syntax-table tr:hover {
    background-color: var(--gray-light);
}

/* ===== 浏览器支持样式 ===== */
.browser-support {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin: 1rem 0;
    border-left: 4px solid #4CAF50;
}

.support-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.support-browser {
    width: 100px;
    font-weight: bold;
}

.support-version {
    flex: 1;
}

/* ===== 标签列表样式 ===== */
.tag-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    margin: 1rem 0;
}

.tag-item {
    background-color: var(--white);
    padding: 0.5rem;
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
}

/* ===== 表单样式 ===== */
.form-preview {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-medium);
    margin: 1rem 0;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--gray-medium);
    border-radius: 4px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(130, 37, 94, 0.2);
}

.example-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

/* ===== 代码语法高亮 ===== */
.code-content .tag {
    color: #e06c75;
}

.code-content .attr {
    color: #d19a66;
}

.code-content .value {
    color: #98c379;
}

.code-content .comment {
    color: #5c6370;
}

/* ===== 复制代码按钮样式 ===== */
.copy-code-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.copy-code-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.copy-code-btn.copied {
    background: #28a745;
}

.copy-code-btn svg {
    width: 14px;
    height: 14px;
}

/* ===== 代码块折叠样式 ===== */
.code-content.collapsed {
    max-height: 0;
    overflow: hidden;
}

.code-content {
    transition: max-height 0.3s ease-out;
}

/* ===== 快速导航样式 ===== */
.quick-nav.visible {
    opacity: 1;
    transform: translateY(0);
}

.quick-nav {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

/* ===== 表单页面特定样式 ===== */
.form-demo-section {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-medium);
    margin: 1rem 0;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.form-example {
    background-color: var(--gray-light);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.validation-demo {
    background-color: #e8f4fd;
    border-left: 4px solid #2196F3;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

/* ===== 参考手册页面特定样式 ===== */
.search-box {
    margin: 20px 0;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    box-sizing: border-box;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--gray-medium);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    z-index: 15;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.search-box {
    position: relative;
    z-index: 20;
}

.quick-nav {
    position: relative;
    z-index: 10;
    margin-top: 15px;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.search-category-header {
    padding: 8px 15px;
    background-color: var(--primary-color);
    color: var(--accent-color);
    font-weight: bold;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--primary-dark);
}

.search-result-item {
    padding: 10px 15px;
    border-bottom: 1px solid var(--gray-light);
    cursor: pointer;
    transition: var(--transition);
    outline: none;
}

.search-result-item:hover,
.search-result-item:focus {
    background-color: var(--gray-light);
}

.search-result-title {
    font-weight: bold;
    margin-bottom: 4px;
    color: var(--primary-color);
}

.search-result-desc {
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: var(--dark-color);
}

.search-result-meta {
    font-size: 0.8rem;
    color: var(--secondary-color);
}

.search-no-results {
    padding: 15px;
    text-align: center;
    color: var(--dark-color);
}

mark {
    background-color: #ffeb3b;
    color: #000;
    padding: 0 2px;
    border-radius: 2px;
}

.property-list {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.property-item {
    width: 150px;
    margin: 5px;
    padding: 5px;
    text-align: center;
    background-color: var(--light-color);
}

.reference-section {
    background: var(--accent-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.quick-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.quick-nav a {
    background: var(--primary-color);
    color: var(--accent-color);
    padding: 8px 16px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.quick-nav a:hover {
    background: var(--primary-dark);
}

.tag-badge {
    display: inline-block;
    background: var(--dark-color);
    color: var(--light-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    margin-right: 5px;
}

.compatibility-table,
.compatibility-table table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.compatibility-table th,
.compatibility-table td {
    padding: 8px;
    text-align: center;
    border: 1px solid var(--gray-medium);
}

.compatibility-table th {
    background: var(--primary-color);
    color: var(--accent-color);
}

.supported {
    background: #d4edda;
    color: #155724;
}

.partial {
    background: #fff3cd;
    color: #856404;
}

.unsupported {
    background: #f8d7da;
    color: #721c24;
}

/* ===== 底部导航样式 ===== */
.footer-nav {
    background-color: var(--primary-color);
    padding: 1rem 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

footer {
    background-color: var(--dark-color);
    color: var(--light-color);
    text-align: center;
    padding: 1.25rem 1rem;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

footer p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

footer a {
    color: var(--light-color);
    text-decoration: none;
    transition: var(--transition);
}

footer a:hover {
    text-decoration: underline;
    color: var(--accent-color);
}

/* ===== 交互演示功能样式 ===== */
/* ===== 通用交互演示样式 ===== */
.interactive-demo {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-medium);
    margin: 1rem 0;
}

.demo-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.demo-button {
    background-color: var(--primary-color);
    color: var(--accent-color);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.demo-button:hover {
    background-color: var(--primary-dark);
}

.demo-output {
    background-color: var(--gray-light);
    padding: 1rem;
    border-radius: var(--border-radius);
    position: relative;
    min-height: 100px;
    overflow: auto;
}

/* 增强的演示样式 */
.interactive-demo.enhanced {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.demo-controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.control-group {
    background: var(--gray-light);
    padding: 1rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.control-group h4 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--gray-medium);
    padding-bottom: 0.5rem;
}

.control-group label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--dark-color);
}

.control-group input[type="range"] {
    width: 100%;
}

.control-group select {
    padding: 0.5rem;
    border: 1px solid var(--gray-medium);
    border-radius: 4px;
    font-family: inherit;
}

/* ===== 盒模型演示样式 ===== */
.box-model-visualization {
    position: relative;
    margin: 2rem auto;
    max-width: 500px;
}

.margin-area {
    background-color: rgba(184, 59, 106, 0.1);
    padding: 30px;
    border: 1px dashed var(--secondary-color);
    position: relative;
}

.border-area {
    background-color: rgba(130, 37, 94, 0.1);
    padding: 5px;
    border: 5px solid var(--primary-color);
    position: relative;
}

.padding-area {
    background-color: rgba(209, 195, 157, 0.2);
    padding: 20px;
    position: relative;
}

.content-area {
    background-color: var(--accent-color);
    width: 200px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: bold;
    color: var(--dark-color);
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
}

.margin-label,
.border-label,
.padding-label,
.content-label {
    position: absolute;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--dark-color);
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 6px;
    border-radius: 3px;
}

.margin-label {
    top: 5px;
    right: 5px;
    background-color: rgba(184, 59, 106, 0.2);
}

.border-label {
    top: 5px;
    right: 5px;
    background-color: rgba(130, 37, 94, 0.2);
}

.padding-label {
    top: 5px;
    right: 5px;
    background-color: rgba(209, 195, 157, 0.4);
}

.content-label {
    bottom: 5px;
    left: 5px;
}

.dimensions-info {
    background: var(--gray-light);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

.dimension-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-medium);
}

.dimension-row:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.dimension-label {
    font-weight: 600;
    color: var(--dark-color);
}

/* ===== 布局演示样式 ===== */
.interactive-demo.enhanced {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin: 2rem 0;
}

.demo-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gray-light);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-label {
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.9rem;
}

#currentLayout,
#itemCount {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.demo-output.enhanced {
    border: 2px dashed var(--gray-medium);
    background: linear-gradient(45deg, var(--gray-light) 25%, transparent 25%),
        linear-gradient(-45deg, var(--gray-light) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--gray-light) 75%),
        linear-gradient(-45deg, transparent 75%, var(--gray-light) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    padding: 2rem;
    border-radius: var(--border-radius);
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.layout-demo-container {
    width: 100%;
    transition: all 0.3s ease;
}

/* 增强的演示项目样式 */
.demo-item {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin: 5px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    box-sizing: border-box;
    min-width: unset;
}

.demo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-color: var(--accent-color);
}

.item-number {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.item-content {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 布局类型特定样式 */
.layout-float .demo-item {
    float: left;
    box-sizing: border-box;
}

.layout-float::after {
    content: "";
    display: table;
    clear: both;
}

.layout-multicol {
    column-gap: 20px;
}

.layout-multicol .demo-item {
    break-inside: avoid;
    margin-bottom: 10px;
    display: inline-block;
    width: 100%;
}

.layout-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.layout-flex .demo-item {
    flex: 1;
    min-width: 100px;
}

.layout-grid {
    display: grid;
    gap: 20px;
}

.layout-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* ===== 选择器演示样式 ===== */
.control-group {
    background: var(--white);
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-medium);
}

.control-group .demo-button {
    display: block;
    width: 100%;
    margin-bottom: 0.5rem;
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-group .demo-button:hover {
    background: var(--primary-dark);
    transform: translateX(5px);
}

.demo-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--gray-light);
    border-radius: var(--border-radius);
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#currentSelector {
    background: var(--dark-color);
    color: var(--light-color);
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
}

#matchCount {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.demo-reset-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    margin-left: auto;
}

.demo-reset-btn:hover {
    background: var(--primary-dark);
}

.demo-content {
    padding: 1rem;
}

.demo-container {
    border: 2px dashed var(--gray-medium);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.5);
}

.demo-list {
    background: var(--white);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

.demo-list li {
    padding: 0.5rem;
    border-bottom: 1px solid var(--gray-light);
}

.demo-list li:last-child {
    border-bottom: none;
}

.demo-link {
    color: var(--primary-color);
    text-decoration: none;
}

.demo-link:hover {
    text-decoration: underline;
}

.demo-explanation {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--gray-light);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.demo-explanation h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

#selectorExplanation {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* 增强选择器高亮效果 */
.selector-highlight {
    position: relative;
    background: linear-gradient(135deg, #ffeb3b, #ff9800) !important;
    color: #000 !important;
    border: 2px solid #ff9800 !important;
    box-shadow: 0 0 0 4px rgba(255, 152, 0, 0.3) !important;
    z-index: 10;
    animation: pulse-highlight 0.6s ease;
}

.selector-hover-simulated {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb) !important;
    color: #1565c0 !important;
    border: 2px solid #2196f3 !important;
    box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.3) !important;
    text-decoration: underline !important;
    position: relative;
    z-index: 10;
}

.selector-info {
    position: absolute;
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    z-index: 20;
    white-space: nowrap;
    pointer-events: none;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    animation: fadeIn 0.3s ease;
}

.selector-info::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--primary-color);
}

/* ===== 伪类演示样式 ===== */
.demo-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 20px;
    background: var(--gray-light);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    min-height: 150px;
    align-items: center;
    justify-content: center;
}

.demo-container[data-demo-state="active"] {
    border: 2px solid var(--primary-color);
    background: rgba(130, 37, 94, 0.05);
}

.demo-item {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.demo-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), transparent);
}

.demo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* 状态指示器 */
.demo-info-bar {
    display: flex;
    gap: 2rem;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--gray-light);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-label {
    font-weight: 600;
    color: var(--dark-color);
}

#demoState,
#activeEffect {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

#demoState.active {
    background: var(--secondary-color);
}

/* 表单演示区域 */
.form-demo-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-medium);
}

.form-demo-section h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.demo-input {
    padding: 0.75rem;
    border: 2px solid var(--gray-medium);
    border-radius: var(--border-radius);
    font-family: inherit;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 300px;
}

.demo-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(130, 37, 94, 0.1);
}

.checkbox-label {
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 4px;
}

.demo-checkbox:checked+.checkbox-label {
    font-weight: 600;
}

/* 提示信息 */
.demo-controls-hint {
    text-align: center;
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(209, 195, 157, 0.1);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--accent-color);
}

.demo-controls-hint p {
    margin: 0;
    color: var(--dark-color);
    font-size: 0.9rem;
}

/* 控制组布局优化 */
.demo-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.control-group {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-medium);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.control-group h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.control-group label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

.control-group select {
    padding: 0.75rem;
    border: 2px solid var(--gray-medium);
    border-radius: var(--border-radius);
    font-family: inherit;
    background: white;
    transition: all 0.3s ease;
}

.control-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(130, 37, 94, 0.1);
}

/* 按钮样式优化 */
.demo-button {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.demo-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(130, 37, 94, 0.3);
}

.demo-button:active {
    transform: translateY(0);
}

.demo-button.secondary {
    background: var(--accent-color);
    color: var(--dark-color);
}

.demo-button.secondary:hover {
    background: #c4b48c;
}

/* ===== 伪元素演示样式 ===== */
/* ::before 样式 */
.pseudo-before-icon::before {
    content: "🔹 ";
    color: var(--primary-color);
    font-weight: bold;
    margin-right: 8px;
}

.pseudo-before-quote::before {
    content: "「";
    color: var(--primary-color);
    font-size: 2em;
    font-weight: bold;
    margin-right: 5px;
    line-height: 1;
}

.pseudo-before-highlight::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 0;
    width: 5px;
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.pseudo-before-border::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    border: 2px dashed var(--primary-color);
    border-radius: 5px;
    box-sizing: border-box;
}

/* ::after 样式 */
.pseudo-after-icon::after {
    content: " 🔹";
    color: var(--primary-color);
    font-weight: bold;
    margin-left: 8px;
}

.pseudo-after-quote::after {
    content: "」";
    color: var(--primary-color);
    font-size: 2em;
    font-weight: bold;
    margin-left: 5px;
    line-height: 1;
}

.pseudo-after-highlight::after {
    content: "";
    position: absolute;
    right: -5px;
    top: 0;
    width: 5px;
    height: 100%;
    background-color: var(--secondary-color);
    border-radius: 2px;
}

.pseudo-after-border::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 5px;
    width: calc(100% - 10px);
    height: calc(100% - 10px);
    border: 1px solid var(--secondary-color);
    border-radius: 3px;
    box-sizing: border-box;
}

/* ::first-letter 样式 */
.pseudo-first-letter-icon::first-letter {
    font-size: 2em;
    color: var(--primary-color);
    font-weight: bold;
    float: left;
    line-height: 1;
    margin-right: 5px;
}

.pseudo-first-letter-quote::first-letter {
    font-size: 3em;
    color: var(--primary-color);
    font-weight: bold;
    float: left;
    line-height: 0.8;
    margin-right: 8px;
    font-family: serif;
}

.pseudo-first-letter-highlight::first-letter {
    background-color: var(--primary-color);
    color: white;
    padding: 5px 8px;
    border-radius: 4px;
    font-weight: bold;
    margin-right: 8px;
}

.pseudo-first-letter-border::first-letter {
    border: 2px solid var(--primary-color);
    padding: 5px 8px;
    border-radius: 4px;
    font-weight: bold;
    margin-right: 8px;
    background-color: rgba(130, 37, 94, 0.1);
}

/* ::first-line 样式 */
.pseudo-first-line-icon::first-line {
    font-weight: bold;
    color: var(--primary-color);
    letter-spacing: 1px;
}

.pseudo-first-line-quote::first-line {
    font-style: italic;
    color: var(--secondary-color);
    text-decoration: underline;
}

.pseudo-first-line-highlight::first-line {
    background-color: rgba(184, 59, 106, 0.2);
    padding: 2px 5px;
    border-radius: 3px;
}

.pseudo-first-line-border::first-line {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 2px;
}

/* 增强的伪元素演示样式 */
#pseudoElementDemo {
    position: relative;
    padding: 2rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
}

#pseudoElementDemo.active {
    border-color: var(--primary-color);
    background: rgba(130, 37, 94, 0.05);
}

#demoText {
    line-height: 1.8;
    text-align: justify;
    margin: 0;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

/* 伪元素状态指示器 */
#demoState {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

#demoState.active {
    background: var(--secondary-color);
    animation: pulse 2s infinite;
}

/* 伪元素效果预览增强 */
.pseudo-effect-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--gray-light);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.pseudo-effect-preview h5 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* ===== 文本样式演示增强样式 ===== */
.typography-demo-content {
    padding: 2rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

.demo-title {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.demo-paragraph {
    margin-bottom: 1.5rem;
    line-height: inherit;
    text-align: inherit;
}

.demo-quote {
    border-left: 4px solid var(--secondary-color);
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--dark-color);
    background: var(--gray-light);
    padding: 1rem;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.value-display {
    display: inline-block;
    min-width: 50px;
    text-align: right;
    font-weight: 600;
    color: var(--primary-color);
}

/* ===== 定位演示优化样式 ===== */
.positioning-demo-container {
    position: relative;
    width: 100%;
    height: 500px;
    border: 2px dashed var(--gray-medium);
    background:
        linear-gradient(90deg, var(--gray-light) 1px, transparent 1px) 0 0 / 20px 20px,
        linear-gradient(var(--gray-light) 1px, transparent 1px) 0 0 / 20px 20px;
    overflow: hidden;
    margin: 1rem 0;
}

.position-context-indicator {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 200px;
    height: 150px;
    border: 2px solid var(--primary-color);
    background-color: rgba(130, 37, 94, 0.1);
    z-index: 0;
}

.context-label {
    position: absolute;
    top: -25px;
    left: 0;
    background-color: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.context-area {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 500;
}

.demo-element-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.static-element,
.reference-element,
.overlay-element {
    position: absolute;
    width: 100px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.static-element {
    top: 50px;
    left: 250px;
    background-color: var(--secondary-color);
    color: white;
    z-index: 0;
}

.reference-element {
    top: 150px;
    left: 150px;
    background-color: var(--accent-color);
    color: var(--dark-color);
    z-index: 0;
}

.overlay-element {
    top: 100px;
    left: 200px;
    background-color: rgba(184, 59, 106, 0.7);
    color: white;
    z-index: 0;
}

.position-demo-element {
    position: static;
    width: 120px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 1;
    cursor: move;
    user-select: none;
}

.position-demo-element:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.element-content {
    padding: 10px;
    text-align: center;
}

.element-coordinates,
.element-zindex {
    font-size: 0.7rem;
    margin-top: 5px;
    opacity: 0.9;
    font-family: 'Courier New', monospace;
}

.element-coordinates {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.scroll-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    overflow-y: auto;
    background-color: rgba(255, 255, 255, 0.95);
    border-top: 2px solid var(--gray-medium);
    z-index: 2;
}

.scroll-indicator {
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    position: sticky;
    top: 0;
    z-index: 10;
}

.scroll-item {
    padding: 20px;
    border-bottom: 1px solid var(--gray-light);
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    transition: background-color 0.3s ease;
}

.scroll-item:nth-child(even) {
    background-color: var(--gray-light);
}

.scroll-item:hover {
    background-color: rgba(130, 37, 94, 0.1);
}

.z-index-visual {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;
    border: 1px solid var(--gray-medium);
    padding: 10px;
    border-radius: var(--border-radius);
    background: var(--gray-light);
}

.z-layer {
    padding: 8px 12px;
    background-color: var(--white);
    border-radius: 4px;
    text-align: center;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    opacity: 0.6;
    border: 1px solid var(--gray-medium);
}

.z-layer.active {
    background-color: var(--primary-color);
    color: white;
    opacity: 1;
    transform: scale(1.05);
    border-color: var(--primary-dark);
}

.control-description {
    font-size: 0.8rem;
    color: var(--dark-color);
    margin-top: 5px;
    font-style: italic;
    line-height: 1.4;
}

/* 定位类型特定样式 */
.position-demo-element.position-static {
    background: linear-gradient(135deg, #6c757d, #495057);
}

.position-demo-element.position-relative {
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
}

.position-demo-element.position-absolute {
    background: linear-gradient(135deg, #198754, #146c43);
}

.position-demo-element.position-fixed {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: var(--dark-color);
}

.position-demo-element.position-sticky {
    background: linear-gradient(135deg, #dc3545, #b02a37);
}

/* 拖拽状态 */
.position-demo-element.dragging {
    cursor: grabbing;
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

/* ===== Flexbox演示样式 ===== */
.flex-demo {
    display: flex;
    background-color: var(--light-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    min-height: 150px;
    border: 2px dashed var(--primary-color);
    transition: all 0.3s ease;
}

.flex-item {
    background-color: var(--primary-color);
    color: var(--accent-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 500;
    transition: var(--transition);
    min-width: 80px;
    min-height: 60px;
    margin: 5px;
    border: 2px solid var(--primary-dark);
}

.flex-item:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
}

.flex-item:nth-child(1) {
    background-color: #82255E;
}

.flex-item:nth-child(2) {
    background-color: #B83B6A;
}

.flex-item:nth-child(3) {
    background-color: #D1C39D;
    color: var(--dark-color);
}

.flex-item:nth-child(4) {
    background-color: #2A101B;
}

.flex-item:nth-child(5) {
    background-color: #6a1e4c;
}

/* Flexbox演示控件样式 */
.flex-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.flex-control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.flex-control-group label {
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.9rem;
}

.flex-control-group select {
    padding: 0.5rem;
    border: 1px solid var(--gray-medium);
    border-radius: 4px;
    font-family: inherit;
    background-color: white;
}

.flex-control-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(130, 37, 94, 0.2);
}

/* ===== 增强的Flexbox演示样式 ===== */
.flex-demo-enhanced {
    display: flex;
    background-color: var(--light-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    min-height: 200px;
    border: 2px dashed var(--primary-color);
    transition: all 0.3s ease;
    width: 600px;
    margin: 0 auto;
    position: relative;
    background-image:
        linear-gradient(90deg, var(--gray-medium) 1px, transparent 1px),
        linear-gradient(var(--gray-medium) 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: center center;
}

.flex-item-enhanced {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 100px;
    min-height: 80px;
    border: 2px solid var(--primary-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.flex-item-enhanced:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    z-index: 10;
}

.flex-item-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), transparent);
}

.flex-item-number {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--dark-color);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

.flex-item-size {
    font-size: 0.7rem;
    margin-top: 5px;
    opacity: 0.9;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
}

.flex-item-enhanced:nth-child(1) {
    background: linear-gradient(135deg, #82255E, #B83B6A);
}

.flex-item-enhanced:nth-child(2) {
    background: linear-gradient(135deg, #B83B6A, #D1C39D);
}

.flex-item-enhanced:nth-child(3) {
    background: linear-gradient(135deg, #D1C39D, #2A101B);
    color: var(--accent-color);
}

.flex-item-enhanced:nth-child(4) {
    background: linear-gradient(135deg, #2A101B, #6a1e4c);
}

.flex-item-enhanced:nth-child(5) {
    background: linear-gradient(135deg, #6a1e4c, #82255E);
}

.flex-item-enhanced:nth-child(6) {
    background: linear-gradient(135deg, #9c366b, #B83B6A);
}

.flex-item-enhanced:nth-child(7) {
    background: linear-gradient(135deg, #c94c7a, #D1C39D);
    color: var(--dark-color);
}

.flex-item-enhanced:nth-child(8) {
    background: linear-gradient(135deg, #e8a5b8, #2A101B);
}

.flex-item-enhanced:nth-child(9) {
    background: linear-gradient(135deg, #2A101B, #6a1e4c);
}

.flex-item-enhanced:nth-child(10) {
    background: linear-gradient(135deg, #6a1e4c, #82255E);
}

.flex-item-enhanced:nth-child(11) {
    background: linear-gradient(135deg, #82255E, #B83B6A);
}

.flex-item-enhanced:nth-child(12) {
    background: linear-gradient(135deg, #B83B6A, #D1C39D);
    color: var(--dark-color);
}

/* 主轴和交叉轴指示器 */
.axis-indicator {
    position: absolute;
    pointer-events: none;
    z-index: 5;
}

.main-axis {
    border-top: 2px solid var(--primary-color);
    width: 100%;
    top: 50%;
    transform: translateY(-50%);
}

.cross-axis {
    border-left: 2px solid var(--secondary-color);
    height: 100%;
    left: 50%;
    transform: translateX(-50%);
}

.axis-label {
    position: absolute;
    background: var(--primary-color);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: bold;
}

.main-axis-label {
    top: -25px;
    left: 10px;
}

.cross-axis-label {
    top: 10px;
    left: -35px;
    transform: rotate(-90deg);
    background: var(--secondary-color);
}

.demo-code-preview {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--gray-light);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.demo-code-preview h4 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.demo-code-preview pre {
    background: var(--dark-color);
    color: var(--light-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

/* ===== 增强的Grid演示样式 ===== */
.grid-demo {
    display: grid;
    background-color: var(--light-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    min-height: 300px;
    border: 2px dashed var(--primary-color);
    transition: all 0.3s ease;
    background-image:
        linear-gradient(90deg, var(--gray-medium) 1px, transparent 1px),
        linear-gradient(var(--gray-medium) 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: center center;
}

.grid-item {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
    min-height: 80px;
    border: 2px solid var(--primary-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.grid-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    z-index: 10;
}

.grid-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), transparent);
}

.item-number {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--dark-color);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

.grid-item:nth-child(1) {
    background: linear-gradient(135deg, #82255E, #B83B6A);
}

.grid-item:nth-child(2) {
    background: linear-gradient(135deg, #B83B6A, #D1C39D);
}

.grid-item:nth-child(3) {
    background: linear-gradient(135deg, #D1C39D, #2A101B);
    color: var(--accent-color);
}

.grid-item:nth-child(4) {
    background: linear-gradient(135deg, #2A101B, #6a1e4c);
}

.grid-item:nth-child(5) {
    background: linear-gradient(135deg, #6a1e4c, #82255E);
}

.grid-item:nth-child(6) {
    background: linear-gradient(135deg, #9c366b, #B83B6A);
}

/* Grid演示控件样式 */
.grid-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.grid-control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.grid-control-group label {
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.9rem;
}

.grid-control-group input,
.grid-control-group select {
    padding: 0.5rem;
    border: 1px solid var(--gray-medium);
    border-radius: 4px;
    font-family: inherit;
}

.grid-control-group input:focus,
.grid-control-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(130, 37, 94, 0.2);
}

.demo-buttons {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

/* ===== CSS变量演示样式 ===== */
.variable-demo-item {
    padding: var(--demo-spacing);
    background-color: var(--demo-primary);
    color: white;
    border-radius: var(--demo-radius);
    box-shadow: 0 var(--demo-shadow) var(--demo-shadow) rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
    font-size: var(--demo-font-size);
    transition: all 0.3s ease;
    position: relative;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.variable-demo-item.secondary {
    background-color: var(--accent-color);
    color: var(--dark-color);
}

.color-preview {
    width: 100%;
    height: 30px;
    border: 1px solid var(--gray-medium);
    border-radius: 4px;
    margin-top: 5px;
}

.value-display {
    font-weight: bold;
    color: var(--primary-color);
    min-width: 40px;
    display: inline-block;
    text-align: right;
}

/* CSS变量演示字体大小修复 */
.variable-demo-item .item-content,
.variable-demo-item .element-properties {
    font-size: inherit;
}

/* 颜色与背景交互演示优化样式 */
.color-info {
    font-size: 0.9rem;
}

.color-info p {
    margin: 0.5rem 0;
    font-family: 'Courier New', monospace;
    background: var(--gray-light);
    padding: 0.5rem;
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
}

/* 改进的演示输出区域 */
.demo-output.enhanced #backgroundDemo {
    padding: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    transition: all 0.3s ease;
}

.demo-output.enhanced #backgroundDemo h4 {
    margin-bottom: 1rem;
    color: inherit;
    font-size: 1.5rem;
}

.demo-output.enhanced #backgroundDemo p {
    margin: 0.5rem 0;
    line-height: 1.6;
}

/* 改进的控制组布局 */
.control-group h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

/* 颜色预览改进 */
.color-preview {
    width: 100%;
    height: 40px;
    border: 2px solid var(--gray-medium);
    border-radius: var(--border-radius);
    margin-top: 0.5rem;
    transition: all 0.3s ease;
}

.color-preview:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ===== 响应式设计演示增强样式 ===== */
.responsive-demo-container {
    width: 800px;
    max-width: 100%;
    margin: 0 auto;
    background: white;
    border: 1px solid var(--gray-medium);
    transition: all 0.3s ease;
    position: relative;
}

/* 移动设备模拟样式 */
.responsive-demo-container.mobile-view {
    width: 375px;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 20px rgba(130, 37, 94, 0.3);
    border-radius: 12px;
    overflow: hidden;
}

.responsive-demo-container.tablet-view {
    width: 768px;
    border: 2px solid var(--secondary-color);
    box-shadow: 0 0 20px rgba(184, 59, 106, 0.3);
    border-radius: 8px;
    overflow: hidden;
}

.demo-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.demo-header h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
}

.demo-header p {
    margin: 0;
    opacity: 0.9;
}

.demo-content {
    display: flex;
    padding: 1.5rem;
    gap: 2rem;
    min-height: 300px;
}

/* 流体布局 */
.layout-fluid .demo-content {
    flex-wrap: wrap;
}

.layout-fluid .content-section {
    flex: 2;
    min-width: 300px;
}

.layout-fluid .sidebar-section {
    flex: 1;
    min-width: 250px;
}

/* Flexbox 布局 */
.layout-flexbox .demo-content {
    display: flex;
    flex-wrap: wrap;
}

.layout-flexbox .content-section {
    flex: 2 1 600px;
}

.layout-flexbox .sidebar-section {
    flex: 1 1 300px;
}

/* Grid 布局 */
.layout-grid .demo-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

/* 浮动布局 */
.layout-float .demo-content {
    overflow: hidden;
}

.layout-float .content-section {
    float: left;
    width: 66.66%;
    margin-right: 2rem;
}

.layout-float .sidebar-section {
    float: left;
    width: calc(33.33% - 2rem);
}

.sidebar-section {
    background: var(--accent-color);
    color: var(--dark-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--secondary-color);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.feature-item {
    background: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid var(--gray-medium);
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.demo-footer {
    background: var(--dark-color);
    color: white;
    padding: 1rem;
    text-align: center;
    border-top: 1px solid var(--gray-medium);
}

/* 媒体查询信息面板 */
.media-queries-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--gray-light);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.media-queries-info h4 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.media-query-item {
    background: white;
    padding: 0.75rem;
    margin: 0.5rem 0;
    border-radius: 4px;
    border-left: 3px solid var(--secondary-color);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.media-query-item.active {
    background: var(--primary-color);
    color: white;
    border-left-color: var(--accent-color);
}

/* 断点指示器 */
.breakpoint-indicator {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 0 0 0 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* 响应式文本示例 */
.responsive-text {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    line-height: 1.6;
}

/* 设备框架模拟 */
.device-frame {
    position: relative;
    background: #f0f0f0;
    border-radius: 12px;
    padding: 20px;
    margin: 0 auto;
}

.device-frame::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 6px;
    background: #ccc;
    border-radius: 3px;
}

/* ===== 过渡演示特定样式 ===== */
.transition-demo-element {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    user-select: none;
    margin: 0 auto;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* 过渡演示背景颜色修复 */
.transition-demo-element[data-transition-type="background-color"] {
    background: var(--primary-color) !important;
    background-image: none !important;
}

.transition-demo-element[data-transition-type="all"] {
    background: var(--primary-color) !important;
    background-image: none !important;
}

.transition-demo-element:hover {
    transform: scale(1.05);
}

.transition-demo-element::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), transparent);
}

.element-properties {
    font-size: 0.7rem;
    margin-top: 5px;
    opacity: 0.9;
    font-family: 'Courier New', monospace;
}

.demo-events {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--gray-light);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.demo-events h4 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.events-log {
    background: var(--dark-color);
    color: var(--light-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    max-height: 150px;
    overflow-y: auto;
    line-height: 1.4;
}

.events-log div {
    padding: 2px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.events-log div:last-child {
    border-bottom: none;
}

/* 过渡状态指示器 */
#transitionState {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

#transitionState.transitioning {
    background: var(--secondary-color);
    animation: pulse 1s infinite;
}

/* ===== 动画演示专用关键帧 ===== */
@keyframes pulse-highlight {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.7);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 10px rgba(255, 152, 0, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 152, 0, 0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-30px);
    }

    60% {
        transform: translateY(-15px);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-10px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(10px);
    }
}

@keyframes flip {
    0% {
        transform: perspective(400px) rotateY(0);
    }

    50% {
        transform: perspective(400px) rotateY(180deg);
    }

    100% {
        transform: perspective(400px) rotateY(360deg);
    }
}

@keyframes zoom {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* 动画演示容器样式 */
#animationDemo {
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

#animationDemo.running::after {
    content: '▶';
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

#animationDemo.paused::after {
    content: '⏸';
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

/* 动画事件显示区域样式 */
#animationEvents {
    transition: all 0.3s ease;
    min-height: 40px;
    font-family: 'Courier New', monospace;
}

.animation-event {
    padding: 5px 8px;
    margin: 2px 0;
    border-radius: 3px;
    font-size: 0.85rem;
    animation: fadeIn 0.3s ease;
}

.animation-event.start {
    background: rgba(76, 175, 80, 0.2);
    border-left: 3px solid #4CAF50;
}

.animation-event.end {
    background: rgba(244, 67, 54, 0.2);
    border-left: 3px solid #f44336;
}

.animation-event.iteration {
    background: rgba(33, 150, 243, 0.2);
    border-left: 3px solid #2196F3;
}

.animation-event.cancel {
    background: rgba(255, 152, 0, 0.2);
    border-left: 3px solid #FF9800;
}

/* 增强的伪类效果样式 */
.demo-hover-active.demo-style-color {
    color: #ff6b6b !important;
    background-color: #ffecec !important;
}

.demo-active-active.demo-style-color {
    color: white !important;
    background-color: #e74c3c !important;
}

.demo-focus-active.demo-style-color {
    color: white !important;
    background-color: #3498db !important;
}

.demo-hover-active.demo-style-transform {
    transform: scale(1.1) rotate(5deg) !important;
}

.demo-active-active.demo-style-transform {
    transform: scale(0.9) !important;
}

.demo-focus-active.demo-style-transform {
    transform: scale(1.05) !important;
    outline: 3px solid #3498db !important;
}

.demo-hover-active.demo-style-background {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color)) !important;
}

.demo-active-active.demo-style-background {
    background: linear-gradient(45deg, #c0392b, #e74c3c) !important;
}

.demo-focus-active.demo-style-background {
    background: linear-gradient(45deg, #2980b9, #3498db) !important;
}

.demo-hover-active.demo-style-border {
    border: 3px solid var(--accent-color) !important;
    box-shadow: 0 0 10px rgba(209, 195, 157, 0.5) !important;
}

.demo-active-active.demo-style-border {
    border: 3px solid #e74c3c !important;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2) !important;
}

.demo-focus-active.demo-style-border {
    border: 3px solid #3498db !important;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.5) !important;
    outline: none !important;
}

/* ===== 变换演示增强样式 ===== */
.transform-demo-element {
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid rgba(255, 255, 255, 0.1);
}

.transform-demo-element::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), transparent);
}

.transform-demo-element:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

.element-content {
    padding: 20px;
    text-align: center;
    z-index: 2;
    position: relative;
}

.element-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.element-properties {
    font-size: 0.8rem;
    opacity: 0.9;
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.2);
    padding: 5px 10px;
    border-radius: 4px;
}

.element-properties div {
    margin: 2px 0;
}

/* 坐标轴指示器 */
.axis-indicator {
    position: absolute;
    pointer-events: none;
    transition: all 0.3s ease;
}

.x-axis {
    width: 200%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ff4444, transparent);
    top: 50%;
    left: -50%;
    opacity: 0.3;
}

.y-axis {
    width: 1px;
    height: 200%;
    background: linear-gradient(180deg, transparent, #44ff44, transparent);
    left: 50%;
    top: -50%;
    opacity: 0.3;
}

.z-axis {
    width: 2px;
    height: 2px;
    background: #4444ff;
    border-radius: 50%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.3;
}

/* 3D变换时的特殊样式 */
#transformContainer.preserve-3d .transform-demo-element {
    background: linear-gradient(135deg, #82255E, #B83B6A);
    border: 3px solid rgba(255, 255, 255, 0.2);
}

/* 背面可见性 */
.transform-demo-element.backface-hidden {
    backface-visibility: hidden;
}

/* 变换预览区域增强 */
#transformContainer {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 20% 20%, rgba(130, 37, 94, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(184, 59, 106, 0.1) 0%, transparent 50%);
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
}

/* 网格背景 */
#transformContainer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(130, 37, 94, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(130, 37, 94, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: center center;
    opacity: 0.5;
}

/* ===== 高级效果演示特定样式 ===== */
.advanced-demo-element {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.1);
}

.advanced-demo-element::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), transparent);
}

.advanced-demo-element:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

/* 滤镜效果样式 */
.effect-filter {
    filter: blur(5px) brightness(1.2) hue-rotate(45deg);
}

.effect-filter-high {
    filter: blur(10px) brightness(1.5) hue-rotate(180deg) saturate(2);
}

/* 混合模式效果 */
.effect-blend {
    background:
        linear-gradient(45deg, var(--primary-color), var(--secondary-color)),
        repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255, 255, 255, 0.1) 10px, rgba(255, 255, 255, 0.1) 20px);
    background-blend-mode: overlay;
}

.effect-blend-high {
    background:
        radial-gradient(circle at 30% 30%, var(--accent-color), transparent 50%),
        linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    background-blend-mode: difference;
}

/* 剪切路径效果 */
.effect-clip {
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.effect-clip-high {
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}

/* 渐变效果 */
.effect-gradient {
    background: radial-gradient(circle at 30% 30%, var(--primary-color), var(--secondary-color));
}

.effect-gradient-high {
    background:
        radial-gradient(circle at 20% 20%, var(--accent-color), transparent 40%),
        radial-gradient(circle at 80% 80%, var(--secondary-color), transparent 40%),
        radial-gradient(circle at 50% 50%, var(--primary-color), #2A101B);
}

/* 遮罩效果 */
.effect-mask {
    mask-image: linear-gradient(45deg, black 40%, transparent 60%);
    -webkit-mask-image: linear-gradient(45deg, black 40%, transparent 60%);
}

.effect-mask-high {
    mask-image:
        radial-gradient(circle at center, black 30%, transparent 70%),
        linear-gradient(to right, transparent 20%, black 40%, black 60%, transparent 80%);
    -webkit-mask-image:
        radial-gradient(circle at center, black 30%, transparent 70%),
        linear-gradient(to right, transparent 20%, black 40%, black 60%, transparent 80%);
}

/* 阴影效果 */
.effect-shadow {
    box-shadow:
        0 0 20px rgba(130, 37, 94, 0.5),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
}

.effect-shadow-high {
    box-shadow:
        0 0 40px rgba(130, 37, 94, 0.8),
        0 0 80px rgba(184, 59, 106, 0.4),
        inset 0 0 30px rgba(255, 255, 255, 0.2);
    filter: drop-shadow(0 0 10px rgba(209, 195, 157, 0.5));
}

/* ===== 反馈消息样式 ===== */
.demo-feedback {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    color: white;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.demo-feedback.show {
    transform: translateX(0);
}

.feedback-success {
    background-color: #28a745;
}

.feedback-info {
    background-color: #17a2b8;
}

.feedback-warning {
    background-color: #ffc107;
    color: var(--dark-color);
}

/* ===== 滚动进度条样式 ===== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #82255e, #e91e63);
    z-index: 1000;
    transition: width 0.1s ease;
    pointer-events: none;
}

/* ===== 表单验证样式 ===== */
.field-error {
    color: #f44336;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: #f44336;
}

.required {
    color: #f44336;
}

/* ===== 搜索相关样式 ===== */
.search-loading {
    padding: 15px;
    text-align: center;
    color: var(--dark-color);
}

.search-stats {
    padding: 8px 15px;
    background-color: var(--gray-light);
    font-size: 0.8rem;
    color: var(--dark-color);
    border-bottom: 1px solid var(--gray-medium);
}

.search-history-item,
.search-popular-item {
    padding: 10px 15px;
    border-bottom: 1px solid var(--gray-light);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.search-history-item:hover,
.search-popular-item:hover {
    background-color: var(--gray-light);
}

.search-history-icon {
    margin-right: 8px;
    color: var(--primary-color);
}

.search-popular-count {
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    margin-right: 8px;
}

.search-history-remove {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-history-remove:hover {
    color: #f44336;
}

.search-result-more {
    padding: 10px 15px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--dark-color);
    border-top: 1px solid var(--gray-light);
}

.show-all-results {
    color: var(--primary-color);
    text-decoration: none;
}

.show-all-results:hover {
    text-decoration: underline;
}

.touch-active {
    background-color: var(--gray-light) !important;
}

/* ===== 响应式设计 ===== */
@media (min-width: 576px) {
    .container {
        max-width: 540px;
        padding: 0 15px;
    }

    header {
        padding: 1.75rem 1rem;
    }

    header h1 {
        font-size: 2rem;
    }

    header p {
        font-size: 1.05rem;
    }

    main {
        padding: 1.75rem 1rem;
    }

    .hero-content {
        padding: 2.5rem;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .path-step {
        padding: 2rem;
    }

    .featured-card {
        padding: 2rem;
    }

    .quick-link {
        padding: 1.25rem;
    }

    .content-section {
        padding: 1.75rem;
    }

    footer {
        padding: 1.5rem 1rem;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }

    header {
        padding: 2rem 1rem;
    }

    header h1 {
        font-size: 2.25rem;
    }

    header p {
        font-size: 1.1rem;
    }

    main {
        padding: 2rem 1rem;
    }

    .hero-section {
        flex-direction: row;
        align-items: center;
    }

    .hero-content {
        flex: 1;
        text-align: left;
    }

    .hero-stats {
        justify-content: flex-start;
    }

    .hero-visual {
        flex: 1;
        justify-content: flex-end;
    }

    .path-steps {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .path-step {
        flex: 1;
        min-width: 200px;
    }

    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .links-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .content-section {
        padding: 2rem;
    }

    .tag-list {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .form-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* 移动设备布局调整 */
    .demo-content {
        flex-direction: column;
    }

    .layout-grid .demo-content {
        grid-template-columns: 1fr;
    }

    .layout-float .content-section,
    .layout-float .sidebar-section {
        float: none;
        width: 100%;
        margin-right: 0;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
        padding: 0 15px;
    }

    header {
        padding: 2.5rem 1rem;
    }

    header h1 {
        font-size: 2.5rem;
    }

    main {
        padding: 2.5rem 1rem;
    }

    .hamburger {
        display: none;
    }

    .nav-menu {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 0;
    }

    .nav-menu a {
        padding: 0.8rem 0.6rem;
        font-size: 0.9rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .hero-content {
        padding: 3rem;
    }

    .hero-content h2 {
        font-size: 2.2rem;
    }

    .path-step {
        padding: 2.5rem 1.5rem;
    }

    .featured-card {
        padding: 2.5rem;
    }

    .quick-link {
        padding: 1.5rem;
    }

    .content-section {
        padding: 2.25rem;
    }

    .links-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }

    header h1 {
        font-size: 2.8rem;
    }

    .hero-content h2 {
        font-size: 2.5rem;
    }

    .content-section {
        padding: 2.5rem;
    }

    .nav-menu a {
        padding: 0.8rem 1rem;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }

    header {
        padding: 3rem 1rem;
    }

    .hero-content {
        padding: 4rem;
    }

    .content-section {
        padding: 3rem;
    }
}

@media (max-width: 991px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--dark-color);
        flex-direction: column;
        transform: translateY(-10px);
        opacity: 0;
        visibility: hidden;
        z-index: 99;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
        display: flex;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-menu li {
        width: 100%;
        text-align: center;
    }

    .nav-menu a {
        padding: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .hamburger.active {
        transform: translateY(-50%) rotate(90deg);
    }

    .syntax-table {
        display: block;
        overflow-x: auto;
    }

    .tag-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .footer-nav-links {
        gap: 1rem;
    }

    .footer-nav-link {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
    }

    .search-result-title {
        font-size: 0.9rem;
    }

    .search-result-desc {
        font-size: 0.8rem;
    }

    /* 响应式调整 */
    .demo-controls {
        grid-template-columns: 1fr;
    }

    .demo-info-bar {
        flex-direction: column;
        gap: 1rem;
    }

    .demo-item {
        width: 80px;
        height: 80px;
        font-size: 0.8rem;
    }

    .control-group {
        padding: 1rem;
    }

    .form-demo-section {
        padding: 1rem;
    }

    .demo-container {
        gap: 10px;
        padding: 15px;
    }

    .demo-item {
        width: 70px;
        height: 70px;
        font-size: 0.75rem;
    }

    .demo-controls-grid {
        grid-template-columns: 1fr;
    }

    #pseudoElementDemo {
        padding: 1rem;
        min-height: 150px;
    }

    #demoText {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .positioning-demo-container {
        height: 400px;
    }

    .position-context-indicator {
        width: 150px;
        height: 100px;
    }

    .static-element,
    .reference-element,
    .overlay-element {
        width: 80px;
        height: 60px;
        font-size: 0.7rem;
    }

    .position-demo-element {
        width: 100px;
        height: 80px;
        font-size: 0.8rem;
    }

    .scroll-content {
        height: 150px;
    }

    .scroll-item {
        padding: 15px;
        height: 60px;
    }

    .flex-demo-enhanced {
        width: 100%;
        min-height: 150px;
        padding: 1rem;
    }

    .flex-item-enhanced {
        min-width: 80px;
        min-height: 60px;
        padding: 0.75rem;
        font-size: 0.8rem;
    }

    .color-info p {
        font-size: 0.8rem;
    }

    .demo-output.enhanced #backgroundDemo {
        padding: 1rem;
        min-height: 150px;
    }

    .transition-demo-element {
        width: 80px;
        height: 80px;
        font-size: 0.8rem;
    }

    .element-properties {
        font-size: 0.6rem;
    }

    .transform-demo-element {
        width: 120px;
        height: 120px;
    }

    .element-title {
        font-size: 1rem;
    }

    .element-properties {
        font-size: 0.7rem;
    }

    .advanced-demo-element {
        width: 150px;
        height: 150px;
    }

    .element-title {
        font-size: 0.9rem;
    }

    .element-properties {
        font-size: 0.7rem;
    }
}

/* ===== 可访问性和性能优化 ===== */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .path-step:hover,
    .featured-card:hover,
    .quick-link:hover {
        transform: none;
    }

    .hamburger span {
        transition: none;
    }
}

@media (prefers-contrast: more) {
    :root {
        --primary-color: #000000;
        --secondary-color: #333333;
        --accent-color: #ffffff;
        --dark-color: #000000;
        --light-color: #ffffff;
        --gray-light: #ffffff;
    }

    .path-step,
    .featured-card,
    .quick-link {
        border: 2px solid #000;
    }
}

@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    .path-step,
    .featured-card,
    .quick-link {
        border: 1px solid #000;
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }

    a[href]:after {
        content: " (" attr(href) ")";
    }

    header,
    footer {
        background: white !important;
        color: black !important;
    }

    .hamburger,
    .nav-menu {
        display: none !important;
    }

    .code-example {
        background: white !important;
        color: black !important;
        border: 1px solid #000;
    }

    .code-content code {
        color: black !important;
    }
}