/* 基础样式 */
:root {
    --bg: #fafafa;
    --bg-alt: #f0f0f0;
    --text: #1a1a1a;
    --text-muted: #666;
    --primary: #f7931a;
    --primary-dark: #e8850f;
    --success: #22c55e;
    --warning: #eab308;
    --error: #ef4444;
    --border: #e0e0e0;
    --card-bg: #fff;
    --code-bg: #f5f5f5;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* 侧边导航 */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 240px;
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    z-index: 100;
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.nav-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.logo {
    text-decoration: none;
    padding: 0 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.logo-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
}

.logo-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* 首页链接 */
.nav-home {
    display: block;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.6rem 1.25rem;
    margin-bottom: 0.5rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.nav-home:hover {
    color: var(--primary);
    background: var(--bg-alt);
}

.nav-home.active {
    color: var(--primary);
    background: var(--bg-alt);
    border-left-color: var(--primary);
    font-weight: 600;
}

/* 导航分组 */
.nav-groups {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-group {
    border-bottom: 1px solid var(--border);
}

.nav-group:last-child {
    border-bottom: none;
}

/* 分组标题 */
.nav-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1.25rem;
    cursor: pointer;
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    user-select: none;
    transition: all 0.2s;
}

.nav-group-title:hover {
    background: var(--bg-alt);
}

.nav-group-title .group-icon {
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.nav-group-title .expand-icon {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.nav-group.expanded .nav-group-title .expand-icon {
    transform: rotate(90deg);
}

.nav-group.has-active .nav-group-title {
    color: var(--primary);
}

/* 子链接 */
.nav-group-links {
    display: none;
    flex-direction: column;
    padding-bottom: 0.5rem;
}

.nav-group.expanded .nav-group-links {
    display: flex;
}

.nav-group-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.5rem 1.25rem 0.5rem 2.5rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    position: relative;
}

.nav-group-links a::before {
    content: '';
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--border);
    transition: all 0.2s;
}

.nav-group-links a:hover {
    color: var(--primary);
    background: var(--bg-alt);
}

.nav-group-links a:hover::before {
    background: var(--primary);
}

.nav-group-links a.active {
    color: var(--primary);
    background: var(--bg-alt);
    border-left-color: var(--primary);
    font-weight: 600;
}

.nav-group-links a.active::before {
    background: var(--primary);
    width: 6px;
    height: 6px;
}

/* 子链接样式 */
.nav-group-links a.sub-link {
    padding-left: 2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.nav-group-links a.sub-link::before {
    display: none;
}

.nav-group-links a.sub-link:hover {
    color: var(--primary);
}

.nav-group-links a.sub-link.active {
    color: var(--primary);
    font-weight: 500;
}

/* 旧的 nav-links 保持兼容 */
.nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.75rem 1.5rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-links a:hover {
    color: var(--primary);
    background: var(--bg-alt);
}

.nav-links a.active {
    color: var(--primary);
    background: var(--bg-alt);
    border-left-color: var(--primary);
    font-weight: 600;
}

/* 语言切换按钮 */
.lang-btn {
    position: absolute;
    bottom: 2rem;
    left: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.lang-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* 主内容区偏移 */
body {
    margin-left: 240px;
}

/* 主要容器 */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* 区块 */
.section {
    padding: 6rem 0;
}

.section.alt {
    background: var(--bg-alt);
}

main .section:first-child {
    padding-top: 8rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.section-desc {
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 600px;
}

/* 卡片 */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin: 1.5rem 0;
}

.card.highlight {
    border-left: 4px solid var(--primary);
}

.card.info {
    border-left: 4px solid #3b82f6;
}

.card.warning {
    border-left: 4px solid var(--warning);
    background: #fefce8;
}

.card h4 {
    margin-bottom: 0.75rem;
}

.card ul {
    list-style: none;
    padding-left: 0;
}

.card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.card li:last-child {
    border-bottom: none;
}

/* 概念分组 */
.concepts-section {
    margin-bottom: 2rem;
}

.concepts-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
    border-left: 3px solid var(--primary);
}

/* 概念网格 */
.concepts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.concept {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.concept:hover {
    transform: translateY(-4px);
}

.concept .emoji {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.75rem;
}

.concept h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.concept p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* 演示框 */
.demo-box {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label,
.block-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

textarea,
input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

textarea:focus,
input:focus {
    outline: none;
    border-color: var(--primary);
}

textarea {
    min-height: 80px;
    resize: vertical;
}

/* 哈希显示 */
.hash-display {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.8rem;
    background: var(--code-bg);
    padding: 1rem;
    border-radius: var(--radius);
    word-break: break-all;
    line-height: 1.8;
    transition: background 0.3s;
}

.hash-display.hash-updated {
    background: #fef3c7;
}

.hash-display.binary {
    font-size: 0.65rem;
    line-height: 1.6;
    letter-spacing: 1px;
}

.hash-char {
    transition: color 0.3s, background 0.3s;
}

.hash-char.changed {
    color: #dc2626;
    background: #fee2e2;
    border-radius: 2px;
    animation: charFlash 0.5s ease-out;
}

@keyframes charFlash {
    0% { background: #fca5a5; transform: scale(1.2); }
    100% { background: #fee2e2; transform: scale(1); }
}

.hash-output {
    margin-bottom: 1rem;
}

.hash-output label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.hash-visual {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-top: 1rem;
}

.hash-bit {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    transition: background 0.3s;
}

/* 区块演示 */
.block-demo {
    display: flex;
    justify-content: center;
}

.block-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 500px;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.block-card.valid {
    border-color: var(--success);
}

.block-card.invalid {
    border-color: var(--error);
}

.block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.block-number {
    font-weight: 700;
    font-size: 1.1rem;
}

.block-status {
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    background: var(--code-bg);
}

.block-field {
    margin-bottom: 1rem;
}

.block-field input[readonly] {
    background: var(--code-bg);
    color: var(--text-muted);
}

.block-hash {
    font-size: 0.75rem;
}

.nonce-control {
    display: flex;
    gap: 0.5rem;
}

.nonce-control input {
    flex: 1;
}

.btn-small {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.btn-small:hover {
    background: var(--code-bg);
}

.difficulty-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.difficulty-control label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.difficulty-control input[type="range"] {
    flex: 1;
    max-width: 150px;
}

#difficulty-value {
    font-weight: 600;
    min-width: 20px;
}

/* ==========================================
   区块结构图
   ========================================== */
.block-structure-diagram {
    margin: 1.5rem 0;
}

.structure-block {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 2px solid var(--primary);
    overflow: hidden;
}

.block-section {
    padding: 1.25rem;
}

.block-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-section {
    background: rgba(247, 147, 26, 0.05);
    border-bottom: 2px dashed var(--border);
}

.header-fields {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-item {
    display: grid;
    grid-template-columns: 120px 70px 1fr;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--card-bg);
    border-radius: 4px;
    font-size: 0.85rem;
    align-items: center;
}

.field-item.highlight {
    background: rgba(247, 147, 26, 0.15);
    border: 1px solid var(--primary);
}

.field-name {
    font-weight: 600;
}

.field-size {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: monospace;
}

.field-desc {
    color: var(--text-muted);
}

.body-section {
    background: var(--bg);
}

.tx-list-preview {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tx-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--card-bg);
    border-radius: 4px;
    font-size: 0.85rem;
}

.tx-item.coinbase {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--success);
}

.tx-item.more {
    color: var(--text-muted);
    font-style: italic;
}

.tx-icon {
    font-size: 1rem;
}

/* 区块头字段详解 */
.field-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.detail-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.detail-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.detail-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
}

.detail-content p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.detail-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--primary);
    text-decoration: none;
}

.detail-link:hover {
    text-decoration: underline;
}

/* ==========================================
   挖矿页面样式
   ========================================== */

/* 挖矿概念流程 */
.mining-concept {
    margin: 1.5rem 0;
}

.concept-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: var(--radius);
}

.flow-item {
    text-align: center;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius);
    min-width: 100px;
    border: 2px solid var(--border);
}

.flow-item.highlight {
    border-color: var(--primary);
    background: rgba(247, 147, 26, 0.1);
}

