:root {
    --primary: #A82020;
    --secondary: #F5EFE0;
    --dark: #222222;
    --gray: #8A9A94;
    --gold: #D4AF37;
    --jade: #2E8B57;
    --sky: #87CEEB;
    --purple: #9370DB;
    --pink: #FF69B4;
    --orange: #FF8C00;
    --cyan: #00CED1;
    --ivory: #FCF8F0;
    --cream: #FAF5EB;
    --apricot: #F8EDE3;
    --blush: #F5E6E0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--secondary);
    color: var(--dark);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Noto Serif SC', serif;
}

.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.scroll-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.nav-shadow {
    box-shadow: 0 4px 20px rgba(168, 32, 32, 0.1);
}

.btn-embroidery {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-embroidery::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 0L12 5L10 10L8 5L10 0M0 10L5 12L10 10L5 8L0 10M20 10L15 12L10 10L15 8L20 10M10 20L12 15L10 10L8 15L10 20' fill='none' stroke='rgba(168,32,32,0.1)' stroke-width='0.5'/%3E%3C/svg%3E");
    transition: left 0.5s ease;
}

.btn-embroidery:hover::before {
    left: 0;
}

.btn-embroidery:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 32, 32, 0.3);
}

.btn-embroidery:active {
    transform: translateY(0);
}

.scroll-animation {
    animation: scroll-open 1.5s ease-out forwards;
}

@keyframes scroll-open {
    0% {
        clip-path: inset(0 0 100% 0);
    }
    100% {
        clip-path: inset(0 0 0 0);
    }
}

.line-pattern {
    background-image: linear-gradient(90deg, var(--primary) 2px, transparent 2px),
                    linear-gradient(var(--primary) 2px, transparent 2px);
    background-size: 20px 20px;
}

.hero-bg {
    background: linear-gradient(135deg, rgba(168, 32, 32, 0.05) 0%, rgba(245, 239, 224, 0.9) 100%);
}

.breadcrumb-link {
    transition: all 0.3s ease;
}

.breadcrumb-link:hover {
    color: var(--primary);
    padding-left: 4px;
}

.post-card {
    transition: all 0.3s ease;
}

.post-card:hover {
    transform: translateY(-3px);
}

.comment-input {
    transition: all 0.3s ease;
}

.comment-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(168, 32, 32, 0.1);
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    max-width: 90%;
    max-height: 90vh;
    overflow: auto;
}

.timeline-item {
    position: relative;
    padding-left: 30px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--primary);
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 20px;
    width: 2px;
    height: calc(100% + 10px);
    background-color: rgba(168, 32, 32, 0.2);
}

.timeline-item:last-child::after {
    display: none;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--primary);
}

.form-input {
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(168, 32, 32, 0.1);
}

.error {
    border-color: var(--primary) !important;
    background-color: rgba(168, 32, 32, 0.05) !important;
}

