/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: #0d1117;
    color: #e6edf3;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(31, 111, 235, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(137, 87, 229, 0.15) 0%, transparent 50%);
    background-attachment: fixed;
}

/* App Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    padding: 2rem 1rem;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    margin-bottom: 3rem;
    padding-left: 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #58a6ff 0%, #a371f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: transparent;
    border: none;
    color: #8b949e;
    font-size: 1rem;
    font-weight: 500;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #c9d1d9;
}

.nav-btn.active {
    background: rgba(88, 166, 255, 0.1);
    color: #58a6ff;
    font-weight: 600;
}

.nav-btn .icon {
    font-size: 1.2rem;
}

/* Main Content Area */
.main-content-area {
    flex: 1;
    margin-left: 260px;
    padding: 2rem 4rem;
    max-width: calc(100% - 260px);
}

/* Tab Management */
.tab-pane {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.tab-pane.active {
    display: block;
}

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

/* Utilities */
.mb-2 { margin-bottom: 2rem; }
.mt-1 { margin-top: 1rem; }

/* Glassmorphism Panel Utilities */
.glass-panel {
    background: rgba(22, 27, 34, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
}

/* Hero Section */
.hero-section {
    padding: 2rem 0 3rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(88, 166, 255, 0.15);
    color: #58a6ff;
    border: 1px solid rgba(88, 166, 255, 0.3);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.highlight {
    background: linear-gradient(135deg, #58a6ff 0%, #a371f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.1rem;
    color: #8b949e;
}

/* Info Section (DPP Explanation) */
.info-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.info-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.info-card p {
    line-height: 1.6;
    color: #c9d1d9;
    font-size: 1rem;
}

.architecture-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.architecture-list li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.icon-box {
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: 8px;
}

.text-box strong {
    display: block;
    color: #fff;
    margin-bottom: 0.25rem;
    font-size: 1.05rem;
}

.text-box span {
    color: #8b949e;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Generator Section */
.generator-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.panel-header {
    margin-bottom: 2rem;
}

.panel-header h2 {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.panel-header p {
    color: #8b949e;
    font-size: 0.9rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #c9d1d9;
}

input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(1, 4, 9, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus {
    outline: none;
    border-color: #58a6ff;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

/* Button Styles */
.primary-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #238636 0%, #2ea043 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 1rem;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 160, 67, 0.4);
}

.primary-btn:active {
    transform: translateY(0);
}

/* Result Section */
.result-panel {
    display: flex;
    flex-direction: column;
}

.result-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    flex-grow: 1;
}

.qrcode-placeholder {
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.qrcode-placeholder.active {
    background: #fff;
    border: 2px solid #58a6ff;
    padding: 10px;
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.3);
}

.placeholder-text {
    color: #8b949e;
    font-size: 0.9rem;
}

.json-output-container {
    width: 100%;
    background: #010409;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
}

.json-output-container h3 {
    font-size: 0.9rem;
    color: #8b949e;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

pre {
    color: #a5d6ff;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Blockchain Status */
.blockchain-status {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #8b949e;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #8b949e;
    box-shadow: 0 0 0 rgba(139, 148, 158, 0.4);
}

.status-dot.active {
    background-color: #3fb950;
    box-shadow: 0 0 10px #3fb950;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(63, 185, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0); }
}

/* Explanation Section Specifics */
.explanation-container {
    max-width: 900px;
}

.process-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.process-list li {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 8px;
    color: #c9d1d9;
    line-height: 1.6;
}

.process-list strong {
    color: #58a6ff;
}

/* Flowchart Styles (Pure CSS) */
.flowchart {
    background: rgba(1, 4, 9, 0.6);
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.flow-row {
    display: flex;
    justify-content: center;
    width: 100%;
}

.flow-row-split {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.flow-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 280px;
}

.flow-node {
    padding: 1rem 1.5rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    color: #fff;
    min-width: 180px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.flow-node:hover {
    transform: scale(1.05);
}

.flow-node small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    opacity: 0.7;
}

.node-physical {
    background: #2d3748;
    border: 2px solid #4a5568;
}

.node-network {
    background: #1a365d;
    border: 2px solid #2b6cb0;
}

.node-gateway {
    box-shadow: 0 0 20px rgba(43, 108, 176, 0.3);
}

.node-storage {
    background: #276749;
    border: 2px solid #38a169;
}

.node-user {
    background: #5a036c;
    border: 2px solid #9f7aea;
}

.node-danger {
    background: #742a2a;
    border: 2px solid #fc8181;
}

/* Arrows */
.flow-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.25rem 0;
}

.arrow-line {
    width: 2px;
    height: 28px;
    background: linear-gradient(to bottom, #58a6ff, #a371f7);
    position: relative;
}

.arrow-line::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #a371f7;
}

.arrow-up .arrow-line {
    background: linear-gradient(to bottom, #a371f7, #58a6ff);
}

.arrow-up .arrow-line::after {
    border-top-color: #58a6ff;
}

.arrow-line-green {
    background: linear-gradient(to bottom, #58a6ff, #3fb950) !important;
}

.arrow-line-green::after {
    border-top-color: #3fb950 !important;
}

.arrow-line-red {
    background: linear-gradient(to bottom, #58a6ff, #f85149) !important;
}

.arrow-line-red::after {
    border-top-color: #f85149 !important;
}

.arrow-label {
    font-size: 0.78rem;
    color: #8b949e;
    margin-top: 0.15rem;
    margin-bottom: 0.15rem;
    white-space: nowrap;
}

.explanation-box {
    background: rgba(88, 166, 255, 0.05);
    border-left: 4px solid #58a6ff;
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.explanation-box p {
    color: #c9d1d9;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Hash Explanation Styles */
.detail-link {
    display: inline-block;
    margin-left: 0.5rem;
    color: #58a6ff;
    cursor: pointer;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.detail-link:hover {
    color: #a371f7;
}

.hash-properties h3,
.hash-demo h3,
.hash-demo h4,
.hash-application h3 {
    font-size: 1.15rem;
    color: #fff;
    margin-bottom: 0.75rem;
}

.property-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.property-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 1.25rem;
    transition: transform 0.2s, border-color 0.2s;
}

.property-card:hover {
    transform: translateY(-2px);
    border-color: rgba(88, 166, 255, 0.3);
}

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

.property-card strong {
    display: block;
    color: #58a6ff;
    margin-bottom: 0.4rem;
    font-size: 1rem;
}

.property-card p {
    font-size: 0.88rem;
    line-height: 1.5;
    color: #8b949e;
}

/* Hash Demo */
.hash-demo {
    background: rgba(1, 4, 9, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 1.5rem;
}

.demo-desc {
    color: #8b949e;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.demo-area {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.demo-input-group,
.demo-output-group {
    flex: 1;
}

.demo-input-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(1, 4, 9, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.demo-input-group textarea:focus {
    outline: none;
    border-color: #58a6ff;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

.demo-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.demo-arrow .arrow-line {
    width: 40px;
    height: 2px;
    background: linear-gradient(to right, #58a6ff, #a371f7);
}

.demo-arrow .arrow-line::after {
    bottom: auto;
    top: 50%;
    left: auto;
    right: -4px;
    transform: translateY(-50%);
    border-left: 6px solid #a371f7;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-right: none;
}

.hash-output {
    background: rgba(1, 4, 9, 0.8);
    border: 1px solid rgba(88, 166, 255, 0.3);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.8rem;
    color: #3fb950;
    word-break: break-all;
    line-height: 1.5;
    min-height: 72px;
    display: flex;
    align-items: center;
}

/* Compare Grid */
.demo-compare {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 1rem;
}

.compare-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.compare-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.compare-label {
    min-width: 110px;
    font-size: 0.85rem;
    color: #8b949e;
    font-weight: 500;
}

.compare-text {
    min-width: 200px;
    font-size: 0.85rem;
    color: #c9d1d9;
    background: rgba(1, 4, 9, 0.5);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.compare-hash {
    flex: 1;
    font-size: 0.75rem;
    color: #3fb950;
    word-break: break-all;
    background: rgba(1, 4, 9, 0.5);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.compare-hash-diff {
    color: #f85149;
}

.match-rate {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: #8b949e;
    text-align: center;
}

/* Lifecycle Flow */
.lifecycle-flow {
    display: flex;
    gap: 1rem;
}

.lifecycle-step {
    flex: 1;
    background: rgba(1, 4, 9, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 1.25rem;
    transition: transform 0.2s;
}

.lifecycle-step:hover {
    transform: translateY(-3px);
}

.step-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: rgba(88, 166, 255, 0.15);
    color: #58a6ff;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.badge-transport {
    background: rgba(163, 113, 247, 0.15);
    color: #a371f7;
}

.badge-recycle {
    background: rgba(63, 185, 80, 0.15);
    color: #3fb950;
}

.step-data {
    font-size: 0.88rem;
    color: #c9d1d9;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.step-hash {
    font-size: 0.85rem;
    color: #8b949e;
}

.step-hash code {
    color: #3fb950;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
}

.application-note {
    color: #c9d1d9;
    font-size: 0.95rem;
    line-height: 1.6;
    background: rgba(88, 166, 255, 0.05);
    border-left: 4px solid #58a6ff;
    padding: 1rem;
    border-radius: 0 8px 8px 0;
}

/* ========================================================
   資料流程圖 (Data Flow Diagram)
   ======================================================== */
.dataflow-container {
    max-width: 900px;
}

/* 步驟卡片 */
.flow-step-card {
    position: relative;
    border-left: 3px solid rgba(88, 166, 255, 0.3);
}

.flow-step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.step-number {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1f6feb 0%, #58a6ff 100%);
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(88, 166, 255, 0.3);
}

.step-number.step-hash {
    background: linear-gradient(135deg, #238636 0%, #3fb950 100%);
    box-shadow: 0 4px 15px rgba(63, 185, 80, 0.3);
}

.step-number.step-block {
    background: linear-gradient(135deg, #8957e5 0%, #a371f7 100%);
    box-shadow: 0 4px 15px rgba(163, 113, 247, 0.3);
}

.step-number.step-mine {
    background: linear-gradient(135deg, #d29922 0%, #f0883e 100%);
    box-shadow: 0 4px 15px rgba(240, 136, 62, 0.3);
}

.step-number.step-chain {
    background: linear-gradient(135deg, #da3633 0%, #f85149 100%);
    box-shadow: 0 4px 15px rgba(248, 81, 73, 0.3);
}

.step-title-group h3 {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 0.25rem;
}

.step-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.6rem;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-input {
    background: rgba(88, 166, 255, 0.12);
    color: #58a6ff;
    border: 1px solid rgba(88, 166, 255, 0.25);
}

.tag-hash {
    background: rgba(63, 185, 80, 0.12);
    color: #3fb950;
    border: 1px solid rgba(63, 185, 80, 0.25);
}

.tag-block {
    background: rgba(163, 113, 247, 0.12);
    color: #a371f7;
    border: 1px solid rgba(163, 113, 247, 0.25);
}

.tag-mine {
    background: rgba(240, 136, 62, 0.12);
    color: #f0883e;
    border: 1px solid rgba(240, 136, 62, 0.25);
}

.tag-chain {
    background: rgba(248, 81, 73, 0.12);
    color: #f85149;
    border: 1px solid rgba(248, 81, 73, 0.25);
}

.flow-step-body p {
    color: #c9d1d9;
    line-height: 1.6;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

/* 程式碼區塊 */
.flow-code-block {
    background: rgba(1, 4, 9, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.code-label {
    font-size: 0.8rem;
    color: #8b949e;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.flow-code-block pre {
    font-size: 0.85rem;
    color: #a5d6ff;
}

/* 提示備註 */
.step-note {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.note-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.step-note span {
    font-size: 0.88rem;
    color: #8b949e;
    line-height: 1.5;
}

/* 連接器 (向下箭頭) */
.flow-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.25rem 0;
    margin: 0 0 0 1.5rem;
}

.connector-line {
    width: 2px;
    height: 24px;
    background: linear-gradient(to bottom, #58a6ff, #a371f7);
}

.connector-line-long {
    height: 36px;
}

.connector-label {
    font-size: 0.75rem;
    color: #a371f7;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    background: rgba(163, 113, 247, 0.1);
    border-radius: 4px;
    margin: 0.25rem 0;
}

.connector-arrow {
    font-size: 0.8rem;
    color: #a371f7;
    line-height: 1;
}

/* 轉換視覺化 (Input → SHA-256 → Output) */
.flow-transform-visual {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(1, 4, 9, 0.5);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.transform-input,
.transform-output {
    flex: 1;
    padding: 0.75rem;
    border-radius: 8px;
}

.transform-input {
    background: rgba(88, 166, 255, 0.05);
    border: 1px solid rgba(88, 166, 255, 0.15);
}

.transform-output {
    background: rgba(63, 185, 80, 0.05);
    border: 1px solid rgba(63, 185, 80, 0.15);
}

.transform-input code,
.transform-output code {
    display: block;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.78rem;
    word-break: break-all;
    color: #a5d6ff;
}

.hash-green {
    color: #3fb950 !important;
    font-weight: 600;
}

.hash-purple {
    color: #a371f7 !important;
}

.transform-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
    flex-shrink: 0;
}

.transform-arrow .arrow-body {
    width: 40px;
    height: 2px;
    background: linear-gradient(to right, #58a6ff, #3fb950);
    position: relative;
}

.transform-arrow .arrow-body::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 6px solid #3fb950;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
}

.arrow-text {
    font-size: 0.7rem;
    color: #8b949e;
    margin-top: 0.35rem;
    font-weight: 600;
}

/* 區塊結構表 */
.block-structure {
    background: rgba(1, 4, 9, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 0.5rem;
    margin-bottom: 1rem;
}

.struct-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.2s;
}

.struct-row:last-child {
    border-bottom: none;
}

.struct-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.struct-highlight {
    background: rgba(63, 185, 80, 0.05);
    border-left: 3px solid #3fb950;
}

.struct-highlight-purple {
    background: rgba(163, 113, 247, 0.05);
    border-left: 3px solid #a371f7;
}

.struct-key {
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    color: #58a6ff;
    font-weight: 600;
    min-width: 120px;
}

.struct-desc {
    flex: 1;
    font-size: 0.85rem;
    color: #8b949e;
}

.struct-example {
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.78rem;
    color: #c9d1d9;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}

/* Mining 公式 */
.mining-formula {
    background: rgba(240, 136, 62, 0.06);
    border: 1px solid rgba(240, 136, 62, 0.2);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.formula-label {
    font-size: 0.75rem;
    color: #f0883e;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.formula-content code {
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.82rem;
    color: #c9d1d9;
    display: block;
    word-break: break-all;
}

.f-index { color: #58a6ff; }
.f-prev { color: #a371f7; }
.f-time { color: #f0883e; }
.f-data { color: #3fb950; }
.f-nonce { color: #ffc107; }

/* Mining Demo */
.mining-demo {
    background: rgba(1, 4, 9, 0.5);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
}

.mine-attempt {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.78rem;
    color: #8b949e;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.mine-attempt:last-child {
    border-bottom: none;
}

.mine-attempt.dots {
    justify-content: center;
    color: #6e7681;
    font-style: italic;
}

.mine-attempt.success {
    background: rgba(63, 185, 80, 0.08);
    border-radius: 6px;
    border: 1px solid rgba(63, 185, 80, 0.2);
    color: #3fb950;
}

.attempt-label {
    min-width: 65px;
    font-weight: 600;
    color: #6e7681;
}

.mine-attempt.success .attempt-label {
    color: #3fb950;
}

.attempt-fail {
    color: #f85149;
    font-size: 0.75rem;
    margin-left: auto;
}

.attempt-pass {
    color: #3fb950;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: auto;
}

/* 鏈式視覺化 */
.chain-visual {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 1.5rem 1rem;
    background: rgba(1, 4, 9, 0.5);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow-x: auto;
    margin-bottom: 1rem;
}

.chain-block {
    min-width: 160px;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    flex-shrink: 0;
}

.chain-genesis {
    background: rgba(255, 193, 7, 0.08);
    border: 2px solid rgba(255, 193, 7, 0.35);
}

.chain-new {
    background: rgba(63, 185, 80, 0.08);
    border: 2px solid rgba(63, 185, 80, 0.35);
    animation: newBlockPulse 2s ease-in-out infinite;
}

@keyframes newBlockPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0); }
    50% { box-shadow: 0 0 15px rgba(63, 185, 80, 0.2); }
}

.chain-future {
    background: rgba(255, 255, 255, 0.03);
    border: 2px dashed rgba(255, 255, 255, 0.15);
}

.cb-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    margin-bottom: 0.25rem;
}

.cb-badge {
    display: inline-block;
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    border-radius: 8px;
    margin-bottom: 0.4rem;
}

.cb-new {
    background: rgba(63, 185, 80, 0.15);
    color: #3fb950;
}

.cb-prev {
    font-family: 'Menlo', monospace;
    font-size: 0.65rem;
    color: #a371f7;
    margin-bottom: 0.2rem;
}

.cb-hash {
    font-family: 'Menlo', monospace;
    font-size: 0.65rem;
    color: #58a6ff;
}

.chain-link {
    display: flex;
    align-items: center;
    min-width: 40px;
    padding: 0 0.25rem;
}

.cl-line {
    width: 20px;
    height: 2px;
    background: linear-gradient(to right, #a371f7, #58a6ff);
}

.cl-arrow {
    color: #58a6ff;
    font-size: 1rem;
    font-weight: 700;
}

/* 安全性總結 */
.security-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.security-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 1.25rem;
    transition: transform 0.2s, border-color 0.2s;
}

.security-item:hover {
    transform: translateY(-2px);
    border-color: rgba(88, 166, 255, 0.3);
}

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

.security-item strong {
    display: block;
    color: #58a6ff;
    margin-bottom: 0.4rem;
    font-size: 1rem;
}

.security-item p {
    font-size: 0.88rem;
    line-height: 1.5;
    color: #8b949e;
}

/* Demo vs 真實做法 比較 */
.demo-vs-real {
    border: 1px solid rgba(240, 136, 62, 0.25);
    background: rgba(240, 136, 62, 0.03);
}

.compare-table-wrapper {
    overflow-x: auto;
    margin-bottom: 1rem;
}

.compare-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(1, 4, 9, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.compare-table th,
.compare-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

.compare-table thead th {
    background: rgba(255, 255, 255, 0.03);
    font-weight: 600;
    color: #c9d1d9;
}

.compare-table thead th:first-child {
    width: 120px;
}

.th-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.th-demo {
    background: rgba(88, 166, 255, 0.1);
    color: #58a6ff;
    border: 1px solid rgba(88, 166, 255, 0.2);
}

.th-real {
    background: rgba(63, 185, 80, 0.1);
    color: #3fb950;
    border: 1px solid rgba(63, 185, 80, 0.2);
}

.compare-table td {
    color: #c9d1d9;
    vertical-align: top;
}

.row-label {
    font-weight: 600;
    color: #8b949e !important;
    font-size: 0.85rem !important;
    white-space: nowrap;
}

.compare-table code {
    background: rgba(88, 166, 255, 0.1);
    color: #58a6ff;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.82rem;
}

.table-note {
    font-size: 0.78rem;
    color: #6e7681;
}

.compare-table tbody tr:last-child td {
    border-bottom: none;
}

/* 真實世界的資料流 */
.real-world-flow {
    background: rgba(1, 4, 9, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 1.25rem;
}

.real-world-flow h3 {
    font-size: 1.05rem;
    color: #fff;
    margin-bottom: 1rem;
}

.rw-flow-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 1rem 0;
}

.rw-step {
    text-align: center;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-width: 100px;
    transition: transform 0.2s;
}

.rw-step:hover {
    transform: translateY(-3px);
}

.rw-step-offchain {
    background: rgba(163, 113, 247, 0.06);
    border-color: rgba(163, 113, 247, 0.25);
}

.rw-step-hash {
    background: rgba(63, 185, 80, 0.06);
    border-color: rgba(63, 185, 80, 0.25);
}

.rw-step-onchain {
    background: rgba(88, 166, 255, 0.06);
    border-color: rgba(88, 166, 255, 0.25);
}

.rw-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.rw-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #c9d1d9;
}

.rw-sub {
    font-size: 0.72rem;
    color: #8b949e;
    margin-top: 0.15rem;
}

.rw-arrow {
    color: #58a6ff;
    font-size: 1.3rem;
    font-weight: 700;
    padding: 0 0.25rem;
}

/* Hash vs 加密 FAQ */
.faq-card {
    border-color: rgba(88, 166, 255, 0.2);
}

.concept-compare {
    display: flex;
    align-items: stretch;
    gap: 1rem;
}

.concept-card {
    flex: 1;
    padding: 1.25rem;
    border-radius: 12px;
    transition: transform 0.2s;
}

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

.concept-hash {
    background: rgba(63, 185, 80, 0.06);
    border: 1px solid rgba(63, 185, 80, 0.25);
}

.concept-encrypt {
    background: rgba(163, 113, 247, 0.06);
    border: 1px solid rgba(163, 113, 247, 0.25);
}

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

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

.concept-header h4 {
    font-size: 1.1rem;
    color: #fff;
}

.concept-question {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6e7681;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.concept-card p {
    font-size: 1rem;
    color: #c9d1d9;
    margin-bottom: 0.5rem;
}

.concept-purpose {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.concept-hash .concept-purpose {
    color: #3fb950;
}

.concept-encrypt .concept-purpose {
    color: #a371f7;
}

.concept-traits {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.trait {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: rgba(63, 185, 80, 0.1);
    color: #3fb950;
    border: 1px solid rgba(63, 185, 80, 0.2);
}

.trait-enc {
    background: rgba(163, 113, 247, 0.1);
    color: #a371f7;
    border-color: rgba(163, 113, 247, 0.2);
}

.concept-vs {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: #6e7681;
    padding: 0 0.25rem;
}

/* 受眾 Grid */
.why-plaintext h3,
.encrypt-scenario h3 {
    font-size: 1.05rem;
    color: #fff;
    margin-bottom: 0.75rem;
}

.why-plaintext p,
.encrypt-scenario p {
    font-size: 0.92rem;
    color: #c9d1d9;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

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

.audience-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    transition: transform 0.2s;
}

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

.audience-icon {
    font-size: 1.5rem;
    margin-bottom: 0.4rem;
}

.audience-item strong {
    color: #58a6ff;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.audience-item span:last-child {
    font-size: 0.78rem;
    color: #8b949e;
    line-height: 1.4;
}

/* 加密流程 */
.encrypt-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: rgba(1, 4, 9, 0.5);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.ef-step {
    text-align: center;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ef-step code {
    font-size: 0.8rem;
    color: #c9d1d9;
}

.ef-encrypt {
    background: rgba(163, 113, 247, 0.06);
    border-color: rgba(163, 113, 247, 0.25);
}

.ef-store {
    background: rgba(240, 136, 62, 0.06);
    border-color: rgba(240, 136, 62, 0.25);
}

.ef-hash {
    background: rgba(63, 185, 80, 0.06);
    border-color: rgba(63, 185, 80, 0.25);
}

.ef-sub {
    display: block;
    font-size: 0.68rem;
    color: #8b949e;
    margin-top: 0.2rem;
}

.ef-arrow {
    color: #58a6ff;
    font-size: 1.2rem;
    font-weight: 700;
}

/* 上鏈深入解析 */
.onchain-deep-dive {
    border-color: rgba(88, 166, 255, 0.25);
}

.chain-types-section h3,
.why-chain h3,
.chain-access h3,
.chain-risks h3 {
    font-size: 1.05rem;
    color: #fff;
    margin-bottom: 0.75rem;
}

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

.chain-type-card {
    border-radius: 12px;
    padding: 1.25rem;
    transition: transform 0.2s;
}

.chain-type-card:hover {
    transform: translateY(-3px);
}

.ct-public {
    background: rgba(88, 166, 255, 0.05);
    border: 1px solid rgba(88, 166, 255, 0.25);
}

.ct-consortium {
    background: rgba(240, 136, 62, 0.05);
    border: 1px solid rgba(240, 136, 62, 0.25);
}

.ct-government {
    background: rgba(163, 113, 247, 0.05);
    border: 1px solid rgba(163, 113, 247, 0.25);
}

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

.ct-icon {
    font-size: 1.3rem;
}

.ct-header h4 {
    font-size: 0.95rem;
    color: #fff;
}

.ct-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.ct-tag {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    background: rgba(88, 166, 255, 0.1);
    color: #58a6ff;
    border: 1px solid rgba(88, 166, 255, 0.2);
}

.ct-tag.tag-alt {
    background: rgba(240, 136, 62, 0.1);
    color: #f0883e;
    border-color: rgba(240, 136, 62, 0.2);
}

.ct-tag.tag-gov {
    background: rgba(163, 113, 247, 0.1);
    color: #a371f7;
    border-color: rgba(163, 113, 247, 0.2);
}

.ct-detail {
    margin-bottom: 0.6rem;
}

.ct-row {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    font-size: 0.82rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.ct-row:last-child {
    border-bottom: none;
}

.ct-label {
    color: #6e7681;
}

.ct-value {
    color: #c9d1d9;
    font-weight: 500;
}

.ct-no { color: #f85149; }
.ct-yes { color: #3fb950; }

.ct-note {
    font-size: 0.78rem;
    color: #8b949e;
    line-height: 1.4;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* 為什麼有這條鏈 */
.why-chain-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.wc-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 1.25rem;
    transition: transform 0.2s;
}

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

.wc-icon {
    font-size: 1.5rem;
    margin-bottom: 0.4rem;
}

.wc-card strong {
    display: block;
    color: #58a6ff;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.wc-card p {
    font-size: 0.88rem;
    color: #8b949e;
    line-height: 1.5;
}

/* 上鏈申請 */
.access-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.access-card {
    border-radius: 10px;
    padding: 1.25rem;
}

.access-public {
    background: rgba(88, 166, 255, 0.05);
    border: 1px solid rgba(88, 166, 255, 0.2);
}

.access-private {
    background: rgba(163, 113, 247, 0.05);
    border: 1px solid rgba(163, 113, 247, 0.2);
}

.access-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #fff;
}

.access-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
}

.access-open {
    background: rgba(63, 185, 80, 0.12);
    color: #3fb950;
    border: 1px solid rgba(63, 185, 80, 0.25);
}

.access-restricted {
    background: rgba(240, 136, 62, 0.12);
    color: #f0883e;
    border: 1px solid rgba(240, 136, 62, 0.25);
}

.access-steps {
    padding-left: 1.2rem;
    margin: 0;
}

.access-steps li {
    font-size: 0.85rem;
    color: #8b949e;
    padding: 0.3rem 0;
    line-height: 1.4;
}

/* 風險 Grid */
.risk-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.risk-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 1rem;
    transition: border-color 0.2s;
}

.risk-card:hover {
    border-color: rgba(248, 81, 73, 0.3);
}

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

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

.risk-header strong {
    color: #f85149;
    font-size: 0.92rem;
}

.risk-card p {
    font-size: 0.85rem;
    color: #8b949e;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.risk-mitigation {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0.6rem;
    background: rgba(63, 185, 80, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(63, 185, 80, 0.12);
}

.mitigation-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #3fb950;
    background: rgba(63, 185, 80, 0.12);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.risk-mitigation span:last-child {
    font-size: 0.8rem;
    color: #8b949e;
    line-height: 1.4;
}

/* ========================================================
   區塊鏈瀏覽器 (Blockchain Explorer)
   ======================================================== */
.explorer-section {
    margin-top: 2rem;
}

.explorer-panel .panel-header h2 {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.block-count-badge {
    font-size: 0.85rem;
    font-weight: 500;
    background: rgba(88, 166, 255, 0.12);
    color: #58a6ff;
    padding: 0.2rem 0.75rem;
    border-radius: 20px;
    border: 1px solid rgba(88, 166, 255, 0.25);
}

.blockchain-scroll-container {
    overflow-x: auto;
    padding: 1.5rem 0;
    margin: 0 -0.5rem;
}

.blockchain-scroll-container::-webkit-scrollbar {
    height: 6px;
}

.blockchain-scroll-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 3px;
}

.blockchain-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(88, 166, 255, 0.3);
    border-radius: 3px;
}

.blockchain-explorer {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0.5rem;
    min-height: 200px;
}

/* 區塊卡片 */
.block-card {
    min-width: 280px;
    max-width: 300px;
    background: rgba(1, 4, 9, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.25rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
    position: relative;
}

.block-card:hover {
    border-color: rgba(88, 166, 255, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

/* Genesis 區塊特殊樣式 */
.block-card.genesis {
    border-color: rgba(255, 193, 7, 0.35);
    background: rgba(255, 193, 7, 0.05);
}

.block-card.genesis:hover {
    border-color: rgba(255, 193, 7, 0.6);
    box-shadow: 0 8px 25px rgba(255, 193, 7, 0.15);
}

/* 篡改狀態 */
.block-card.tampered {
    border-color: rgba(248, 81, 73, 0.6) !important;
    background: rgba(248, 81, 73, 0.08) !important;
    animation: tamperFlash 1.5s ease-in-out infinite;
}

@keyframes tamperFlash {
    0%, 100% { box-shadow: 0 0 0 0 rgba(248, 81, 73, 0); }
    50% { box-shadow: 0 0 20px 3px rgba(248, 81, 73, 0.25); }
}

/* 驗證通過狀態 */
.block-card.valid {
    border-color: rgba(63, 185, 80, 0.5) !important;
    box-shadow: 0 0 12px rgba(63, 185, 80, 0.15);
}

/* 區塊卡片內部 */
.block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.block-index {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
}

.block-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-genesis {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.badge-normal {
    background: rgba(88, 166, 255, 0.12);
    color: #58a6ff;
    border: 1px solid rgba(88, 166, 255, 0.25);
}

.block-data-preview {
    font-size: 0.85rem;
    color: #c9d1d9;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    margin-bottom: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.block-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.block-field:last-of-type {
    border-bottom: none;
}

.field-label {
    font-size: 0.75rem;
    color: #8b949e;
    font-weight: 500;
    min-width: 70px;
}

.field-value {
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.7rem;
    color: #a5d6ff;
    word-break: break-all;
    text-align: right;
}

.hash-value {
    color: #3fb950;
}

.prev-hash-value {
    color: #a371f7;
}

.block-hash-value {
    color: #58a6ff;
}

.block-timestamp {
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: #6e7681;
    text-align: right;
}

/* 區塊間箭頭 */
.chain-arrow {
    display: flex;
    align-items: center;
    min-width: 50px;
    padding: 0 0.25rem;
    flex-shrink: 0;
}

.chain-arrow-line {
    width: 30px;
    height: 2px;
    background: linear-gradient(to right, #a371f7, #58a6ff);
    position: relative;
}

.chain-arrow-head {
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 8px solid #58a6ff;
}

/* 滑入動畫 */
.slide-in {
    animation: slideIn 0.5s ease forwards;
    opacity: 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* ========================================================
   篡改偵測 Demo (Tamper Detection)
   ======================================================== */
.tamper-section {
    margin-top: 2rem;
}

.tamper-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tamper-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

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

.tamper-btn:active {
    transform: translateY(0);
}

.tamper-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.danger-btn {
    background: linear-gradient(135deg, #da3633 0%, #f85149 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(248, 81, 73, 0.3);
}

.danger-btn:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(248, 81, 73, 0.5);
}

.verify-btn {
    background: linear-gradient(135deg, #1f6feb 0%, #58a6ff 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(88, 166, 255, 0.3);
}

.verify-btn:hover {
    box-shadow: 0 6px 20px rgba(88, 166, 255, 0.5);
}

.reset-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #c9d1d9;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.reset-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

/* 篡改結果 Alerts */
.tamper-alert {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease;
}

.tamper-alert.danger {
    background: rgba(248, 81, 73, 0.08);
    border: 1px solid rgba(248, 81, 73, 0.3);
}

.tamper-alert.warning {
    background: rgba(255, 193, 7, 0.08);
    border: 1px solid rgba(255, 193, 7, 0.3);
}

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

.tamper-alert strong {
    color: #f85149;
    display: block;
    margin-bottom: 0.3rem;
}

.tamper-detail {
    font-size: 0.85rem;
    color: #8b949e;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
}

.tamper-hint {
    display: block;
    margin-top: 0.5rem;
    color: #58a6ff;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
}

/* 驗證結果 */
.verify-result {
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.4s ease;
}

.verify-pass {
    background: rgba(63, 185, 80, 0.06);
    border: 1px solid rgba(63, 185, 80, 0.3);
}

.verify-fail {
    background: rgba(248, 81, 73, 0.06);
    border: 1px solid rgba(248, 81, 73, 0.3);
}

.verify-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.verify-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

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

.verify-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    transition: background 0.2s;
}

.verify-row-fail {
    background: rgba(248, 81, 73, 0.08);
    border: 1px solid rgba(248, 81, 73, 0.15);
}

.verify-block-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #c9d1d9;
}

.verify-checks {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.check-pass {
    color: #3fb950;
}

.check-fail {
    color: #f85149;
    font-weight: 700;
}

/* 篡改解釋 */
.tamper-explanation {
    margin-top: 1rem;
    background: rgba(88, 166, 255, 0.05);
    border-left: 4px solid #58a6ff;
    padding: 1.25rem;
    border-radius: 0 10px 10px 0;
    animation: fadeIn 0.5s ease;
}

.tamper-explanation p {
    color: #c9d1d9;
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.tamper-explanation p:last-child {
    margin-bottom: 0;
}

.tamper-explanation strong {
    color: #58a6ff;
}

.tamper-explanation code {
    background: rgba(88, 166, 255, 0.1);
    color: #58a6ff;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Mining 動畫 */
.status-dot.mining {
    background-color: #f0883e;
    animation: miningPulse 0.6s ease-in-out infinite;
}

@keyframes miningPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(240, 136, 62, 0.4); transform: scale(1); }
    50% { box-shadow: 0 0 12px 3px rgba(240, 136, 62, 0.6); transform: scale(1.3); }
}

/* Responsive */
@media (max-width: 900px) {
    .app-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1rem;
    }

    .main-content-area {
        margin-left: 0;
        max-width: 100%;
        padding: 1rem;
    }

    .info-section, .generator-section {
        grid-template-columns: 1fr;
    }

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

    .demo-area {
        flex-direction: column;
    }

    .demo-arrow .arrow-line {
        width: 2px;
        height: 28px;
    }

    .demo-arrow .arrow-line::after {
        right: auto;
        left: 50%;
        top: auto;
        bottom: -4px;
        transform: translateX(-50%);
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-top: 6px solid #a371f7;
        border-bottom: none;
    }

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

    .compare-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .tamper-controls {
        flex-direction: column;
    }

    .tamper-btn {
        width: 100%;
    }

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