.flow-item.success {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.flow-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.flow-label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.flow-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.flow-arrow {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: bold;
}

/* 难度演示 */
.difficulty-demo {
    margin: 1.5rem 0;
}

.difficulty-examples {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.diff-example {
    display: grid;
    grid-template-columns: 140px 150px 150px 1fr;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    align-items: center;
    font-size: 0.85rem;
}

.diff-label {
    font-weight: 600;
}

.diff-target {
    font-family: monospace;
    color: var(--primary);
}

.diff-prob {
    color: var(--text-muted);
}

.diff-bar {
    height: 8px;
    background: linear-gradient(90deg, var(--success), var(--warning), var(--error));
    border-radius: 4px;
}

.real-difficulty {
    background: rgba(247, 147, 26, 0.1);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

.real-difficulty h4 {
    margin: 0 0 0.5rem 0;
    color: var(--primary);
}

.real-difficulty p {
    margin: 0;
    font-size: 0.9rem;
}

/* 挖矿模拟器 */
.mining-simulator {
    margin: 1.5rem 0;
}

.sim-block {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 2px solid var(--border);
    margin-bottom: 1rem;
}

.sim-field {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.sim-field label {
    min-width: 120px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.sim-field input[type="text"] {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.9rem;
}

.difficulty-selector {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.difficulty-selector input {
    flex: 1;
    max-width: 150px;
}

.nonce-value {
    font-family: monospace;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.hash-value {
    font-family: monospace;
    font-size: 0.75rem;
    word-break: break-all;
    background: var(--code-bg);
    padding: 0.5rem;
    border-radius: 4px;
    flex: 1;
}

.hash-value .hash-zeros {
    color: var(--success);
    font-weight: bold;
}

.target-value {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.sim-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.sim-stats {
    display: flex;
    gap: 2rem;
    padding: 1rem;
    background: var(--code-bg);
    border-radius: var(--radius);
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stat-value {
    font-weight: 600;
    font-family: monospace;
}

.stat-value.mining {
    color: var(--primary);
    animation: pulse 1s infinite;
}

.stat-value.success {
    color: var(--success);
}

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

.mining-result {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
    border: 2px solid var(--success);
    border-radius: var(--radius);
}

.result-success {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.result-icon {
    font-size: 1.5rem;
}

.result-text {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--success);
}

.result-details p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

.result-details code {
    font-size: 0.75rem;
    background: var(--card-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* 挖矿奖励 */
.reward-breakdown {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.reward-item {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.reward-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.reward-content h4 {
    margin: 0 0 0.5rem 0;
}

.reward-content p {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.halving-timeline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.halving-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border-radius: 4px;
    min-width: 70px;
}

.halving-item.current {
    background: rgba(247, 147, 26, 0.15);
    border: 1px solid var(--primary);
}

.halving-year {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.halving-reward {
    font-weight: 600;
    font-size: 0.85rem;
}

.halving-arrow {
    color: var(--text-muted);
}

.halving-note, .fee-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.5rem;
}

/* 挖矿意义 */
.mining-significance {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.sig-item {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius);
}

.sig-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.sig-item strong {
    display: block;
    margin-bottom: 0.25rem;
}

.sig-item p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* 挖矿页面响应式 */
@media (max-width: 768px) {
    .concept-flow {
        flex-direction: column;
    }

    .flow-arrow {
        transform: rotate(90deg);
    }

    .diff-example {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .sim-field {
        flex-direction: column;
        align-items: flex-start;
    }

    .sim-field label {
        min-width: auto;
    }

    .field-item {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .halving-timeline {
        justify-content: center;
    }
}

/* 按钮 */
.btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: var(--radius);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover {
    background: var(--code-bg);
}

.btn.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn.primary:hover {
    background: var(--primary-dark);
}

.btn.secondary {
    background: transparent;
    color: var(--text-muted);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 区块链 */
.chain-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.blockchain {
    display: flex;
    overflow-x: auto;
    gap: 0;
    padding: 1rem 0;
}

.chain-block {
    flex-shrink: 0;
    width: 280px;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.chain-block.valid {
    border-color: var(--success);
}

.chain-block.invalid {
    border-color: var(--error);
}

.chain-link {
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    font-size: 1.5rem;
    color: var(--text-muted);
}

.chain-block .block-header {
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}

.chain-block .block-field {
    margin-bottom: 0.75rem;
}

.chain-block textarea,
.chain-block input {
    font-size: 0.8rem;
    padding: 0.5rem;
}

.chain-block textarea {
    min-height: 50px;
}

.chain-block .hash-display {
    font-size: 0.65rem;
    padding: 0.5rem;
}

/* POW 演示 */
.pow-demo {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.pow-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat {
    text-align: center;
    padding: 1rem;
    background: var(--code-bg);
    border-radius: var(--radius);
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-weight: 600;
}

.stat-value code {
    background: #1a1a1a;
    color: var(--success);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.pow-log {
    background: #1a1a1a;
    border-radius: var(--radius);
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    font-family: monospace;
}

.log-entry {
    display: grid;
    grid-template-columns: 80px 1fr 60px;
    gap: 1rem;
    padding: 0.5rem 0;
    font-size: 0.75rem;
    color: #888;
    border-bottom: 1px solid #333;
}

.log-entry.header {
    color: #666;
    font-weight: 600;
    position: sticky;
    top: 0;
    background: #1a1a1a;
}

.log-entry.success {
    color: var(--success);
}

.log-entry.fail {
    color: #ef4444;
}

.log-entry span:nth-child(2) {
    word-break: break-all;
}

.pow-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* 总结流程 */
.summary-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 3rem 0;
}

.flow-step {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    width: 140px;
    box-shadow: var(--shadow);
}

.flow-num {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.flow-step h4 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.flow-step p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.flow-arrow {
    font-size: 1.5rem;
    color: var(--text-muted);
}

/* 引用 */
.quote {
    font-size: 1.2rem;
    font-style: italic;
    text-align: center;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.quote cite {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 1rem;
    font-style: normal;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* 响应式 */
@media (max-width: 768px) {
    .nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: auto;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 1rem 0;
    }

    .nav-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 0 1rem;
    }

    .logo {
        margin-bottom: 0;
        padding: 0;
    }

    .nav-links {
        display: none;
    }

    body {
        margin-left: 0;
        padding-top: 60px;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    .section {
        padding: 4rem 0;
    }

    .container {
        padding: 0 1rem;
    }

    .pow-stats {
        grid-template-columns: 1fr;
    }

    .summary-flow {
        flex-direction: column;
    }

    .flow-arrow {
        transform: rotate(90deg);
    }

    .flow-step {
        width: 100%;
        max-width: 200px;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
    }

    .page-nav {
        flex-direction: column;
        gap: 1rem;
    }

    .page-nav .btn {
        text-align: center;
    }
}

/* 动画 */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.mining {
    animation: pulse 0.5s infinite;
}

/* 滚动条 */
.pow-log::-webkit-scrollbar,
.blockchain::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.pow-log::-webkit-scrollbar-track,
.blockchain::-webkit-scrollbar-track {
    background: transparent;
}

.pow-log::-webkit-scrollbar-thumb,
.blockchain::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.blockchain::-webkit-scrollbar-thumb {
    background: var(--border);
}

/* 页面头部 */
.page-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.page-icon {
    font-size: 3rem;
    line-height: 1;
}

.page-header h1 {
    margin-bottom: 0.5rem;
}

/* 页面导航 */
.page-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

/* 导航链接样式 */
.nav-links a.active {
    color: var(--primary);
    font-weight: 600;
}

/* 概念卡片链接样式 */
a.concept {
    text-decoration: none;
    color: inherit;
    display: block;
}

a.concept:hover {
    transform: translateY(-4px);
}

/* 首页英雄区 */
.hero {
    padding-top: 4rem;
}

.summary-section {
    margin-top: 4rem;
}

.summary-section h2 {
    text-align: center;
    margin-bottom: 1rem;
}

/* 数字签名页面 */
.demo-box h3 {
    margin-bottom: 0.5rem;
}

.demo-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.key-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

.key-box {
    padding: 1rem;
    border-radius: var(--radius);
    background: var(--code-bg);
}

.key-box.private {
    border: 2px solid #ef4444;
}

.key-box.public {
    border: 2px solid #22c55e;
}

.key-box.generated {
    animation: keyGenerated 0.5s ease-out;
}

@keyframes keyGenerated {
    0% { transform: scale(0.95); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

.key-box label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.key-display {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.7rem;
    word-break: break-all;
    line-height: 1.6;
}

.signature-output {
    margin-top: 1.5rem;
}

.signature-output label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.verify-result {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
    font-weight: 500;
}

.result-success {
    color: #16a34a;
}

.result-error {
    color: #dc2626;
}

@media (max-width: 768px) {
    .key-pair {
        grid-template-columns: 1fr;
    }
}

/* 共识传播页面 (旧版样式) */
.p2p-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.network-container {
    background: var(--code-bg);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

#network-canvas {
    display: block;
    width: 100%;
    height: auto;
}

.network-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .network-stats {
        grid-template-columns: 1fr;
    }

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

/* 签名过程可视化 */
.sign-process,
.verify-process {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--code-bg);
    border-radius: var(--radius);
}

.sign-process h4,
.verify-process h4 {
    margin-bottom: 1rem;
    color: var(--text);
}

.process-flow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.process-step {
    flex: 1;
    min-width: 120px;
    max-width: 160px;
    text-align: center;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 2px solid transparent;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.process-step.active {
    opacity: 1;
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(247, 147, 26, 0.3);
}

.step-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.step-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.step-value {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.65rem;
    word-break: break-all;
    color: var(--text);
    min-height: 2em;
}

.step-value.hash-value {
    color: var(--primary);
}

.process-arrow {
    font-size: 1.5rem;
    color: var(--border);
    opacity: 0.3;
    transition: all 0.3s ease;
}

.process-arrow.active {
    opacity: 1;
    color: var(--primary);
}

/* 验证过程可视化 */
.verify-flow {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.verify-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.verify-item {
    width: 100%;
    max-width: 400px;
    text-align: center;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 2px solid transparent;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.verify-item.active {
    opacity: 1;
    border-color: var(--primary);
}

.verify-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.verify-value {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
    word-break: break-all;
}

.verify-value.hash-value {
    color: var(--primary);
}

.verify-arrow {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.verify-compare {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 2px solid transparent;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.verify-compare.active {
    opacity: 1;
    border-color: var(--primary);
}

.compare-left,
.compare-right {
    flex: 1;
    max-width: 250px;
    text-align: center;
}

.compare-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.compare-value {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.65rem;
    word-break: break-all;
    padding: 0.5rem;
    background: var(--code-bg);
    border-radius: 4px;
}

.compare-value.hash-value {
    color: var(--primary);
}

.compare-icon {
    font-size: 2rem;
    transition: all 0.3s ease;
}

.compare-icon.match {
    color: var(--success);
    animation: iconPop 0.3s ease;
}

.compare-icon.mismatch {
    color: var(--error);
    animation: iconShake 0.3s ease;
}

@keyframes iconPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

@keyframes iconShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.verify-final {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 2px solid transparent;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.verify-final.active {
    opacity: 1;
}

.verify-final.success {
    border-color: var(--success);
    background: #f0fdf4;
}

.verify-final.error {
    border-color: var(--error);
    background: #fef2f2;
}

.verify-final-icon {
    font-size: 2.5rem;
}

.verify-final-text {
    font-size: 1.2rem;
    font-weight: 600;
}

.verify-final.success .verify-final-text {
    color: var(--success);
}

.verify-final.error .verify-final-text {
    color: var(--error);
}

@media (max-width: 768px) {
    .process-flow {
        flex-direction: column;
    }

    .process-step {
        max-width: 100%;
    }

    .process-arrow {
        transform: rotate(90deg);
    }

    .verify-compare {
        flex-direction: column;
    }

    .compare-left,
    .compare-right {
        max-width: 100%;
    }
}

/* ==========================================
   地址页面样式
   ========================================== */

/* 地址生成垂直流程 */
.address-steps-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.address-step-row {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1rem;
    border: 2px solid transparent;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.address-step-row.active {
    opacity: 1;
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(247, 147, 26, 0.3);
}

.step-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.step-header .step-icon {
    font-size: 1.2rem;
}

.step-header .step-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.step-value-full {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
    word-break: break-all;
    line-height: 1.6;
    padding: 0.75rem;
    background: var(--code-bg);
    border-radius: 4px;
    color: var(--text);
}

.step-value-full.hash-value {
    color: var(--primary);
}

.step-value-full.address-value {
    color: var(--success);
    font-weight: 600;
    font-size: 0.9rem;
}

.address-arrow-down {
    text-align: center;
    font-size: 1.5rem;
    color: var(--border);
    opacity: 0.3;
    transition: all 0.3s ease;
}

.address-arrow-down.active {
    opacity: 1;
    color: var(--primary);
}

.address-flow {
    flex-wrap: wrap;
    justify-content: center;
}

.address-flow .process-step {
    min-width: 140px;
}

.address-output {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--code-bg);
    border-radius: var(--radius);
}

.address-output label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.address-display {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 1.1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 2px solid var(--success);
    text-align: center;
    word-break: break-all;
}

.address-note {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

.address-value {
    color: var(--success) !important;
    font-weight: 600;
}

.validate-result {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
}

.address-breakdown {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--code-bg);
    border-radius: var(--radius);
}

.address-breakdown h4 {
    margin-bottom: 1rem;
}

.breakdown-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.breakdown-item {
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
}

.breakdown-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.breakdown-value {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.8rem;
    word-break: break-all;
    color: var(--primary);
    line-height: 1.6;
}

/* 地址类型选择器 */
.address-type-selector {
    margin-bottom: 1.5rem;
}

.address-type-selector > label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.type-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--code-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.type-btn:hover {
    border-color: var(--primary);
}

.type-btn.active {
    border-color: var(--primary);
    background: rgba(247, 147, 26, 0.1);
}

.type-prefix {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.type-name {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.type-tag {
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    background: var(--border);
    border-radius: 10px;
    color: var(--text-muted);
}

.type-btn.active .type-tag {
    background: var(--primary);
    color: white;
}

/* 地址类型信息 */
.address-type-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--code-bg);
    border-radius: var(--radius);
}

.type-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.8rem;
    color: white;
    background: var(--primary);
}

.type-badge.p2pkh { background: #6366f1; }
.type-badge.p2sh { background: #8b5cf6; }
.type-badge.p2wpkh { background: #06b6d4; }
.type-badge.p2tr { background: #22c55e; }

.type-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* 地址类型详解网格 */
.address-types-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.address-type-card {
    background: var(--code-bg);
    border-radius: var(--radius);
    padding: 1rem;
}

.address-type-card .type-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.address-type-card .type-icon {
    font-size: 1.5rem;
}

.address-type-card h5 {
    font-size: 1rem;
    margin: 0;
}

.address-type-card .type-full {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.address-type-card .type-example {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.7rem;
    color: var(--primary);
    padding: 0.5rem;
    background: var(--card-bg);
    border-radius: 4px;
    margin-bottom: 0.75rem;
    word-break: break-all;
}

.address-type-card .type-description {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.address-type-card .type-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.address-type-card .meta-item {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.address-type-card .meta-item strong {
    color: var(--text);
}

/* 演进时间线 */
.evolution-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    background: var(--code-bg);
    border-radius: var(--radius);
}

.timeline-year {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary);
    min-width: 50px;
}

.timeline-event {
    font-size: 0.85rem;
    color: var(--text);
}

@media (max-width: 768px) {
    .type-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .address-types-grid {
        grid-template-columns: 1fr;
    }
}

/* P2SH 脚本类型样式 */
.script-types-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.script-type-card {
    background: var(--code-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.script-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.script-icon {
    font-size: 1.5rem;
}

.script-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text);
}

.script-tag {
    display: inline-block;
    font-size: 0.7rem;
    background: var(--primary);
    color: white;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    margin-top: 0.25rem;
}

.script-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.script-diagram {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.diagram-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-align: center;
}

.multisig-visual,
.timelock-visual,
.htlc-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.key-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.key-item {
    font-size: 0.8rem;
    background: var(--bg-alt);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.arrow-down {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.script-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.5rem;
    width: 100%;
    overflow-x: auto;
}

.script-box code {
    font-size: 0.7rem;
    color: var(--primary-dark);
    white-space: nowrap;
}

.script-box.compact code {
    font-size: 0.65rem;
    white-space: pre-wrap;
    word-break: break-all;
}

.result-box {
    font-size: 0.8rem;
    color: var(--text);
}

.result-box code {
    color: var(--success);
    font-weight: 600;
}

.time-condition {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    background: var(--bg-alt);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
}

.condition-icon {
    font-size: 1rem;
}

.htlc-paths {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.htlc-path {
    flex: 1;
    padding: 0.5rem;
    border-radius: 4px;
    text-align: center;
}

.htlc-path.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--success);
}

.htlc-path.refund {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
}

.path-label {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.path-condition {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.htlc-or {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
}

.script-use-cases {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.use-case-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.use-case {
    font-size: 0.7rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* P2SH 脚本真实示例样式 */
.script-example {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.example-header {
    margin-bottom: 1rem;
}

.example-badge {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.example-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.example-step {
    background: var(--bg);
    border-radius: 6px;
    padding: 0.75rem;
}

.example-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.example-value {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.7rem;
    line-height: 1.6;
}

.example-value code {
    display: block;
    margin-bottom: 0.25rem;
    padding: 0.3rem 0.5rem;
    background: var(--code-bg);
    border-radius: 4px;
    word-break: break-all;
}

.example-value code.pubkey {
    position: relative;
}

.example-value .key-tag {
    background: var(--primary);
    color: white;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.6rem;
    margin-left: 0.5rem;
}

.example-value code.script-hex {
    font-size: 0.65rem;
    white-space: pre-wrap;
    line-height: 1.8;
}

.example-value code.script-hex .op {
    color: #e11d48;
    font-weight: 600;
}

.example-value code.script-hex .data {
    color: #7c3aed;
}

.example-value code.script-hex .comment {
    color: var(--text-muted);
    font-size: 0.6rem;
}

.example-value code.script-hex .highlight-num {
    color: var(--primary);
    font-weight: 600;
}

.example-value code.script-hex .highlight-hash {
    color: var(--success);
}

.example-value .highlight-a { color: #e11d48; }
.example-value .highlight-b { color: #7c3aed; }
.example-value .highlight-c { color: #0891b2; }
.example-value .highlight-secret { color: var(--warning); font-style: italic; }

.example-value code.hash {
    color: var(--primary-dark);
    background: rgba(247, 147, 26, 0.1);
    font-weight: 500;
}

.example-value code.address {
    color: white;
    background: var(--success);
    font-weight: 600;
    font-size: 0.8rem;
}

.example-value code.hashlock {
    font-size: 0.65rem;
    background: rgba(234, 179, 8, 0.1);
    border: 1px dashed var(--warning);
}

.highlight-animated {
    animation: highlightPulse 0.5s ease;
}

@keyframes highlightPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); box-shadow: 0 0 10px rgba(247, 147, 26, 0.3); }
    100% { transform: scale(1); }
}

/* HTLC 双路径图示 */
.htlc-paths-diagram {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.htlc-path-box {
    flex: 1;
    max-width: 140px;
    padding: 0.5rem;
    border-radius: 6px;
    text-align: center;
}

.htlc-path-box.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--success);
}

.htlc-path-box.refund {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
}

.htlc-path-box .path-title {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.htlc-path-box .path-desc {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.htlc-or-box {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 0.25rem;
}

.example-value.htlc-keys code.pubkey {
    display: inline-block;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.example-value code.htlc-script {
    font-size: 0.6rem;
    line-height: 2;
}

.btn.small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .htlc-paths-diagram {
        flex-direction: column;
    }

    .htlc-path-box {
        max-width: 100%;
    }

    .example-value.htlc-keys code.pubkey {
        display: block;
        margin-right: 0;
    }
}

/* P2SH 生成流程 */
.p2sh-generation-flow {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.p2sh-generation-flow h4 {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.p2sh-generation-flow .flow-steps {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.p2sh-generation-flow .flow-step {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: var(--code-bg);
    padding: 0.75rem;
    border-radius: var(--radius);
    flex: 1;
    min-width: 150px;
    max-width: 200px;
}

.p2sh-generation-flow .flow-num {
    background: var(--primary);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
}

.p2sh-generation-flow .flow-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.p2sh-generation-flow .flow-content strong {
    font-size: 0.8rem;
}

.p2sh-generation-flow .flow-content p {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin: 0;
}

.p2sh-generation-flow .flow-arrow {
    color: var(--text-muted);
    font-size: 1rem;
    padding-top: 0.75rem;
}

@media (max-width: 768px) {
    .script-types-container {
        grid-template-columns: 1fr;
    }

    .htlc-paths {
        flex-direction: column;
    }

    .htlc-or {
        transform: none;
    }

    .p2sh-generation-flow .flow-steps {
        flex-direction: column;
        align-items: stretch;
    }

    .p2sh-generation-flow .flow-step {
        max-width: none;
    }

    .p2sh-generation-flow .flow-arrow {
        text-align: center;
        transform: rotate(90deg);
        padding: 0.5rem 0;
    }
}

/* ==========================================
   UTXO 页面样式
   ========================================== */

.utxo-wallet {
    background: var(--code-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.wallet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 1rem;
}

.wallet-address,
.wallet-balance {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.wallet-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.wallet-value {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
}

.wallet-balance .wallet-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--success);
}

.utxo-list {
    margin-bottom: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.utxo-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.utxo-item:hover {
    border-color: var(--primary);
}

.utxo-item.selected {
    border-color: var(--success);
    background: #f0fdf4;
}

.utxo-amount {
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 120px;
}

.utxo-details {
    flex: 1;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.utxo-txid,
.utxo-vout {
    font-family: 'Monaco', 'Consolas', monospace;
}

.utxo-status {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    background: var(--code-bg);
}

.utxo-status.selected {
    background: var(--success);
    color: white;
}

.utxo-status.unspent {
    color: var(--text-muted);
}

.empty-hint {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-size: 0.9rem;
}

/* 交易构建器 */
.tx-builder {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tx-section {
    flex: 1;
    min-width: 250px;
    padding: 1.5rem;
    background: var(--code-bg);
    border-radius: var(--radius);
}

.tx-section h4 {
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.tx-arrow-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
}

.tx-big-arrow {
    font-size: 2rem;
    color: var(--primary);
}

.tx-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.tx-inputs {
    min-height: 80px;
    margin-bottom: 1rem;
}

.tx-input-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: var(--card-bg);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.input-amount {
    font-weight: 600;
}

.input-txid {
    font-family: 'Monaco', 'Consolas', monospace;
    color: var(--text-muted);
}

.tx-input-total {
    display: flex;
    justify-content: space-between;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    font-weight: 600;
}

.tx-output-form {
    margin-bottom: 1rem;
}

.output-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.output-row label {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 70px;
}

.output-row input {
    flex: 1;
    font-size: 0.85rem;
}

.output-row .unit {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.tx-outputs-preview {
    margin-bottom: 1rem;
}

.output-preview-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--card-bg);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.output-preview-item.change {
    border-left: 3px solid var(--warning);
}

.output-label {
    color: var(--text-muted);
}

.output-address {
    flex: 1;
    font-family: 'Monaco', 'Consolas', monospace;
}

.output-amount {
    font-weight: 600;
}

.tx-summary {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.summary-row.fee {
    color: var(--warning);
}

/* 交易动画 */
.tx-result {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--code-bg);
    border-radius: var(--radius);
}

.tx-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.tx-anim-inputs,
.tx-anim-outputs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 120px;
}

.tx-anim-center {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tx-anim-arrow {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.tx-anim-box {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-weight: 700;
    transition: all 0.3s;
}

.tx-anim-box.processing {
    border-color: var(--primary);
    animation: pulse 0.3s infinite;
}

.tx-anim-box.done {
    border-color: var(--success);
    background: #f0fdf4;
}

.anim-utxo {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    text-align: center;
    transition: all 0.3s;
    opacity: 0;
    transform: scale(0.8);
}

.anim-utxo.input {
    background: var(--card-bg);
    border: 2px solid var(--border);
}

.anim-utxo.input.consuming {
    opacity: 1;
    transform: scale(1);
    animation: consumeUtxo 0.5s ease forwards;
}

@keyframes consumeUtxo {
    0% { opacity: 1; border-color: var(--border); }
    50% { border-color: var(--error); }
    100% { opacity: 0.5; border-color: var(--error); text-decoration: line-through; }
}

.anim-utxo.output {
    background: var(--card-bg);
    border: 2px solid var(--success);
}

.anim-utxo.output.change {
    border-color: var(--warning);
}

.anim-utxo.output.created {
    opacity: 1;
    transform: scale(1);
    animation: createUtxo 0.3s ease;
}

@keyframes createUtxo {
    0% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}

.anim-amount {
    font-weight: 700;
    font-size: 0.9rem;
}

.anim-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.tx-fee-display {
    width: 100%;
    text-align: center;
    margin-top: 1rem;
    padding: 0.5rem;
    font-size: 0.85rem;
    color: var(--warning);
}

/* UTXO 链可视化 */
.utxo-chain {
    padding: 1.5rem;
    background: var(--code-bg);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    overflow-x: auto;
}

.chain-flow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: max-content;
}

.chain-connector {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.chain-tx {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1rem;
    min-width: 180px;
}

.chain-tx-header {
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    text-align: center;
}

.chain-tx-body {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chain-inputs,
.chain-outputs {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.chain-arrow {
    color: var(--text-muted);
}

.chain-utxo {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.chain-utxo.consumed {
    background: #fee2e2;
    color: var(--error);
    text-decoration: line-through;
}

.chain-utxo.sent {
    background: #dbeafe;
    color: #1d4ed8;
}

.chain-utxo.change {
    background: #fef3c7;
    color: #b45309;
}

/* 比较表格 */
.compare-table {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.compare-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--code-bg);
    border-radius: 4px;
    font-size: 0.85rem;
}

.compare-row.header {
    font-weight: 600;
    background: var(--primary);
    color: white;
}

.compare-row span:first-child {
    color: var(--text-muted);
}

/* ==========================================
   UTXO 现金类比样式
   ========================================== */

/* 钱包纸币展示 */
.cash-analogy {
    margin-top: 1.5rem;
}

.analogy-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.analogy-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
}

.wallet-bills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.bill {
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.bill:hover {
    transform: translateY(-2px);
}

.bill-100 { background: linear-gradient(135deg, #fecaca, #fee2e2); color: #991b1b; border: 2px solid #f87171; }
.bill-70 { background: linear-gradient(135deg, #c7d2fe, #e0e7ff); color: #3730a3; border: 2px solid #818cf8; }
.bill-50 { background: linear-gradient(135deg, #bbf7d0, #dcfce7); color: #166534; border: 2px solid #4ade80; }
.bill-30 { background: linear-gradient(135deg, #fef08a, #fef9c3); color: #854d0e; border: 2px solid #facc15; }
.bill-20 { background: linear-gradient(135deg, #bfdbfe, #dbeafe); color: #1e40af; border: 2px solid #60a5fa; }
.bill-10 { background: linear-gradient(135deg, #e9d5ff, #f3e8ff); color: #6b21a8; border: 2px solid #c084fc; }

.bill.selected {
    box-shadow: 0 0 0 3px var(--primary), 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-3px);
}

.bill.recipient { border-style: dashed; }
.bill.change { border-style: dotted; }

.wallet-total {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.95rem;
}

.wallet-total strong {
    font-size: 1.2rem;
    color: var(--primary);
}

.total-note {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* 现金与UTXO对比 */
.analogy-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.comparison-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    min-width: 180px;
    border: 2px solid var(--border);
}

.comparison-item.btc {
    border-color: var(--primary);
    background: rgba(247, 147, 26, 0.05);
}

.comparison-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.comparison-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.comparison-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.comparison-equals {
    font-size: 2rem;
    color: var(--primary);
    font-weight: bold;
}

/* 找零演示 */
.change-demo {
    margin-top: 1rem;
}

.change-scenario {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.scenario-title {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary);
    color: var(--primary);
}

.scenario-steps {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.scenario-step {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius);
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.step-visual {
    margin-bottom: 0.5rem;
}

.step-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.step-desc {
    font-size: 0.9rem;
    line-height: 1.8;
}

.step-desc p {
    margin: 0.25rem 0;
}

.scenario-arrow {
    text-align: center;
    font-size: 1.5rem;
    color: var(--text-muted);
    padding: 0.25rem 0;
}

/* 找零过程可视化 */
.change-process {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.process-input,
.process-output {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.process-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.process-arrow {
    font-size: 1.5rem;
    color: var(--primary);
}

.process-outputs {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* 比特币对应表 */
.btc-equivalent {
    background: rgba(247, 147, 26, 0.05);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.btc-equivalent h4 {
    margin: 0 0 1rem 0;
    color: var(--primary);
}

.equivalent-table {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.equiv-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--card-bg);
    border-radius: 4px;
    font-size: 0.85rem;
    align-items: center;
}

.equiv-row.header {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.equiv-row.highlight {
    background: rgba(247, 147, 26, 0.15);
    border: 1px dashed var(--primary);
}

/* 规则网格 */
.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.rule-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.rule-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.rule-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.rule-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.rule-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.rule-desc strong {
    color: var(--primary);
}

/* 为什么用UTXO */
.why-utxo {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.why-item {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius);
}

.why-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.why-item strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.why-item p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* 钱包密钥显示 */
.wallet-keys {
    background: var(--code-bg);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.key-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    flex-wrap: wrap;
}

.key-row:not(:last-child) {
    border-bottom: 1px dashed var(--border);
}

.key-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 70px;
}

.key-value {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
    background: var(--card-bg);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    word-break: break-all;
}

.key-value.private-key {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

.key-value.public-key {
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
}

.key-value.address {
    color: var(--primary);
    background: rgba(247, 147, 26, 0.1);
}

.key-warning {
    font-size: 0.7rem;
    color: var(--error);
    margin-left: auto;
}

/* 收款信息显示 */
.receive-info {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
    border: 2px solid var(--success);
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 1rem;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.receive-info h4 {
    color: var(--success);
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
}

.receive-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.receive-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.receive-row span {
    color: var(--text-muted);
    min-width: 60px;
}

.receive-row code {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
    background: var(--card-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.receive-row strong {
    color: var(--success);
}

/* 接收地址输入组 */
.recipient-input-group {
    display: flex;
    gap: 0.5rem;
    flex: 1;
}

.recipient-input-group input {
    flex: 1;
    min-width: 0;
}

/* 交易签名显示 */
.tx-signature {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(139, 92, 246, 0.05));
    border: 2px solid #8b5cf6;
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 1rem;
}

.tx-signature h4 {
    color: #8b5cf6;
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
}

.sig-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.sig-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.sig-label {
    color: var(--text-muted);
    min-width: 80px;
}

.sig-value {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.7rem;
    background: var(--card-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    color: #8b5cf6;
}

.sig-note {
    font-size: 0.8rem;
    color: var(--success);
    margin: 0;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border);
}

/* 交易结构说明 */
.tx-structure {
    display: flex;
    align-items: stretch;
    gap: 1rem;
    margin: 1.5rem 0;
}

.structure-side {
    flex: 1;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 2px solid var(--border);
}

.structure-side.inputs {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.05);
}

.structure-side.outputs {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.05);
}

.structure-side h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
}

.structure-side.inputs h4 {
    color: #8b5cf6;
}

.structure-side.outputs h4 {
    color: var(--success);
}

.structure-side ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.structure-side li {
    padding: 0.5rem 0;
    font-size: 0.9rem;
    border-bottom: 1px dashed var(--border);
}

.structure-side li:last-child {
    border-bottom: none;
}

.structure-side li strong {
    color: var(--text);
    display: block;
    margin-bottom: 0.25rem;
}

.structure-arrow {
    display: flex;
    align-items: center;
    font-size: 2rem;
    color: var(--primary);
    font-weight: bold;
}

.structure-rule {
    background: rgba(247, 147, 26, 0.1);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    font-size: 1rem;
}

.structure-rule strong {
    color: var(--primary);
}

@media (max-width: 768px) {
    .tx-structure {
        flex-direction: column;
    }

    .structure-arrow {
        justify-content: center;
        transform: rotate(90deg);
        padding: 0.5rem 0;
    }
}

/* UTXO 响应式 */
@media (max-width: 768px) {
    .tx-builder {
        flex-direction: column;
    }

    .tx-arrow-section {
        transform: rotate(90deg);
        padding: 1rem 0;
    }

    .wallet-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .tx-animation {
        flex-direction: column;
    }

    .tx-anim-center {
        transform: rotate(90deg);
    }

    .key-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .key-warning {
        margin-left: 0;
    }

    .recipient-input-group {
        flex-direction: column;
    }
}

/* ==========================================
   HTLC 页面样式
   ========================================== */

/* 区块模拟器 */
.block-simulator {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.current-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 2px solid var(--primary);
}

.block-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.block-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Monaco', 'Consolas', monospace;
    color: var(--primary);
    transition: all 0.3s;
}

.block-value.block-mined {
    animation: blockMined 0.3s ease;
}

@keyframes blockMined {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); color: var(--success); }
    100% { transform: scale(1); }
}

.highlight-box {
    border: 2px solid var(--primary);
    background: rgba(247, 147, 26, 0.05);
}

/* 参与方卡片 */
.htlc-parties {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.party-card {
    background: var(--code-bg);
    border-radius: var(--radius);
    padding: 1rem;
    border: 2px solid var(--border);
}

.party-card.sender {
    border-color: #8b5cf6;
}

.party-card.receiver {
    border-color: #06b6d4;
}

.party-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.party-icon {
    font-size: 1.2rem;
}

.party-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.party-card.sender .party-name {
    color: #8b5cf6;
}

.party-card.receiver .party-name {
    color: #06b6d4;
}

.party-keys {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.party-keys .key-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.party-keys .key-label {
    color: var(--text-muted);
    min-width: 60px;
}

.party-keys code {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.7rem;
    word-break: break-all;
    background: var(--card-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* 配置面板 */
.config-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.config-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.config-row label {
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 120px;
}

.config-row input {
    flex: 1;
    max-width: 200px;
}

.config-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.config-hint.future {
    color: var(--success);
}

.config-hint.past {
    color: var(--error);
}

/* HTLC 创建步骤 */
.htlc-creation,
.timelock-creation {
    margin-top: 1.5rem;
}

.creation-step {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--code-bg);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.step-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content h4 {
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

/* 哈希锁显示 */
.hash-lock-display {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hash-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hash-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 50px;
}

.hash-row code {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
    word-break: break-all;
    background: var(--card-bg);
    padding: 0.5rem;
    border-radius: 4px;
    flex: 1;
}

.hash-row code.preimage {
    color: var(--warning);
    border: 1px dashed var(--warning);
}

.hash-row code.hash {
    color: var(--primary);
}

.hash-arrow {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 0.25rem 0;
}

/* HTLC 路径显示 */
.htlc-paths-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.htlc-path-box {
    flex: 1;
    max-width: 150px;
    padding: 0.75rem;
    border-radius: var(--radius);
    text-align: center;
}

.htlc-path-box.success {
    background: rgba(34, 197, 94, 0.1);
    border: 2px solid var(--success);
}

.htlc-path-box.refund {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--error);
}

.htlc-path-box .path-title {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.htlc-path-box.success .path-title {
    color: var(--success);
}

.htlc-path-box.refund .path-title {
    color: var(--error);
}

.htlc-path-box .path-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.htlc-or-box {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 0.5rem;
}

/* 脚本显示 */
.script-display {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1rem;
}

.script-visual {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.script-branch {
    padding: 0.5rem;
    border-radius: 4px;
}

.script-branch.success {
    background: rgba(34, 197, 94, 0.1);
    border-left: 3px solid var(--success);
}

.script-branch.refund {
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid var(--error);
}

.branch-content {
    padding-left: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.script-op {
    background: #fee2e2;
    color: #dc2626;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.7rem;
    font-weight: 600;
}

.script-data {
    background: #dbeafe;
    color: #1d4ed8;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.7rem;
}

.script-hex {
    background: var(--code-bg);
    padding: 0.75rem;
    border-radius: 4px;
    overflow-x: auto;
}

.script-hex code {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.65rem;
    word-break: break-all;
    line-height: 1.8;
    color: var(--text-muted);
}

/* 地址显示 */
.address-display {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.address-display .address-value {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 2px solid var(--success);
    text-align: center;
    word-break: break-all;
    color: var(--success);
    font-weight: 600;
}

/* HTLC 状态 */
.htlc-status,
.lock-status {
    padding: 0.75rem;
    border-radius: var(--radius);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.htlc-status.active,
.lock-status.locked {
    background: rgba(247, 147, 26, 0.1);
    border: 1px solid var(--primary);
}

.htlc-status.timeout,
.lock-status.unlocked {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--success);
}

.status-active {
    color: var(--primary);
    font-weight: 600;
}

.status-locked {
    color: var(--primary);
    font-weight: 600;
}

.status-timeout,
.status-unlocked {
    color: var(--success);
    font-weight: 600;
}

.status-detail {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* 路径选择器 */
.path-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.path-option {
    flex: 1;
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.path-option:hover {
    border-color: var(--primary);
}

.path-option.selected {
    border-color: var(--primary);
    background: rgba(247, 147, 26, 0.05);
}

.path-option.success.selected {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.05);
}

.path-option.refund.selected {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.05);
}

.path-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.path-icon {
    font-size: 1.5rem;
}

.path-header .path-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.path-requirement {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.path-condition {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    padding: 0.5rem;
    background: var(--code-bg);
    border-radius: 4px;
}

.path-condition.locked {
    color: var(--error);
}

.path-condition.unlocked {
    color: var(--success);
}

.condition-icon {
    font-size: 1rem;
}

/* 解锁表单 */
.unlock-form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.preimage-hint {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.hint-success {
    color: var(--success);
}

.hint-error {
    color: var(--error);
}

/* 超时状态 */
.timeout-status {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: var(--radius);
}

.timeout-status.locked {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
}

.timeout-status.unlocked {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--success);
}

.timeout-locked,
.timeout-unlocked {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.timeout-icon {
    font-size: 2rem;
}

.timeout-info strong {
    display: block;
    margin-bottom: 0.25rem;
}

.timeout-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* 验证时间线 */
.verify-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.verify-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--code-bg);
    border-radius: var(--radius);
    border-left: 3px solid var(--border);
    animation: stepAppear 0.3s ease;
}

@keyframes stepAppear {
    0% { opacity: 0; transform: translateX(-10px); }
    100% { opacity: 1; transform: translateX(0); }
}

.verify-step.pass {
    border-left-color: var(--success);
    background: rgba(34, 197, 94, 0.05);
}

.verify-step.fail {
    border-left-color: var(--error);
    background: rgba(239, 68, 68, 0.05);
}

.verify-step .step-icon {
    font-size: 1.5rem;
}

.step-detail {
    flex: 1;
}

.step-detail strong {
    display: block;
    margin-bottom: 0.25rem;
}

.step-detail p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.step-detail code {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
    background: var(--card-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* 解锁结果 */
.unlock-result,
.spend-result {
    margin-top: 1.5rem;
}

.result-fail,
.result-success {
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
}

.result-fail {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--error);
}

.result-success {
    background: rgba(34, 197, 94, 0.1);
    border: 2px solid var(--success);
}

.result-success.refund {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
}

.result-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.result-fail h4 {
    color: var(--error);
    margin-bottom: 0.5rem;
}

.result-success h4 {
    color: var(--success);
    margin-bottom: 0.5rem;
}

.result-success.refund h4 {
    color: #3b82f6;
}

.result-hint {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.txid-field {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0;
    padding: 0.75rem;
    background: var(--card-bg);
    border-radius: var(--radius);
}

.txid-field label {
    font-weight: 600;
    font-size: 0.85rem;
}

.txid-field code {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.7rem;
    word-break: break-all;
}

.revealed-preimage {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--card-bg);
    border-radius: var(--radius);
}

.revealed-preimage label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.revealed-preimage code.preimage {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    color: var(--warning);
    font-weight: 600;
}

/* 应用场景网格 */
.usecase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.usecase-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--code-bg);
    border-radius: var(--radius);
}

.usecase-icon {
    font-size: 1.5rem;
}

.usecase-item strong {
    display: block;
    margin-bottom: 0.25rem;
}

.usecase-item p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .htlc-parties {
        grid-template-columns: 1fr;
    }

    .path-selector {
        flex-direction: column;
    }

    .htlc-paths-display {
        flex-direction: column;
    }

    .block-simulator {
        flex-direction: column;
        align-items: stretch;
    }

    .current-block {
        align-self: center;
    }
}

/* ==========================================
   移动端和平板优化
   ========================================== */

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 10px;
    position: relative;
    z-index: 1001;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    margin: 5px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* 移动端遮罩层 */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
}

/* 菜单打开时禁止body滚动 */
body.menu-open {
    overflow: hidden;
}

/* 移动端头部 - 默认隐藏 */
.mobile-header {
    display: none;
}

/* 平板设备 (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .nav {
        width: 200px;
    }

    body {
        margin-left: 200px;
    }

    .nav-group-title {
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
    }

    .nav-group-links a {
        font-size: 0.8rem;
        padding: 0.4rem 1rem 0.4rem 2rem;
    }

    .container {
        padding: 0 1.5rem;
    }

    h1 {
        font-size: 2rem;
    }

    .demo-box {
        padding: 1.5rem;
    }

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

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

/* 移动端 (小于768px) - 增强版 */
@media (max-width: 768px) {
    /* 移动端导航 */
    .mobile-menu-btn {
        display: block;
    }

    .mobile-overlay {
        display: block;
        pointer-events: none;
    }

    .mobile-overlay.active {
        pointer-events: auto;
    }

    .nav {
        position: fixed;
        top: 0;
        left: -280px;
        right: auto;
        bottom: 0;
        width: 280px;
        height: 100vh;
        border-right: 1px solid var(--border);
        border-bottom: none;
        padding: 1rem 0;
        z-index: 100;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .nav.mobile-open {
        left: 0;
    }

    .nav-content {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
    }

    .logo {
        padding: 0.5rem 1.25rem 1rem;
        margin-bottom: 0;
        border-bottom: 1px solid var(--border);
    }

    .nav-home {
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
    }

    .nav-groups {
        display: flex;
        flex-direction: column;
    }

    .nav-group-title {
        padding: 0.75rem 1.25rem;
        font-size: 0.85rem;
    }

    .nav-group-links a {
        padding: 0.6rem 1.25rem 0.6rem 2.5rem;
        font-size: 0.9rem;
    }

    /* 移动端顶部栏 */
    .mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 56px;
        background: var(--card-bg);
        border-bottom: 1px solid var(--border);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 0.5rem;
        z-index: 100;
    }

    .mobile-header .logo {
        border-bottom: none;
        padding: 0 0.5rem;
        font-size: 1rem;
    }

    body {
        margin-left: 0;
        padding-top: 56px;
    }

    /* 内容区域 */
    .container {
        padding: 0 1rem;
    }

    main .section:first-child {
        padding-top: 2rem;
    }

    .section {
        padding: 2rem 0;
    }

    /* 标题优化 */
    h1 {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    .section-desc {
        font-size: 0.9rem;
    }

    /* 页面头部 */
    .page-header {
        flex-direction: row;
        align-items: flex-start;
        gap: 1rem;
    }

    .page-icon {
        font-size: 2rem;
    }

    /* 演示框优化 */
    .demo-box {
        padding: 1.25rem;
        margin: 1rem 0;
    }

    .demo-box h3 {
        font-size: 1rem;
    }

    .demo-desc {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }

    /* 按钮优化 - 更大的触摸目标 */
    .btn {
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
        min-height: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .btn.secondary {
        padding: 0.75rem 1rem;
    }

    .btn-small {
        width: 48px;
        height: 48px;
    }

    /* 输入框优化 */
    input[type="text"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px; /* 防止iOS缩放 */
        padding: 0.875rem;
        min-height: 48px;
    }

    /* 配置面板 */
    .config-panel {
        gap: 0.75rem;
    }

    .config-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .config-row label {
        min-width: auto;
    }

    .config-row input {
        max-width: none;
        width: 100%;
    }

    /* 卡片优化 */
    .card {
        padding: 1.25rem;
        margin: 1rem 0;
    }

    /* 概念网格 */
    .concepts {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .concept {
        padding: 1.25rem;
    }

    /* 密钥对显示 */
    .key-pair {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .key-box {
        padding: 1rem;
    }

    .key-display {
        font-size: 0.65rem;
        line-height: 1.5;
    }

    /* 哈希显示 */
    .hash-display {
        font-size: 0.7rem;
        padding: 0.875rem;
        line-height: 1.6;
    }

    /* 流程步骤 */
    .process-flow {
        flex-direction: column;
        gap: 0.75rem;
    }

    .process-step {
        max-width: 100%;
        min-width: auto;
        padding: 0.875rem;
    }

    .process-arrow {
        transform: rotate(90deg);
        padding: 0.25rem 0;
    }

    /* 参与方卡片 */
    .htlc-parties {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .party-card {
        padding: 1rem;
    }

    .party-keys .key-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .party-keys code {
        width: 100%;
        word-break: break-all;
    }

    /* 路径选择器 */
    .path-selector {
        flex-direction: column;
        gap: 0.75rem;
    }

    .path-option {
        padding: 1rem;
    }

    /* 区块模拟器 */
    .block-simulator {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .block-simulator .btn {
        width: 100%;
    }

    .current-block {
        align-self: stretch;
        text-align: center;
    }

    /* 验证时间线 */
    .verify-timeline {
        gap: 0.5rem;
    }

    .verify-step {
        padding: 0.875rem;
        gap: 0.75rem;
    }

    .verify-step .step-icon {
        font-size: 1.25rem;
    }

    .step-detail strong {
        font-size: 0.9rem;
    }

    .step-detail p {
        font-size: 0.8rem;
    }

    .step-detail code {
        font-size: 0.7rem;
    }

    /* 创建步骤 */
    .creation-step {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }

    .step-badge {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }

    /* 脚本显示 */
    .script-visual {
        gap: 0.375rem;
    }

    .script-op,
    .script-data {
        font-size: 0.65rem;
        padding: 0.125rem 0.3rem;
    }

    .script-hex code {
        font-size: 0.6rem;
    }

    .branch-content {
        padding-left: 0.75rem;
    }

    /* 地址显示 */
    .address-display .address-value {
        font-size: 0.8rem;
        padding: 0.875rem;
    }

    /* HTLC 路径显示 */
    .htlc-paths-display {
        flex-direction: column;
        gap: 0.5rem;
    }

    .htlc-path-box {
        max-width: 100%;
    }

    /* 解锁表单 */
    .unlock-form .form-group {
        margin-bottom: 0.75rem;
    }

    /* 结果显示 */
    .result-fail,
    .result-success {
        padding: 1.25rem;
    }

    .result-icon {
        font-size: 2.5rem;
    }

    .txid-field {
        flex-direction: column;
        gap: 0.5rem;
        text-align: left;
    }

    .txid-field code {
        font-size: 0.65rem;
    }

    /* 应用场景 */
    .usecase-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .usecase-item {
        padding: 1rem;
        gap: 0.75rem;
    }

    .usecase-icon {
        font-size: 1.25rem;
    }

    /* 页面导航 */
    .page-nav {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 2rem;
        padding-top: 1.5rem;
    }

    .page-nav .btn {
        width: 100%;
        text-align: center;
    }

    /* 地址类型选择器 */
    .type-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .type-btn {
        padding: 0.75rem 0.5rem;
    }

    .type-prefix {
        font-size: 0.65rem;
    }

    .type-name {
        font-size: 0.85rem;
    }

    .type-tag {
        font-size: 0.6rem;
    }

    /* 地址类型网格 */
    .address-types-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    /* 地址步骤 */
    .address-step-row {
        padding: 0.875rem;
    }

    .step-value-full {
        font-size: 0.7rem;
        padding: 0.625rem;
    }

    /* UTXO 钱包 */
    .utxo-wallet {
        padding: 1rem;
    }

    .wallet-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .wallet-value {
        font-size: 0.8rem;
        word-break: break-all;
    }

    .utxo-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.875rem;
    }

    .utxo-amount {
        min-width: auto;
    }

    /* 交易构建器 */
    .tx-builder {
        flex-direction: column;
        gap: 0.75rem;
    }

    .tx-section {
        min-width: auto;
        padding: 1rem;
    }

    .tx-arrow-section {
        transform: rotate(90deg);
        padding: 0.5rem 0;
    }

    /* 比较表格 */
    .compare-row {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 0.5rem;
        padding: 0.625rem;
        font-size: 0.75rem;
    }

    /* 区块链 */
    .blockchain {
        padding: 0.75rem 0;
    }

    .chain-block {
        width: 240px;
        padding: 0.875rem;
    }

    .chain-block textarea,
    .chain-block input {
        font-size: 0.75rem;
    }

    /* POW 演示 */
    .pow-stats {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .stat {
        padding: 0.75rem;
    }

    .pow-log {
        padding: 0.75rem;
        max-height: 200px;
    }

    .log-entry {
        grid-template-columns: 60px 1fr 50px;
        gap: 0.5rem;
        font-size: 0.65rem;
        padding: 0.375rem 0;
    }

    .pow-controls {
        flex-direction: column;
        gap: 0.5rem;
    }

    .pow-controls .btn {
        width: 100%;
    }

    /* 共识传播 (旧版样式) */
    .p2p-controls {
        flex-direction: column;
        gap: 0.5rem;
    }

    .p2p-controls .btn {
        width: 100%;
    }

    .network-stats {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    /* 首页摘要流程 */
    .summary-flow {
        flex-direction: column;
        gap: 0.5rem;
    }

    .flow-step {
        width: 100%;
        max-width: none;
        padding: 1rem;
    }

    .flow-arrow {
        transform: rotate(90deg);
    }

    /* 引用 */
    .quote {
        font-size: 1rem;
        padding: 1.5rem;
    }

    /* 页脚 */
    .footer {
        padding: 1.5rem 1rem;
        font-size: 0.8rem;
    }

    /* 多签相关 */
    .keys-grid {
        grid-template-columns: 1fr;
    }

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

    .signing-panel {
        padding: 1rem;
    }

    .signatures-collected {
        padding: 1rem;
    }

    .verify-steps {
        gap: 0.5rem;
    }

    /* 时间锁状态 */
    .timeout-status {
        padding: 0.875rem;
    }

    .timeout-locked,
    .timeout-unlocked {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .timeout-icon {
        font-size: 1.5rem;
    }

    /* 语言按钮移动端位置 */
    .lang-btn {
        position: fixed;
        bottom: 1rem;
        right: 1rem;
        left: auto;
        z-index: 101;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }
}

/* 小屏手机 (小于 375px) */
@media (max-width: 375px) {
    .container {
        padding: 0 0.75rem;
    }

    h1 {
        font-size: 1.3rem;
    }

    .demo-box {
        padding: 1rem;
    }

    .type-buttons {
        grid-template-columns: 1fr 1fr;
    }

    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .page-icon {
        font-size: 1.75rem;
    }

    .hash-display {
        font-size: 0.6rem;
    }

    .compare-row {
        font-size: 0.65rem;
    }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .nav {
        width: 250px;
    }

    main .section:first-child {
        padding-top: 1.5rem;
    }

    .section {
        padding: 1.5rem 0;
    }

    .demo-box {
        margin: 0.75rem 0;
    }

    .mobile-header {
        height: 48px;
    }

    body {
        padding-top: 48px;
    }
}

/* ==========================================
   SHA-256 子页面链接样式
   ========================================== */

.sha256-link-box {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.sha256-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s ease;
}

.sha256-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(247, 147, 26, 0.3);
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.sha256-link .link-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.sha256-link .link-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sha256-link .link-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
}

.sha256-link .link-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.sha256-link .link-arrow {
    font-size: 1.5rem;
    color: var(--primary);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.sha256-link:hover .link-arrow {
    transform: translateX(4px);
}

@media (max-width: 600px) {
    .sha256-link {
        padding: 1rem;
        gap: 0.75rem;
    }

    .sha256-link .link-icon {
        font-size: 1.5rem;
    }

    .sha256-link .link-title {
        font-size: 0.9rem;
    }

    .sha256-link .link-desc {
        font-size: 0.8rem;
    }
}

/* ==========================================
   SHA-256 计算过程可视化样式
   ========================================== */

.sha256-demo {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.sha256-demo h3 {
    margin-bottom: 0.5rem;
    color: var(--text);
}

/* 步骤导航标签 */
.sha256-steps {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.sha256-step-btn {
    padding: 0.6rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
    font-weight: 500;
}

.sha256-step-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.sha256-step-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.sha256-step-btn.completed {
    border-color: var(--success);
    color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.sha256-step-btn.completed::after {
    content: ' ✓';
}

/* 面板动画 */
.sha256-panel {
    background: var(--code-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.panel-header {
    margin-bottom: 1.5rem;
}

.panel-header h4 {
    margin-bottom: 0.5rem;
    color: var(--text);
}

.panel-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* 字节网格 (消息填充可视化) */
.byte-grid {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 3px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.65rem;
    margin-bottom: 1rem;
}

.byte-cell {
    padding: 6px 4px;
    text-align: center;
    border-radius: 3px;
    background: var(--card-bg);
    transition: all 0.3s;
}

.byte-cell.original {
    background: #dbeafe;
    color: #1e40af;
}

.byte-cell.padding-start {
    background: #fef3c7;
    color: #92400e;
    font-weight: 600;
}

.byte-cell.padding {
    background: #fef9c3;
    color: #a16207;
}

.byte-cell.length {
    background: #d1fae5;
    color: #065f46;
}

/* 填充图例 */
.padding-legend {
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
}

.padding-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.legend-color.original {
    background: #dbeafe;
}

.legend-color.padding-start {
    background: #fef3c7;
}

.legend-color.length {
    background: #d1fae5;
}

.padding-total {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
}

/* W 数组网格 */
.w-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    margin-bottom: 1rem;
}

.w-cell {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.6rem;
    padding: 8px 4px;
    background: var(--card-bg);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    border: 2px solid transparent;
}

.w-cell:hover {
    border-color: var(--primary);
}

.w-cell.computed {
    background: #fef3c7;
}

.w-cell.highlight {
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(247, 147, 26, 0.4);
    transform: scale(1.05);
}

.w-cell.dependency {
    border-color: var(--success);
    background: #d1fae5;
}

.w-index {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.w-value {
    font-size: 0.55rem;
    color: var(--text);
    word-break: break-all;
}

/* W 计算详情 */
.w-detail {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1rem;
    min-height: 100px;
}

.w-detail-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
}

.w-detail-title {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary);
}

.w-detail-content {
    font-size: 0.85rem;
}

.w-formula {
    font-family: 'Monaco', 'Consolas', monospace;
    color: var(--text-muted);
}

.w-result {
    font-family: 'Monaco', 'Consolas', monospace;
    font-weight: 600;
    color: var(--success);
    margin-top: 0.5rem;
}

.w-formula-section {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--code-bg);
    border-radius: 4px;
}

.formula-label {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.formula-detail {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.formula-detail strong {
    color: var(--success);
}

/* 轮次控制器 */
.round-controls {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
}

.round-controls-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.round-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.round-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.round-btn.play-btn {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.round-btn.play-btn:hover {
    background: var(--primary-dark);
}

.round-indicator {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0 0.5rem;
    margin-left: auto;
}

.round-indicator #current-round {
    color: var(--primary);
    font-size: 1.1rem;
}

/* 轮次进度条 */
.round-progress-container {
    position: relative;
    width: 100%;
    height: 24px;
    background: var(--bg-alt);
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
}

.round-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width 0.15s ease, background 0.3s ease;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
}

.round-progress-bar.phase-1 {
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
}

.round-progress-bar.phase-2 {
    background: linear-gradient(90deg, #06b6d4, #10b981);
}

.round-progress-bar.phase-3 {
    background: linear-gradient(90deg, #10b981, #f59e0b);
}

.round-progress-bar.phase-4 {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.round-progress-marks {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    pointer-events: none;
}

.round-mark {
    flex: 1;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    position: relative;
}

.round-mark:last-child {
    border-right: none;
}

.round-mark.major::after {
    content: attr(data-round);
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    color: var(--text-muted);
}

.round-progress-container:hover .round-progress-bar {
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

/* 工作变量显示 */
.working-vars {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    margin-bottom: 1rem;
}

.var-box {
    text-align: center;
    padding: 0.75rem 0.5rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 2px solid var(--border);
    transition: all 0.3s;
}

.var-box .var-name {
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.var-box .var-value {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.6rem;
    color: var(--primary);
    word-break: break-all;
}

.var-box.changed {
    border-color: var(--success);
    animation: varPulse 0.35s ease;
}

.var-box.changed .var-value {
    animation: valueFlash 0.35s ease;
}

@keyframes varPulse {
    0% { transform: scale(1); background: var(--card-bg); box-shadow: none; }
    50% { transform: scale(1.08); background: #d1fae5; box-shadow: 0 0 12px rgba(34, 197, 94, 0.5); }
    100% { transform: scale(1); background: var(--card-bg); box-shadow: none; }
}

@keyframes valueFlash {
    0% { color: var(--primary); }
    50% { color: var(--success); font-weight: 700; }
    100% { color: var(--primary); }
}

/* 轮次操作显示 */
.round-operations {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1rem;
}

.round-info {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.round-label {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.ops-list {
    margin-bottom: 1rem;
}

.op-line {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.25rem;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
    transition: background 0.2s;
}

.op-line:hover {
    background: var(--code-bg);
}

.op-name {
    color: var(--primary);
    min-width: 90px;
    font-weight: 600;
}

.op-formula {
    color: var(--text-muted);
    flex: 1;
    font-size: 0.7rem;
}

.op-result {
    color: var(--success);
    font-weight: bold;
    min-width: 75px;
    text-align: right;
}

.round-update {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.update-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.update-detail {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.8;
}

/* 最终哈希显示 */
.final-addition {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.final-additions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.final-add-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
    padding: 0.5rem;
    background: var(--code-bg);
    border-radius: 4px;
    flex-wrap: wrap;
}

.add-label {
    font-weight: 600;
    color: var(--text);
    min-width: 20px;
}

.add-value {
    color: var(--text-muted);
}

.add-op {
    color: var(--primary);
    font-weight: bold;
}

.add-result {
    color: var(--success);
    font-weight: bold;
}

.final-hash {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
}

.final-hash-value {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 1rem;
    color: var(--success);
    font-weight: 600;
    word-break: break-all;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--code-bg);
    border-radius: var(--radius);
    border: 2px solid var(--success);
}

.final-hash-parts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.hash-part {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    background: var(--code-bg);
    border-radius: 4px;
}

/* SHA-256 响应式 */
@media (max-width: 768px) {
    .sha256-steps {
        flex-direction: column;
    }

    .sha256-step-btn {
        width: 100%;
        text-align: center;
    }

    .byte-grid {
        grid-template-columns: repeat(8, 1fr);
        font-size: 0.55rem;
    }

    .byte-cell {
        padding: 4px 2px;
    }

    .w-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .w-cell {
        padding: 6px 2px;
    }

    .w-value {
        font-size: 0.5rem;
    }

    .working-vars {
        grid-template-columns: repeat(4, 1fr);
    }

    .var-box .var-value {
        font-size: 0.5rem;
    }

    .round-controls-top {
        justify-content: center;
    }

    .round-progress-container {
        height: 20px;
    }

    .round-mark.major::after {
        font-size: 0.5rem;
        bottom: -16px;
    }

    .op-line {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .op-formula {
        font-size: 0.65rem;
    }

    .op-result {
        text-align: left;
    }

    .final-add-row {
        font-size: 0.65rem;
    }

    .final-hash-value {
        font-size: 0.75rem;
    }

    .hash-part {
        font-size: 0.6rem;
    }
}

/* ==========================================
   SHA-256 电路图样式
   ========================================== */

.sha256-circuit {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 2px solid var(--border);
}

.circuit-title {
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.circuit-overview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.circuit-stage {
    width: 100%;
    max-width: 400px;
}

.circuit-arrow {
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: bold;
}

.stage-label {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stage-box {
    background: var(--code-bg);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    border: 2px solid var(--border);
    transition: all 0.3s;
}

.stage-box:hover {
    border-color: var(--primary);
}

.input-box, .output-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #dbeafe 0%, #e0f2fe 100%);
    border-color: #3b82f6;
}

.output-box {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: var(--success);
}

.box-icon {
    font-size: 1.5rem;
}

.box-text {
    font-weight: 600;
    font-size: 1rem;
}

.process-box {
    padding: 0.75rem 1rem;
}

.box-header {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.box-content {
    margin-bottom: 0.5rem;
}

.box-content code {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--card-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.box-output {
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 500;
}

/* 消息调度分支 */
.schedule-split {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.schedule-part {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    background: var(--card-bg);
    border-radius: 4px;
    min-width: 80px;
}

.part-label {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
}

.part-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* 压缩函数电路 */
.compress-box {
    padding: 1rem;
}

.compress-circuit {
    margin-top: 0.75rem;
}

.compress-init {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: var(--card-bg);
    border-radius: 4px;
}

.init-label {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.init-arrow {
    color: var(--primary);
    font-weight: bold;
}

.var-group {
    display: flex;
    gap: 0.25rem;
}

.var-chip {
    display: inline-block;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    background: var(--primary);
    color: white;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* 单轮运算图 */
.round-circuit {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1rem;
    border: 1px dashed var(--border);
}

.round-label {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.round-diagram {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.branch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
}

.func-box {
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: 'Monaco', 'Consolas', monospace;
}

.func-box.sigma {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #3b82f6;
}

.func-box.ch {
    background: #fce7f3;
    color: #be185d;
    border: 1px solid #ec4899;
}

.func-box.maj {
    background: #f3e8ff;
    color: #7c3aed;
    border: 1px solid #a78bfa;
}

.func-box.add, .func-box.add-multi {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.branch-arrow {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.branch-result {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--success);
    padding: 0.2rem 0.5rem;
    background: #d1fae5;
    border-radius: 4px;
}

/* 移位指示 */
.shift-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.shift-arrows {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.6rem;
    color: var(--text-muted);
    font-family: 'Monaco', 'Consolas', monospace;
}

/* 更新公式 */
.update-formulas {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border);
}

.update-formulas .formula {
    font-size: 0.7rem;
    font-family: 'Monaco', 'Consolas', monospace;
    color: var(--text-muted);
}

.update-formulas .formula .var {
    color: var(--primary);
    font-weight: 600;
}

/* 循环指示器 */
.loop-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: rgba(247, 147, 26, 0.1);
    border-radius: 4px;
}

.loop-icon {
    font-size: 1rem;
}

.loop-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
}

/* 最终输出 */
.output-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.output-display {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-family: 'Monaco', 'Consolas', monospace;
}

.hash-segment {
    padding: 0.25rem 0.5rem;
    background: var(--code-bg);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 500;
}

.hash-concat {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* 图例 */
.circuit-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-symbol {
    transform: scale(0.9);
}

.legend-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.const-chip {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: #e0e7ff;
    color: #3730a3;
    border: 1px solid #6366f1;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: 'Monaco', 'Consolas', monospace;
}

/* 电路图响应式 */
@media (max-width: 768px) {
    .sha256-circuit {
        padding: 1rem;
    }

    .circuit-stage {
        max-width: 100%;
    }

    .var-chip {
        width: 18px;
        height: 18px;
        line-height: 18px;
        font-size: 0.6rem;
    }

    .round-diagram {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .branch {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .branch-arrow {
        display: none;
    }

    .shift-indicator {
        padding: 0.25rem;
    }

    .update-formulas {
        flex-direction: column;
        gap: 0.5rem;
    }

    .circuit-legend {
        gap: 0.5rem;
    }

    .legend-item {
        flex-basis: 45%;
    }

    .schedule-split {
        flex-direction: column;
        gap: 0.5rem;
    }

    .output-display {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ==========================================
   SHA-256 动画效果
   ========================================== */

/* 淡入动画 */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 面板进入动画 */
.panel-animate-in {
    animation: panelSlideIn 0.4s ease forwards;
}

@keyframes panelSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 电路图阶段高亮 */
.circuit-stage.active-stage {
    position: relative;
}

.circuit-stage.active-stage::before {
    content: '';
    position: absolute;
    inset: -8px;
    border: 3px solid var(--primary);
    border-radius: 12px;
    animation: stagePulse 1.5s ease-in-out infinite;
    pointer-events: none;
}

.stage-box.active-box {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(247, 147, 26, 0.4);
    border-color: var(--primary) !important;
}

@keyframes stagePulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.02);
    }
}

/* 最终哈希揭示动画 */
.final-hash-value.hash-reveal {
    animation: hashReveal 0.8s ease forwards;
}

@keyframes hashReveal {
    from {
        opacity: 0;
        letter-spacing: 0.5em;
        filter: blur(4px);
    }
    to {
        opacity: 1;
        letter-spacing: normal;
        filter: blur(0);
    }
}

.final-hash-parts .hash-part {
    opacity: 0;
    animation: partFadeIn 0.3s ease forwards;
}

@keyframes partFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 输入框样式 */
.sha256-input-box textarea {
    min-height: 60px;
    resize: vertical;
}

/* ==========================================
   ECDSA 数字签名可视化
   ========================================== */

.ecdsa-demo {
    margin-top: 2rem;
}

/* ECDSA 算法结构图 */
.ecdsa-circuit {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.circuit-title {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1.5rem;
}

/* 曲线参数 */
.curve-params {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.param-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.param-equation {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.param-list {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.param-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.param-name {
    font-family: 'Monaco', 'Consolas', monospace;
    font-weight: 700;
    color: var(--primary);
    font-size: 1rem;
}

.param-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* 三列布局 */
.ecdsa-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.ecdsa-column {
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    transition: all 0.3s ease;
}

.ecdsa-column.active-column {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(247, 147, 26, 0.2);
    transform: translateY(-2px);
}

.column-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.75rem;
}

.column-icon {
    font-size: 1.2rem;
}

.column-title {
    font-weight: 700;
    color: var(--text);
}

.column-steps {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.math-step {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-alt);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.math-step.active {
    background: rgba(247, 147, 26, 0.15);
    border-left: 3px solid var(--primary);
}

.step-num {
    width: 20px;
    height: 20px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-formula {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.8rem;
    color: var(--text);
    margin-bottom: 0.2rem;
}

.step-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.step-arrow {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 0.2rem 0;
}

.step-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    border: 1px solid var(--success);
    border-radius: 6px;
}

.result-label {
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 600;
}

.result-value {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
    color: var(--text);
}

/* ECDSA 输入控制 */
.ecdsa-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.ecdsa-message-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 200px;
}

.ecdsa-message-input label {
    font-size: 0.85rem;
    color: var(--text);
    white-space: nowrap;
}

.ecdsa-message-input input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

/* ECDSA 步骤导航 */
.ecdsa-steps {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.ecdsa-step-btn {
    padding: 0.6rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    color: var(--text);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.ecdsa-step-btn:hover {
    border-color: var(--primary);
    background: rgba(247, 147, 26, 0.05);
}

.ecdsa-step-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

/* ECDSA 面板 */
.ecdsa-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.panel-header {
    margin-bottom: 1.5rem;
}

.panel-header h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text);
}

.panel-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

/* 数学公式显示 */
.math-display {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.math-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-alt);
    border-radius: 6px;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.math-row.active {
    background: rgba(247, 147, 26, 0.1);
    border-left-color: var(--primary);
}

.math-row.result-row {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    border-left-color: var(--success);
}

.math-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 140px;
    flex-shrink: 0;
}

.math-value {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
    color: var(--text);
    word-break: break-all;
    flex: 1;
}

.math-value.hash-value {
    color: var(--primary);
}

.coord-value {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.coord-value div {
    font-size: 0.7rem;
}

.math-operation {
    text-align: center;
    padding: 0.5rem;
}

.op-formula {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 600;
}

.op-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* 签名结果 */
.signature-result {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(247, 147, 26, 0.1), rgba(247, 147, 26, 0.05));
    border: 2px solid var(--primary);
    border-radius: var(--radius);
}

.sig-label {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.sig-values {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sig-component {
    display: flex;
    gap: 0.5rem;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
}

.sig-name {
    color: var(--text-muted);
    font-weight: 600;
}

.sig-value {
    color: var(--text);
    word-break: break-all;
}

/* 验证比较 */
.verify-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-alt);
    border-radius: var(--radius);
    margin-top: 0.75rem;
}

.compare-item {
    text-align: center;
}

.compare-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.compare-value {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.7rem;
    color: var(--text);
    word-break: break-all;
    max-width: 150px;
}

.compare-icon {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.compare-icon.match {
    color: var(--success);
}

.compare-icon.mismatch {
    color: var(--error);
}

/* 验证结果 */
.verify-result-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    margin-top: 1rem;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.3s ease;
}

.verify-result-box.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
}

.verify-result-box.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
}

.verify-icon {
    font-size: 1.5rem;
}

.verify-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

/* ECDSA 响应式 */
@media (max-width: 1024px) {
    .ecdsa-columns {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .ecdsa-circuit {
        padding: 1rem;
    }

    .param-list {
        gap: 1rem;
    }

    .ecdsa-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .ecdsa-message-input {
        flex-direction: column;
        align-items: stretch;
    }

    .ecdsa-message-input label {
        margin-bottom: 0.25rem;
    }

    .ecdsa-steps {
        flex-direction: column;
    }

    .ecdsa-step-btn {
        width: 100%;
        text-align: center;
    }

    .math-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .math-label {
        min-width: auto;
    }

    .verify-comparison {
        flex-direction: column;
        gap: 0.75rem;
    }

    .compare-value {
        max-width: 100%;
    }
}

/* ==========================================
   Hash Features Interactive Demos
   ========================================== */

.hash-features-section {
    margin-top: 3rem;
}

.hash-features-section h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.feature-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(247, 147, 26, 0.1);
}

.feature-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.feature-icon {
    font-size: 2rem;
    line-height: 1;
}

.feature-title {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.feature-title strong {
    font-size: 1.25rem;
    color: var(--text);
}

.feature-title span {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.feature-demo {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.demo-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.demo-controls .btn.small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.demo-count, .demo-result {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.demo-result.success {
    color: var(--success);
    font-weight: 600;
}

.demo-result.fail {
    color: var(--danger);
}

/* Demo: Deterministic */
.demo-deterministic {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.demo-input-box, .demo-hash-box {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 2px solid var(--border);
    min-width: 150px;
}

.demo-hash-box {
    flex: 1;
    min-width: 250px;
}

.demo-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.demo-value {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 1rem;
    word-break: break-all;
}

.demo-value.hash-value {
    font-size: 0.75rem;
    color: var(--primary);
}

.demo-arrow {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: bold;
}

/* Demo: Fast */
.demo-fast {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fast-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-value {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.fast-display {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.8rem;
    overflow: hidden;
}

.fast-input {
    color: var(--text-muted);
}

.fast-output {
    color: var(--primary);
    word-break: break-all;
}

/* Demo: One-way */
.demo-oneway {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.oneway-forward, .oneway-reverse {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.oneway-box {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 2px solid var(--border);
    min-width: 120px;
    flex: 1;
}

.oneway-box.input-side {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.oneway-box.output-side {
    border-color: var(--primary);
    background: rgba(247, 147, 26, 0.05);
}

.oneway-box.unknown {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

.oneway-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.oneway-value {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.9rem;
    word-break: break-all;
}

.oneway-arrow {
    font-size: 2rem;
    color: var(--success);
    font-weight: bold;
}

.oneway-arrow.reverse {
    position: relative;
    color: var(--danger);
}

.oneway-arrow .arrow-x {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    color: var(--danger);
    z-index: 1;
}

.oneway-arrow .arrow-line {
    opacity: 0.3;
}

/* Demo: Avalanche */
.demo-avalanche {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.avalanche-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avalanche-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 200px;
}

.avalanche-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    min-width: 40px;
}

.avalanche-text {
    padding: 0.5rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.9rem;
    background: var(--card-bg);
    width: 120px;
}

.avalanche-text:focus {
    border-color: var(--primary);
    outline: none;
}

.avalanche-output {
    flex: 1;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.7rem;
    color: var(--primary);
    word-break: break-all;
    padding: 0.5rem;
    background: var(--card-bg);
    border-radius: var(--radius);
}

.avalanche-stats {
    display: flex;
    gap: 2rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    flex-wrap: wrap;
}

.avalanche-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.avalanche-stat.highlight .stat-value {
    color: var(--danger);
    font-size: 1.25rem;
}

.avalanche-visual {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 0.5rem;
    background: var(--card-bg);
    border-radius: var(--radius);
}

.avalanche-bit {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.avalanche-bit.same {
    background: var(--success);
}

.avalanche-bit.diff {
    background: var(--danger);
    animation: bitPulse 0.5s ease;
}

@keyframes bitPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* Demo: Collision */
.demo-collision {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.collision-target {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 2px solid var(--primary);
}

.collision-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.collision-value {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary);
}

.collision-search {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-item {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--card-bg);
    border-radius: var(--radius);
}

.search-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.search-value {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.8rem;
    word-break: break-all;
}

.collision-stats {
    display: flex;
    gap: 2rem;
}

.collision-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 0.75rem;
    background: rgba(247, 147, 26, 0.05);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
}

/* Hash features responsive */
@media (max-width: 768px) {
    .feature-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .demo-deterministic {
        flex-direction: column;
        align-items: stretch;
    }

    .demo-arrow {
        transform: rotate(90deg);
        text-align: center;
    }

    .demo-input-box, .demo-hash-box {
        min-width: auto;
    }

    .fast-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .oneway-forward, .oneway-reverse {
        flex-direction: column;
    }

    .oneway-arrow {
        transform: rotate(90deg);
    }

    .avalanche-row {
        flex-direction: column;
        align-items: stretch;
    }

    .avalanche-input {
        min-width: auto;
    }

    .avalanche-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .collision-search {
        flex-direction: column;
    }

    .collision-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .demo-controls {
        flex-wrap: wrap;
    }
}

/* ==========================================
   Bitcoin History Timeline
   ========================================== */

.history-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.history-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.timeline-container {
    overflow-x: auto;
    padding: 1rem 0 2rem;
    margin: 0 -1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--border);
}

.timeline-container::-webkit-scrollbar {
    height: 8px;
}

.timeline-container::-webkit-scrollbar-track {
    background: var(--border);
    border-radius: 4px;
}

.timeline-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.timeline {
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding: 0 2rem;
    position: relative;
    min-width: max-content;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 2rem;
    right: 2rem;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 2px;
}

.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
    padding: 0 0.5rem;
    position: relative;
    cursor: default;
    transition: transform 0.2s ease;
}

.timeline-item:not(:last-child)::after {
    content: '→';
    position: absolute;
    top: 0px;
    right: -8px;
    font-size: 1rem;
    color: var(--primary);
    font-weight: bold;
    z-index: 2;
}

.timeline-item:hover {
    transform: translateY(-4px);
}

.timeline-dot {
    width: 16px;
    height: 16px;
    background: var(--primary);
    border: 3px solid var(--bg);
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--primary);
    z-index: 1;
    transition: all 0.2s ease;
}

.timeline-item:hover .timeline-dot {
    transform: scale(1.3);
    box-shadow: 0 0 0 4px var(--primary), 0 0 20px rgba(247, 147, 26, 0.4);
}

.timeline-date {
    margin-top: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    font-family: 'SF Mono', Monaco, monospace;
    white-space: nowrap;
}

.timeline-emoji {
    font-size: 1.75rem;
    margin: 0.5rem 0;
    line-height: 1;
}

.timeline-event {
    font-size: 0.8rem;
    color: var(--text);
    text-align: center;
    line-height: 1.3;
    max-width: 110px;
}

/* Timeline responsive */
@media (max-width: 768px) {
    .timeline-container {
        margin: 0 -1.5rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .timeline {
        padding: 0 1rem;
    }

    .timeline-item {
        min-width: 100px;
    }

    .timeline-emoji {
        font-size: 1.5rem;
    }

    .timeline-event {
        font-size: 0.7rem;
        max-width: 90px;
    }

    .timeline-date {
        font-size: 0.65rem;
    }
}

/* ==========================================
   Merkle Tree Visualization
   ========================================== */

.merkle-build-demo {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.merkle-input-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tx-count-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.tx-count-selector select {
    padding: 0.6rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    font-size: 0.95rem;
    cursor: pointer;
    min-width: 160px;
}

.tx-count-selector select:focus {
    border-color: var(--primary);
    outline: none;
}

.tx-preview {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    border: 1px dashed var(--border);
}

.merkle-tree-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    min-height: 200px;
    overflow-x: auto;
}

.merkle-placeholder,
.proof-placeholder {
    color: var(--text-muted);
    text-align: center;
    padding: 3rem 1rem;
}

.merkle-tree-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
}

.merkle-level {
    display: flex;
    justify-content: center;
    gap: 0;
}

.merkle-node-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 0.5rem;
}

.connector-up {
    width: 2px;
    height: 20px;
    background: var(--primary);
}

.connector-down {
    display: flex;
    justify-content: center;
    width: 100%;
    height: 20px;
    position: relative;
}

.branch {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    border-top: 2px solid var(--primary);
}

.branch-left {
    left: 0;
    border-right: 2px solid var(--primary);
    border-top-right-radius: 8px;
}

.branch-right {
    right: 0;
    border-left: 2px solid var(--primary);
    border-top-left-radius: 8px;
}

.merkle-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    min-width: 70px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.merkle-node.root-node {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.merkle-node.root-node .node-hash {
    color: rgba(255, 255, 255, 0.9);
}

.merkle-node.leaf-node {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
}

.merkle-node.proof-target {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.merkle-node.proof-sibling {
    background: rgba(251, 191, 36, 0.2);
    border-color: #fbbf24;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

.merkle-node.in-proof {
    box-shadow: 0 0 12px rgba(247, 147, 26, 0.5);
}

.node-label {
    font-size: 0.75rem;
    font-weight: 600;
}

.node-hash {
    font-size: 0.6rem;
    font-family: 'SF Mono', Monaco, monospace;
    color: var(--text-muted);
}

.merkle-formula {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius);
    text-align: center;
}

.formula-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.85rem;
}

.formula-label {
    color: var(--primary);
    font-weight: bold;
}

.formula-eq {
    color: var(--text-muted);
}

.formula-fn {
    color: var(--text-muted);
}

.formula-child {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.formula-child.left-child {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.formula-child.right-child {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.formula-concat {
    color: var(--text-muted);
    font-weight: bold;
}

.merkle-steps {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.merkle-steps h4 {
    margin-bottom: 1rem;
}

.step-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: var(--card-bg);
    border-radius: var(--radius);
}

.step-num {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Merkle Verify Demo */
.merkle-verify-demo {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.verify-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.verify-controls select {
    padding: 0.5rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    min-width: 200px;
}

.proof-visualization {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1rem;
    min-height: 100px;
}

.proof-details {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid var(--border);
}

.proof-details h4 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.proof-path {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.proof-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.8rem;
}

.proof-step.proof-start {
    border-left: 3px solid #3b82f6;
}

.proof-step.proof-end {
    border-left: 3px solid var(--primary);
    background: rgba(247, 147, 26, 0.1);
}

.step-label {
    color: var(--text-muted);
    min-width: 70px;
}

.step-value {
    font-weight: bold;
    color: var(--text);
}

.step-hash {
    color: var(--primary);
}

.calc-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.calc-step {
    padding: 0.75rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.75rem;
}

.calc-formula {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
}

.calc-fn {
    color: var(--text-muted);
}

.calc-left.sibling,
.calc-right.sibling {
    color: #fbbf24;
}

.calc-left.current,
.calc-right.current {
    color: #3b82f6;
}

.calc-concat {
    color: var(--text-muted);
}

.calc-result {
    margin-top: 0.5rem;
    color: var(--success);
    font-weight: bold;
}

/* Merkle Benefits */
.merkle-benefits {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.merkle-benefits h4 {
    margin-bottom: 1rem;
}

.benefit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.benefit-icon {
    font-size: 1.5rem;
}

.benefit-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.benefit-content strong {
    font-size: 0.9rem;
}

.benefit-content span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Complexity Table */
.complexity-table {
    overflow-x: auto;
}

.complexity-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.complexity-table th,
.complexity-table td {
    padding: 0.75rem 1rem;
    text-align: center;
    border: 1px solid var(--border);
}

.complexity-table th {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.complexity-table tr:nth-child(even) {
    background: var(--card-bg);
}

.complexity-table td:last-child {
    color: var(--success);
    font-weight: bold;
}

.table-note {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Merkle responsive */
@media (max-width: 768px) {
    .merkle-tree-container {
        overflow-x: auto;
    }

    .merkle-tree-wrapper {
        min-width: max-content;
        padding: 0.5rem;
    }

    .merkle-node-wrapper {
        padding: 0 0.25rem;
    }

    .merkle-node {
        min-width: 55px;
        padding: 0.35rem 0.4rem;
    }

    .node-label {
        font-size: 0.65rem;
    }

    .node-hash {
        font-size: 0.5rem;
    }

    .connector-up,
    .connector-down {
        height: 15px;
    }

    .verify-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .verify-controls select {
        min-width: auto;
    }

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

    .calc-formula {
        font-size: 0.65rem;
    }

    .formula-item {
        font-size: 0.75rem;
    }
}

/* ==========================================
   Merkle Tree SVG Visualization
   ========================================== */

.merkle-svg {
    display: block;
    margin: 0 auto;
}

.merkle-lines {
    pointer-events: none;
}

.tree-line {
    stroke: var(--primary);
    stroke-width: 2;
    stroke-linecap: round;
    transition: opacity 0.3s ease, stroke 0.3s ease;
}

.tree-line.proof-line {
    stroke: #3b82f6;
    stroke-width: 3;
}

.merkle-node-group {
    transition: opacity 0.3s ease;
}

.node-rect {
    fill: var(--bg);
    stroke: var(--border);
    stroke-width: 2;
    transition: all 0.3s ease;
}

.node-rect.leaf {
    fill: rgba(16, 185, 129, 0.15);
    stroke: var(--success);
}

.node-rect.root {
    fill: var(--primary);
    stroke: var(--primary);
}

.node-label {
    fill: var(--text);
    font-size: 10px;
    font-weight: 600;
    text-anchor: middle;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.node-rect.root + .node-label,
.node-rect.root ~ .node-label {
    fill: white;
}

.node-hash {
    fill: var(--text-muted);
    font-size: 8px;
    text-anchor: middle;
    font-family: 'SF Mono', Monaco, monospace;
}

.node-rect.root + .node-label + .node-hash,
.node-rect.root ~ .node-hash {
    fill: rgba(255, 255, 255, 0.85);
}

/* SVG Animation Highlights */
.node-rect.highlight-left {
    fill: rgba(59, 130, 246, 0.3);
    stroke: #3b82f6;
    stroke-width: 3;
}

.node-rect.highlight-right {
    fill: rgba(251, 191, 36, 0.3);
    stroke: #fbbf24;
    stroke-width: 3;
}

.node-rect.new-node {
    fill: rgba(247, 147, 26, 0.3);
    stroke: var(--primary);
    stroke-width: 3;
    animation: nodeAppear 0.4s ease;
}

@keyframes nodeAppear {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Duplicate Node Styles */
.node-rect.duplicate {
    fill: rgba(156, 163, 175, 0.2);
    stroke: #9ca3af;
    stroke-width: 2;
    stroke-dasharray: 6 3;
}

.node-rect.new-duplicate {
    fill: rgba(156, 163, 175, 0.35);
    stroke: #6b7280;
    stroke-width: 3;
    stroke-dasharray: 6 3;
    animation: duplicateAppear 0.5s ease;
}

.duplicate-label {
    fill: #6b7280 !important;
    font-style: italic;
}

@keyframes duplicateAppear {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    60% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Duplicate Calculation Display */
.calc-duplicate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    flex-wrap: wrap;
}

.duplicate-source,
.duplicate-target {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.source-label,
.target-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.source-hash {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.8rem;
    color: #3b82f6;
    padding: 0.35rem 0.6rem;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 4px;
}

.target-hash {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.8rem;
    color: #6b7280;
    padding: 0.35rem 0.6rem;
    background: rgba(156, 163, 175, 0.2);
    border-radius: 4px;
    border: 1px dashed #9ca3af;
}

.duplicate-arrow {
    font-size: 1.25rem;
    color: var(--text-muted);
}

.child-hash.duplicate {
    background: rgba(156, 163, 175, 0.2) !important;
    color: #6b7280 !important;
    border: 1px dashed #9ca3af;
}

/* SVG Proof Highlighting */
.node-rect.proof-target {
    fill: rgba(59, 130, 246, 0.25);
    stroke: #3b82f6;
    stroke-width: 3;
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5));
}

.node-rect.proof-sibling {
    fill: rgba(251, 191, 36, 0.25);
    stroke: #fbbf24;
    stroke-width: 3;
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.5));
}

.node-rect.proof-path {
    filter: drop-shadow(0 0 10px rgba(247, 147, 26, 0.6));
}

/* Calculation Display */
.merkle-calc-display {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    min-height: 80px;
}

.calc-step-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.calc-step-num {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.calc-step-desc {
    color: var(--text);
    font-size: 0.9rem;
}

.calc-formula-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.calc-item {
    background: var(--card-bg);
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.75rem;
}

.calc-input {
    color: var(--success);
    font-weight: 600;
}

.calc-output {
    color: var(--primary);
}

.calc-combine {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--card-bg);
    border-radius: var(--radius);
}

.calc-children {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.8rem;
}

.child-hash {
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
}

.child-hash.left {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.child-hash.right {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.calc-plus {
    color: var(--text-muted);
    font-weight: bold;
}

.calc-arrow {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.parent-hash {
    color: var(--primary);
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.9rem;
    font-weight: 600;
}

.calc-complete {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--success);
    font-weight: 600;
}

.calc-complete code {
    background: var(--card-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    color: var(--primary);
}

/* Proof Verification Styles */
.calc-verify-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.verify-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.75rem;
    background: var(--card-bg);
    border-radius: var(--radius);
}

.verify-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.8rem;
}

.hash-box {
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
}

.hash-box.current {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.hash-box.sibling {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.hash-plus {
    color: var(--text-muted);
    font-weight: bold;
}

.verify-arrow {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.verify-result {
    font-family: 'SF Mono', Monaco, monospace;
    color: var(--primary);
    font-weight: 600;
}

.verify-final {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    text-align: center;
    font-weight: 600;
}

.verify-final.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid var(--success);
}

.verify-final.fail {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid #ef4444;
}

/* ==========================================
   Verification Animation Styles
   ========================================== */

/* SVG Node Highlights for Verification */
.node-rect.verify-current {
    fill: rgba(59, 130, 246, 0.35);
    stroke: #3b82f6;
    stroke-width: 3;
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5));
    animation: verifyPulse 1s ease infinite;
}

.node-rect.verify-sibling {
    fill: rgba(251, 191, 36, 0.35);
    stroke: #fbbf24;
    stroke-width: 3;
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.5));
}

.node-rect.verify-result {
    fill: rgba(16, 185, 129, 0.25);
    stroke: var(--success);
    stroke-width: 3;
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.5));
}

.node-rect.verify-success {
    fill: rgba(16, 185, 129, 0.4);
    stroke: var(--success);
    stroke-width: 4;
    filter: drop-shadow(0 0 12px rgba(16, 185, 129, 0.6));
    animation: successPulse 0.6s ease;
}

.node-rect.verify-fail {
    fill: rgba(239, 68, 68, 0.4);
    stroke: #ef4444;
    stroke-width: 4;
    filter: drop-shadow(0 0 12px rgba(239, 68, 68, 0.6));
}

.tree-line.verify-line {
    stroke: var(--success);
    stroke-width: 3;
    filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.5));
}

@keyframes verifyPulse {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.5)); }
    50% { filter: drop-shadow(0 0 16px rgba(59, 130, 246, 0.8)); }
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Nodes not in verification path */
.node-rect.not-in-path {
    fill: var(--bg) !important;
    stroke: var(--border) !important;
    stroke-width: 1 !important;
    opacity: 0.4;
}

.tree-line.not-in-path {
    stroke: var(--border) !important;
    stroke-width: 1 !important;
    opacity: 0.3;
}

/* Proof Data Section */
.proof-data-section {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(16, 185, 129, 0.08));
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.proof-data-section h4 {
    margin: 0 0 1rem 0;
    color: var(--primary);
    font-size: 1rem;
}

.proof-data-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.proof-data-item {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
}

.proof-data-item .data-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    font-weight: 500;
}

.proof-data-item .data-value {
    font-size: 0.9rem;
}

.proof-data-item .data-value code {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.8rem;
    background: var(--bg);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    color: #3b82f6;
}

.proof-data-item .data-value.root-value code {
    color: var(--primary);
    background: rgba(247, 147, 26, 0.1);
}

/* Proof Path Data */
.proof-path-data {
    border-color: rgba(251, 191, 36, 0.4);
    background: rgba(251, 191, 36, 0.05);
}

.proof-hashes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.proof-hash-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg);
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.proof-hash-level {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.proof-hash-pos {
    color: #fbbf24;
    font-weight: 500;
}

.proof-hash-item code {
    font-family: 'SF Mono', Monaco, monospace;
    color: #fbbf24;
}

.proof-data-note {
    font-size: 0.8rem;
    color: var(--success);
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border);
    margin-top: 0.5rem;
}

/* Verification Animation Step Display */
.verify-anim-step {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1rem;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

.verify-anim-step.active {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(247, 147, 26, 0.15);
}

.verify-anim-step.final {
    border-color: var(--success);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.verify-step-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.verify-step-num {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.verify-step-title {
    font-weight: 600;
    color: var(--text);
}

.verify-step-content {
    padding: 0.5rem 0;
}

/* Target Info */
.verify-target-info,
.verify-target-hash {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.target-label,
.hash-label {
    color: var(--text-muted);
    min-width: 70px;
}

.target-value {
    font-weight: 600;
    color: var(--primary);
}

.verify-target-hash code {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.8rem;
    background: var(--bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    color: #3b82f6;
}

/* Verify Pair */
.verify-pair {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.pair-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
}

.pair-node.current {
    background: rgba(59, 130, 246, 0.15);
    border: 2px solid #3b82f6;
}

.pair-node.sibling {
    background: rgba(251, 191, 36, 0.15);
    border: 2px solid #fbbf24;
}

.pair-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.pair-node code {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.8rem;
}

.pair-node.current code {
    color: #3b82f6;
}

.pair-node.sibling code {
    color: #fbbf24;
}

.pair-plus {
    font-size: 1.25rem;
    color: var(--text-muted);
    font-weight: bold;
}

/* Verification Calculation Process */
.verify-calc-current {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--card-bg);
    border-radius: var(--radius);
}

.calc-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.current-hash {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.85rem;
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
}

.current-hash.result-new {
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
    animation: resultAppear 0.4s ease;
}

@keyframes resultAppear {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.verify-calc-process {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--card-bg);
    border-radius: var(--radius);
}

.calc-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.8rem;
}

.calc-inputs code {
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
}

.hash-current {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.hash-sibling {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.calc-op {
    color: var(--text-muted);
    font-weight: bold;
}

.calc-arrow-down {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Verification Compare */
.verify-compare {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.compare-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.compare-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.compare-item code {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.8rem;
    padding: 0.35rem 0.6rem;
    background: var(--bg);
    border-radius: 4px;
    color: var(--primary);
}

.compare-vs {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--success);
}

/* Final Result */
.verify-final-result {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius);
    font-weight: 600;
    animation: finalAppear 0.5s ease;
}

.verify-final-result.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 2px solid var(--success);
}

.verify-final-result.fail {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 2px solid #ef4444;
}

.result-icon {
    font-size: 1.5rem;
}

.result-text {
    font-size: 0.95rem;
}

@keyframes finalAppear {
    0% { transform: scale(0.9); opacity: 0; }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); opacity: 1; }
}

/* Fake Transaction Explanation */
.fake-explanation {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius);
    font-size: 0.85rem;
    line-height: 1.6;
}

.fake-explanation p {
    margin: 0 0 0.5rem 0;
}

.fake-explanation p:last-child {
    margin-bottom: 0;
}

.fake-explanation strong {
    color: #ef4444;
}

/* Merkle SVG Responsive */
@media (max-width: 768px) {
    .merkle-svg {
        min-width: max-content;
    }

    .merkle-calc-display {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    .calc-children {
        flex-wrap: wrap;
        justify-content: center;
    }

    .verify-inputs {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ==========================================
   区块链页面增强样式
   ========================================== */

/* 链的概念可视化 */
.chain-concept {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 2rem 1rem;
    overflow-x: auto;
    background: var(--bg);
    border-radius: var(--radius);
}

.concept-block {
    background: var(--card-bg);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 1rem;
    min-width: 140px;
    text-align: center;
}

.concept-label {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.concept-hash,
.concept-prev {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.concept-hash code,
.concept-prev code {
    background: var(--bg);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
}

.concept-prev {
    color: #3b82f6;
    margin-bottom: 0.25rem;
}

.concept-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 0.5rem;
}

.arrow-line {
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #3b82f6);
    position: relative;
}

.arrow-line::after {
    content: '→';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    color: #3b82f6;
    font-size: 1rem;
}

.arrow-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* 区块链增长演示 */
.growth-demo {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    padding: 1.5rem;
    background: var(--bg);
    border-radius: var(--radius);
    overflow-x: auto;
}

.growth-stage {
    flex: 1;
    min-width: 160px;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    transition: all 0.3s ease;
}

.growth-stage.active {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(247, 147, 26, 0.3);
}

.growth-stage.complete {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.stage-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.stage-number {
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.growth-stage.complete .stage-number {
    background: var(--success);
}

.stage-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.stage-content {
    font-size: 0.8rem;
}

.growth-arrow {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    color: var(--text-muted);
    padding: 0 0.25rem;
}

/* 交易池 */
.tx-pool {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.pending-tx {
    background: var(--bg);
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.pending-tx.selected {
    background: rgba(247, 147, 26, 0.15);
    border-color: var(--primary);
    transform: scale(1.02);
}

/* 打包区块 */
.packaging-block {
    background: var(--bg);
    border-radius: 4px;
    padding: 0.6rem;
}

.pack-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
    font-size: 0.7rem;
}

.pack-label {
    color: var(--text-muted);
}

.pack-value {
    font-family: 'SF Mono', Monaco, monospace;
    color: var(--primary);
}

/* 挖矿进度 */
.mining-progress {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mining-status {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

.mining-bar {
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}

.mining-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.1s linear;
    border-radius: 4px;
}

.mining-hash {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.6rem;
    color: var(--text-muted);
    text-align: center;
    word-break: break-all;
}

/* 上链指示器 */
.added-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
}

.added-icon {
    font-size: 2rem;
}

.added-icon.success {
    animation: bounceIn 0.5s ease;
}

.added-text {
    font-size: 0.8rem;
    text-align: center;
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* 增长控制按钮 */
.growth-controls {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.growth-controls .btn.active {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

/* 区块链统计 */
.chain-stats {
    display: flex;
    gap: 2rem;
    padding: 1rem 1.5rem;
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.stat-value {
    font-weight: 600;
    color: var(--text);
}

.stat-value.valid {
    color: var(--success);
}

.stat-value.invalid {
    color: #ef4444;
}

/* 区块链可视化容器 */
.blockchain-visual {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 1.5rem;
    background: var(--bg);
    border-radius: var(--radius);
    overflow-x: auto;
    min-height: 280px;
}

/* 视觉区块 */
.visual-block {
    flex-shrink: 0;
    width: 200px;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.visual-block.valid {
    border-color: var(--success);
}

.visual-block.invalid {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.visual-block.latest {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.vblock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.8rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.vblock-index {
    font-weight: 600;
    color: var(--primary);
}

.vblock-body {
    padding: 0.8rem;
}

.vblock-field {
    margin-bottom: 0.6rem;
}

.vblock-field:last-child {
    margin-bottom: 0;
}

.vfield-label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vfield-value {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.7rem;
    background: var(--bg);
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    display: block;
    word-break: break-all;
}

.vfield-data {
    width: 100%;
    font-family: inherit;
    font-size: 0.75rem;
    padding: 0.4rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    resize: none;
    min-height: 40px;
}

.vfield-data:focus {
    outline: none;
    border-color: var(--primary);
}

.block-hash.valid-hash {
    color: var(--success);
}

.block-hash.invalid-hash {
    color: #ef4444;
}

.tamper-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0 var(--radius) 0 var(--radius);
}

/* 链接箭头 */
.chain-link-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
    min-width: 60px;
}

.link-line {
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--success), var(--primary));
    position: relative;
}

.link-line::before {
    content: '←';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--success);
    font-size: 0.9rem;
}

.link-hash {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.55rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* 篡改检测说明 */
.tamper-explanation {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid #ef4444;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1rem;
}

.tamper-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.tamper-icon {
    font-size: 1.5rem;
}

.tamper-title {
    font-weight: 600;
    color: #ef4444;
    font-size: 1.1rem;
}

.tamper-details {
    font-size: 0.9rem;
    line-height: 1.6;
}

.tamper-details ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.tamper-details li {
    margin-bottom: 0.4rem;
}

.tamper-note {
    font-style: italic;
    color: var(--text-muted);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(239, 68, 68, 0.2);
}

/* 不可篡改原因 */
.immutable-reasons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.reason-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius);
}

.reason-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.reason-item strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.reason-item p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .chain-concept {
        flex-direction: column;
        gap: 0.5rem;
    }

    .concept-arrow {
        transform: rotate(90deg);
        padding: 0.5rem 0;
    }

    .growth-demo {
        flex-direction: column;
    }

    .growth-arrow {
        transform: rotate(90deg);
        padding: 0.5rem 0;
    }

    .growth-stage {
        min-width: auto;
    }

    .blockchain-visual {
        padding: 1rem;
    }

    .visual-block {
        width: 160px;
    }

    .chain-stats {
        flex-direction: column;
        gap: 0.75rem;
    }

    .immutable-reasons {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   工作量证明页面增强样式
   ========================================== */

/* PoW 概念公式 */
.pow-concept {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.concept-formula {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.formula-item {
    text-align: center;
}

.formula-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.formula-item code {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
}

.formula-arrow {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.concept-explanation {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* 挖矿模拟器 */
.pow-simulator {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.simulator-config {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.config-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.config-item label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.difficulty-selector {
    display: flex;
    gap: 0.25rem;
}

.diff-btn {
    width: 36px;
    height: 36px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.diff-btn:hover {
    border-color: var(--primary);
}

.diff-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pow-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.pow-stats .stat {
    text-align: center;
    padding: 0.75rem;
    background: var(--card-bg);
    border-radius: var(--radius);
}

.pow-stats .stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.pow-stats .stat-value {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary);
}

/* 哈希流可视化 */
.pow-visual {
    margin-bottom: 1.5rem;
}

.hash-stream {
    height: 200px;
    overflow-y: auto;
    background: #0d1117;
    border-radius: var(--radius);
    padding: 0.75rem;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.75rem;
}

.hash-entry {
    padding: 0.25rem 0;
    color: #8b949e;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.hash-entry.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.hash-prefix {
    color: #f97316;
}

.hash-prefix.valid {
    color: var(--success);
    font-weight: bold;
}

.hash-rest {
    color: #6e7681;
}

.found-hash {
    background: rgba(16, 185, 129, 0.15);
    border: 2px solid var(--success);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    margin-top: 1rem;
    animation: successPulse 0.5s ease;
}

@keyframes successPulse {
    0% { transform: scale(0.95); opacity: 0; }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); opacity: 1; }
}

.found-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--success);
    margin-bottom: 0.75rem;
}

.found-hash code {
    display: block;
    font-size: 0.8rem;
    word-break: break-all;
    background: var(--bg);
    padding: 0.75rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

.found-nonce {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pow-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* 能量流程图 */
.energy-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    background: var(--bg);
    border-radius: var(--radius);
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.energy-stage {
    text-align: center;
    padding: 1rem;
    min-width: 100px;
}

.energy-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.energy-label {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.energy-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.energy-arrow {
    font-size: 1.5rem;
    color: var(--primary);
}

.energy-insight {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.insight-item {
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
}

.insight-item h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
}

.insight-item p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* 能量统计 */
.energy-visual {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.energy-visual h4 {
    margin: 0 0 1rem 0;
}

.hashrate-display {
    margin-bottom: 1.5rem;
}

.hashrate-bar {
    height: 24px;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.hashrate-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: 12px;
    transition: width 0.5s ease;
}

.hashrate-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.energy-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.energy-stat {
    text-align: center;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
}

.estat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.estat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* 货币理论 */
.monetary-concept {
    margin-bottom: 1.5rem;
}

.concept-quote {
    background: var(--bg);
    border-left: 4px solid var(--primary);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.concept-quote blockquote {
    margin: 0 0 0.75rem 0;
    font-style: italic;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
}

.concept-quote cite {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.money-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.money-type {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all 0.3s;
}

.money-type.highlight {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(247, 147, 26, 0.2);
}

.money-type.fiat {
    opacity: 0.7;
}

.money-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.money-type h4 {
    margin: 0 0 0.75rem 0;
}

.money-type ul {
    margin: 0 0 1rem 0;
    padding-left: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.money-type li {
    margin-bottom: 0.35rem;
}

.money-cost {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.cost-label {
    color: var(--text-muted);
}

.cost-value {
    font-weight: 600;
    color: var(--primary);
}

/* 货币属性表格 */
.money-properties {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.money-properties h4 {
    margin: 0 0 1rem 0;
}

.properties-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.properties-table th,
.properties-table td {
    padding: 0.75rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.properties-table th {
    background: var(--card-bg);
    font-weight: 600;
}

.properties-table td:first-child {
    text-align: left;
    font-weight: 500;
}

.rating {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.rating.perfect {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.rating.high {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.rating.medium {
    background: rgba(251, 191, 36, 0.2);
    color: #f59e0b;
}

.rating.low {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* 博弈论可视化 */
.game-theory-visual {
    display: grid;
    gap: 1.5rem;
}

.nash-equilibrium {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.nash-equilibrium h4 {
    margin: 0 0 1rem 0;
}

.strategy-matrix {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    gap: 2px;
    background: var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1rem;
}

.matrix-header {
    display: contents;
}

.matrix-corner {
    background: var(--card-bg);
    padding: 0.75rem;
}

.matrix-label {
    background: var(--card-bg);
    padding: 0.75rem;
    font-weight: 600;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.matrix-row {
    display: contents;
}

.matrix-cell {
    background: var(--card-bg);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.matrix-cell.win {
    background: rgba(16, 185, 129, 0.15);
}

.matrix-cell.lose {
    background: rgba(239, 68, 68, 0.15);
}

.matrix-cell.neutral {
    background: rgba(251, 191, 36, 0.15);
}

.payoff {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.equilibrium-result {
    text-align: center;
    padding: 1rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

/* 激励相容 */
.incentive-compat {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.incentive-compat h4 {
    margin: 0 0 1rem 0;
}

.incentive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.incentive-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
}

.incentive-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.incentive-text strong {
    display: block;
    margin-bottom: 0.25rem;
}

.incentive-text p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* 51%攻击计算器 */
.attack-calculator {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.calc-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.calc-input-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.calc-input-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.calc-input-group select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    font-size: 0.9rem;
}

.calc-value {
    font-weight: 600;
    color: var(--primary);
}

.attack-results {
    margin-top: 1.5rem;
    animation: fadeIn 0.3s ease;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-item {
    text-align: center;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
}

.result-item.highlight {
    background: rgba(239, 68, 68, 0.15);
    border: 2px solid #ef4444;
}

.result-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.result-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.result-item.highlight .result-value {
    color: #ef4444;
}

/* 攻击对比 */
.attack-comparison {
    margin-bottom: 1.5rem;
}

.attack-comparison h4 {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
}

.comparison-bars {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comp-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.comp-label {
    width: 120px;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.comp-fill {
    height: 24px;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.comp-fill.gain {
    background: var(--success);
}

.comp-fill.cost {
    background: #ef4444;
}

.comp-value {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.comparison-verdict {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius);
    margin-top: 1rem;
}

.verdict-icon {
    font-size: 1.5rem;
}

.verdict-text {
    font-size: 0.9rem;
    color: var(--text);
}

/* 攻击后果 */
.attack-consequences {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1rem;
}

.attack-consequences h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
}

.attack-consequences ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.attack-consequences li {
    padding: 0.35rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* 难度调整机制 */
.difficulty-mechanism {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.diff-formula {
    margin-bottom: 1.5rem;
}

.formula-box {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}

.formula-title {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.formula-box code {
    font-size: 0.9rem;
}

/* 难度模拟 */
.diff-simulation {
    margin-bottom: 1.5rem;
}

.diff-simulation h4 {
    margin: 0 0 1rem 0;
}

.sim-controls {
    margin-bottom: 1rem;
}

.sim-input {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sim-input label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.sim-input input[type="range"] {
    flex: 1;
    max-width: 300px;
    accent-color: var(--primary);
}

#hashrate-change-value {
    font-weight: 600;
    color: var(--primary);
    min-width: 50px;
}

.sim-results {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.sim-block {
    text-align: center;
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    border-radius: var(--radius);
}

.sim-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.sim-value {
    font-size: 1.5rem;
    font-weight: 600;
    font-family: 'SF Mono', Monaco, monospace;
}

.sim-arrow {
    color: var(--primary);
    font-weight: 600;
}

/* 时间线 */
.sim-timeline {
    position: relative;
    padding: 0.5rem 0;
}

.timeline-bar {
    height: 8px;
    background: var(--card-bg);
    border-radius: 4px;
    position: relative;
    overflow: visible;
}

.timeline-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.timeline-marker {
    position: absolute;
    top: -4px;
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    transform: translateX(-50%);
    transition: left 0.3s ease;
    box-shadow: 0 0 8px rgba(247, 147, 26, 0.5);
}

.timeline-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* 难度历史图表 */
.diff-history h4 {
    margin: 0 0 1rem 0;
}

.history-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 120px;
    padding: 0.5rem;
    background: var(--card-bg);
    border-radius: var(--radius);
}

.chart-bar {
    flex: 1;
    background: linear-gradient(to top, var(--primary), #f59e0b);
    border-radius: 4px 4px 0 0;
    min-width: 20px;
    transition: all 0.3s;
}

.chart-bar:hover {
    filter: brightness(1.2);
}

.chart-bar.active {
    background: var(--success);
}

.chart-labels {
    display: flex;
    justify-content: space-around;
    margin-top: 0.5rem;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.chart-note {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

/* PoW 总结 */
.pow-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.summary-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius);
}

.summary-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.summary-item strong {
    display: block;
    margin-bottom: 0.25rem;
}

.summary-item p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .energy-flow {
        flex-direction: column;
    }

    .energy-arrow {
        transform: rotate(90deg);
    }

    .energy-stats {
        grid-template-columns: 1fr;
    }

    .money-comparison {
        grid-template-columns: 1fr;
    }

    .strategy-matrix {
        font-size: 0.75rem;
    }

    .matrix-cell {
        padding: 0.5rem;
    }

    .sim-results {
        flex-direction: column;
    }

    .sim-arrow {
        transform: rotate(90deg);
    }
}

/* 数据来源标注 */
.data-source {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.data-source a {
    color: var(--primary);
    text-decoration: none;
}

.data-source a:hover {
    text-decoration: underline;
}

/* 数据过时提示 */
.data-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    margin-top: 1rem;
    margin-bottom: 0;
}

/* ==========================================
   共识传播页面样式
   ========================================== */

/* 区块传播演示 */
.propagation-demo {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.network-view {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 1rem;
    overflow: hidden;
}

.network-view canvas {
    width: 100%;
    height: auto;
    display: block;
}

.propagation-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.prop-stat {
    text-align: center;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.prop-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.prop-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.propagation-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.speed-control label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.speed-control input[type="range"] {
    width: 100px;
    accent-color: var(--primary);
}

.propagation-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.legend-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.legend-dot.source {
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
}

.legend-dot.received {
    background: var(--success);
}

.legend-dot.waiting {
    background: var(--border);
    border: 2px solid var(--text-muted);
}

/* 分叉演示 */
.fork-demo {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.fork-chain-view {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 2rem;
    overflow-x: auto;
}

.main-chain {
    display: flex;
    align-items: center;
    min-width: fit-content;
}

.chain-block {
    width: 70px;
    height: 50px;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.chain-block.genesis {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-color: #f59e0b;
}

.chain-block.current {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(247, 147, 26, 0.2);
}

.chain-block.fork-block {
    width: 80px;
    height: 60px;
}

.chain-block.block-a {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border-color: #3b82f6;
}

.chain-block.block-b {
    background: linear-gradient(135deg, #fce7f3, #fbcfe8);
    border-color: #ec4899;
}

.chain-block.winner {
    border-color: var(--success);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

.chain-block.orphan {
    opacity: 0.4;
    border-style: dashed;
}

.block-label {
    font-size: 0.85rem;
    font-weight: bold;
}

.block-miner {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.chain-arrow {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin: 0 0.5rem;
}

.fork-point {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-left: 0.5rem;
}

.fork-branch {
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.5s ease;
}

.fork-branch.visible {
    opacity: 1;
    transform: translateX(0);
}

.fork-status {
    text-align: center;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.status-message {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.fork-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.fork-explanation {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
}

.explanation-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.step-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.explanation-step p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* 共识收敛演示 */
.convergence-demo {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.convergence-visual {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.node-network {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg);
    border-radius: var(--radius);
}

.network-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 2px solid var(--border);
    transition: all 0.3s;
}

.network-node[data-chain="a"] {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

.network-node[data-chain="b"] {
    border-color: #ec4899;
    background: linear-gradient(135deg, #fdf2f8, #fce7f3);
}

.network-node.switching {
    animation: nodePulse 0.5s ease;
}

@keyframes nodePulse {
    50% {
        transform: scale(1.1);
    }
}

.node-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.node-label {
    font-size: 0.85rem;
    font-weight: 500;
}

.node-chain {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.chain-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.chain-side {
    flex: 1;
    max-width: 200px;
    text-align: center;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 2px solid var(--border);
}

.chain-a-side {
    border-color: #3b82f6;
}

.chain-b-side {
    border-color: #ec4899;
}

.chain-side h4 {
    margin-bottom: 1rem;
}

.mini-chain {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.mini-block {
    width: 30px;
    height: 24px;
    background: var(--bg);
    border-radius: 4px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.mini-block.highlight-a {
    background: #3b82f6;
    color: white;
}

.mini-block.highlight-b {
    background: #ec4899;
    color: white;
}

.mini-arrow {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.chain-length,
.chain-supporters {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.chain-supporters {
    margin-top: 0.25rem;
}

.vs-divider {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-muted);
}

.convergence-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.convergence-timeline {
    display: flex;
    justify-content: space-around;
    padding: 1rem 0;
    position: relative;
}

.convergence-timeline::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--border);
    transform: translateY(-50%);
    z-index: 0;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 1;
}

.step-marker {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.step-marker.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.step-marker.completed {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.step-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

.convergence-message {
    text-align: center;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* 一致性要点 */
.consistency-points {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.point-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.point-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.point-item strong {
    display: block;
    margin-bottom: 0.25rem;
}

.point-item p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* 确认数可视化 */
.confirmation-visual {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.confirmation-chain {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 1.5rem;
    background: var(--bg);
    border-radius: var(--radius);
    overflow-x: auto;
}

.conf-block {
    min-width: 70px;
    padding: 1rem 0.5rem;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    transition: all 0.3s;
}

.conf-block.old {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border-color: var(--success);
}

.conf-block.latest {
    border-color: var(--primary);
    background: linear-gradient(135deg, #fef3c7, #fde68a);
}

.conf-depth {
    font-size: 0.75rem;
    font-weight: 500;
}

.conf-arrow {
    font-size: 1rem;
    color: var(--text-muted);
}

.confirmation-table {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.conf-row {
    display: grid;
    grid-template-columns: 100px 120px 1fr;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.conf-row:last-child {
    border-bottom: none;
}

.conf-row.header {
    background: var(--bg);
    font-weight: 600;
}

.conf-num {
    font-weight: bold;
    font-family: monospace;
}

.conf-level {
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-align: center;
    font-size: 0.85rem;
}

.conf-level.danger {
    background: #fef2f2;
    color: #dc2626;
}

.conf-level.warning {
    background: #fefce8;
    color: #ca8a04;
}

.conf-level.moderate {
    background: #fff7ed;
    color: #ea580c;
}

.conf-level.safe {
    background: #f0fdf4;
    color: #16a34a;
}

.conf-level.very-safe {
    background: #ecfdf5;
    color: #059669;
}

.conf-use {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .propagation-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .propagation-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .speed-control {
        margin-left: 0;
        justify-content: center;
    }

    .propagation-legend {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .fork-chain-view {
        padding: 1rem;
    }

    .chain-block {
        width: 55px;
        height: 40px;
    }

    .chain-block.fork-block {
        width: 65px;
        height: 50px;
    }

    .block-label {
        font-size: 0.75rem;
    }

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

    .chain-comparison {
        flex-direction: column;
        gap: 1rem;
    }

    .chain-side {
        max-width: 100%;
    }

    .vs-divider {
        transform: rotate(90deg);
    }

    .convergence-timeline {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .convergence-timeline::before {
        display: none;
    }

    .confirmation-chain {
        padding: 1rem;
    }

    .conf-block {
        min-width: 50px;
        padding: 0.75rem 0.25rem;
    }

    .conf-depth {
        font-size: 0.65rem;
    }

    .conf-row {
        grid-template-columns: 60px 80px 1fr;
        padding: 0.75rem;
        font-size: 0.85rem;
    }
}