.image-zoom-container {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.image-zoom-container:hover {
    transform: scale(1.02);
}

.canvas-container {
    background-image: 
        linear-gradient(to right, #e0d8c8 1px, transparent 1px),
        linear-gradient(to bottom, #e0d8c8 1px, transparent 1px);
    background-size: 20px 20px;
}

.stitch-preview {
    transition: all 0.3s ease;
}

.stitch-preview:hover {
    transform: scale(1.1);
}

.master-card {
    transition: all 0.3s ease;
}

.master-card:hover {
    transform: translateY(-5px);
}

.gallery-item {
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.color-picker {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.color-picker:hover {
    transform: scale(1.2) rotate(15deg);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.color-picker.active {
    border-color: var(--gold);
    transform: scale(1.15);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.5), 0 4px 16px rgba(0, 0, 0, 0.3);
}

.stitch-type {
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    background: linear-gradient(135deg, #fff 0%, #f8f6f2 100%);
    font-weight: 500;
}

.stitch-type:hover {
    transform: translateX(5px);
    border-color: var(--primary);
    background: linear-gradient(135deg, #fff 0%, #fff5f5 100%);
}

.stitch-type.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--primary) 0%, #c93030 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(168, 32, 32, 0.3);
}

.line-width-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fff 0%, #f8f6f2 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.line-width-btn:hover {
    transform: scale(1.1);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(168, 32, 32, 0.2);
}

.line-width-btn.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--primary) 0%, #c93030 100%);
    box-shadow: 0 4px 12px rgba(168, 32, 32, 0.3);
}

.line-width-btn.active .dot {
    background-color: white !important;
}

.tool-btn {
    position: relative;
    padding: 14px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    background: linear-gradient(135deg, #fff 0%, #f8f6f2 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tool-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.tool-btn:active {
    transform: translateY(-1px);
}

.tool-btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #c93030 100%);
    color: white;
}

.tool-btn-primary:hover {
    background: linear-gradient(135deg, #c93030 0%, #a82020 100%);
}

.tool-btn-secondary {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: white;
}

.tool-btn-secondary:hover {
    background: var(--primary);
    color: white;
}

.tool-btn svg {
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
}

.tool-btn:hover svg {
    transform: scale(1.2);
}

#canvas {
    cursor: crosshair;
    border: 4px solid var(--primary);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(168, 32, 32, 0.2);
}

.tool-panel {
    background: linear-gradient(135deg, #fff 0%, var(--secondary) 100%);
    border: 2px solid var(--primary);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(168, 32, 32, 0.15);
}

.tool-panel h3 {
    color: var(--primary);
    font-size: 1.1rem;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px dashed rgba(168, 32, 32, 0.2);
}

.custom-color-panel {
    border-top: 2px dashed rgba(168, 32, 32, 0.2);
    padding-top: 16px;
}

.color-picker-wrapper {
    position: relative;
    display: inline-block;
}

.custom-color-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 48px;
    height: 48px;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.color-preview {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(168, 32, 32, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.color-preview:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3), 0 0 0 4px rgba(168, 32, 32, 0.4);
}

.color-preview.active {
    border-color: #D4AF37;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.5), 0 4px 12px rgba(0, 0, 0, 0.2);
}

.color-picker {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.color-picker:hover {
    transform: scale(1.2) rotate(15deg);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.color-picker.active {
    border-color: white;
    box-shadow: 0 0 0 3px rgba(168, 32, 32, 0.5), 0 4px 16px rgba(0, 0, 0, 0.3);
}

#rgb-value {
    font-family: 'Noto Sans SC', sans-serif;
    color: var(--dark);
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.modal-overlay.show {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--ivory);
    border-radius: 24px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(168, 32, 32, 0.3);
    transform: scale(0.8);
    opacity: 0;
    animation: modalOpen 0.3s ease-out forwards;
    border: 2px solid;
    border-image: linear-gradient(135deg, var(--primary), rgba(168, 32, 32, 0.3), var(--primary)) 1;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .modal-content {
        width: 75%;
    }
}

@keyframes modalOpen {
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-overlay.hide .modal-content {
    animation: modalClose 0.3s ease-out forwards;
}

@keyframes modalClose {
    to {
        transform: scale(0.8);
        opacity: 0;
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(168, 32, 32, 0.1);
    color: var(--primary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close:hover {
    background: var(--primary);
    color: white;
    transform: rotate(90deg);
}

.modal-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

@media (min-width: 768px) {
    .modal-image {
        height: 300px;
    }
}

.modal-header {
    position: relative;
    flex-shrink: 0;
}

.modal-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
    padding-bottom: 12px;
    border-bottom: 2px dashed rgba(168, 32, 32, 0.2);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-description {
    color: var(--dark);
    line-height: 1.8;
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.modal-description p {
    margin-bottom: 12px;
    text-align: justify;
}

.modal-description p:last-child {
    margin-bottom: 0;
}

.modal-features {
    background: linear-gradient(135deg, rgba(168, 32, 32, 0.03), rgba(245, 239, 224, 0.5));
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
}

.modal-features h4 {
    font-family: 'Noto Serif SC', serif;
    color: var(--primary);
    margin-bottom: 12px;
    font-size: 1rem;
}

.modal-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-features li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    color: var(--dark);
    font-size: 0.9rem;
}

.modal-features li::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
}

.modal-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.modal-gallery img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
}

@media (min-width: 768px) {
    .modal-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .modal-gallery img {
        height: 150px;
    }
}

.card-gradient-1 {
    background: linear-gradient(135deg, rgba(237, 213, 218, 0.4) 0%, rgba(232, 187, 195, 0.2) 100%);
    box-shadow: 0 2px 8px rgba(168, 32, 32, 0.08);
}

.card-gradient-2 {
    background: linear-gradient(135deg, rgba(205, 133, 98, 0.35) 0%, rgba(188, 120, 85, 0.15) 100%);
    box-shadow: 0 2px 8px rgba(168, 32, 32, 0.08);
}

.card-gradient-3 {
    background: linear-gradient(135deg, rgba(130, 168, 140, 0.35) 0%, rgba(105, 145, 118, 0.15) 100%);
    box-shadow: 0 2px 8px rgba(168, 32, 32, 0.08);
}

.card-gradient-4 {
    background: linear-gradient(135deg, rgba(212, 175, 100, 0.35) 0%, rgba(198, 160, 70, 0.15) 100%);
    box-shadow: 0 2px 8px rgba(168, 32, 32, 0.08);
}

.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.card-hover:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(168, 32, 32, 0.18), 0 0 0 1px rgba(168, 32, 32, 0.3);
}

.border-gradient {
    border: 1px solid rgba(168, 32, 32, 0.25);
}

/* stitches.html 针法卡片悬浮效果 */
.stitch-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.stitch-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(168, 32, 32, 0.2), 0 0 0 1px rgba(168, 32, 32, 0.35);
}

.stitch-card:active {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(168, 32, 32, 0.15);
}