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

:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --secondary: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.8);
    --text: #f1f5f9;
    --text-dim: #94a3b8;
    --glass: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 50%, #1e3a5f 100%);
    min-height: 100vh;
    color: var(--text);
    overflow-x: hidden;
}

#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.container {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px 30px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.title {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
}

.params {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.param-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 1.1rem;
}

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

.value.editable {
    background: var(--glass);
    border: 2px dashed var(--primary);
    border-radius: 8px;
    padding: 4px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    color: var(--secondary);
}

.value.editable:hover {
    background: rgba(99, 102, 241, 0.3);
    border-color: var(--primary-light);
    transform: scale(1.05);
}

.value.editable.editing {
    border-style: solid;
    background: rgba(99, 102, 241, 0.4);
    outline: none;
}

.btn-change {
    margin-left: auto;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-change:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

/* 河面区域 */
.river-area {
    margin-bottom: 20px;
    position: relative;
    flex: 1 1 360px;
    min-height: 300px;
}

/* 河岸效果 */
.river-area::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(180deg, #2d5016 0%, #4a7c23 50%, #6fa832 100%);
    border-radius: 20px 20px 0 0;
    z-index: 1;
    box-shadow: 0 -5px 15px rgba(45, 80, 22, 0.3);
}

.river-area::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(0deg, #2d5016 0%, #4a7c23 50%, #6fa832 100%);
    border-radius: 0 0 20px 20px;
    z-index: 1;
    box-shadow: 0 5px 15px rgba(45, 80, 22, 0.3);
}

.river {
    position: relative;
    height: 100%;
    min-height: 300px;
    background: linear-gradient(180deg, #0c2d4a 0%, #1a5276 30%, #2196f3 60%, #1565c0 100%);
    border-radius: 20px;
    overflow: hidden;
    border: 3px solid rgba(96, 165, 250, 0.5);
    box-shadow: 
        0 10px 40px rgba(37, 99, 235, 0.4),
        inset 0 0 100px rgba(96, 165, 250, 0.3),
        0 0 60px rgba(33, 150, 243, 0.2);
}

/* 阳光反射效果 */
.river::after {
    content: '';
    position: absolute;
    top: 10%;
    left: 20%;
    width: 60%;
    height: 30%;
    background: 
        radial-gradient(ellipse at 30% 50%, rgba(255,255,255,0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 40%, rgba(255,255,255,0.3) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 60%, rgba(255,255,255,0.2) 0%, transparent 60%);
    animation: sunlight 5s ease-in-out infinite;
    pointer-events: none;
    z-index: 3;
}

@keyframes sunlight {
    0%, 100% {
        opacity: 0.6;
        transform: translateX(0) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateX(20px) scale(1.1);
    }
}

.water {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: 
        linear-gradient(90deg, 
            rgba(255,255,255,0.1) 0%, 
            transparent 5%, 
            rgba(255,255,255,0.08) 10%, 
            transparent 15%,
            rgba(255,255,255,0.05) 20%,
            transparent 25%,
            rgba(255,255,255,0.1) 30%,
            transparent 35%,
            rgba(255,255,255,0.08) 40%,
            transparent 45%,
            rgba(255,255,255,0.05) 50%,
            transparent 55%,
            rgba(255,255,255,0.1) 60%,
            transparent 65%,
            rgba(255,255,255,0.08) 70%,
            transparent 75%,
            rgba(255,255,255,0.05) 80%,
            transparent 85%,
            rgba(255,255,255,0.1) 90%,
            transparent 95%,
            rgba(255,255,255,0.08) 100%
        );
    animation: waterFlow 4.2s linear infinite;
    opacity: 0.6;
}

.water::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse 100px 30px at 10% 50%, rgba(255,255,255,0.3), transparent),
        radial-gradient(ellipse 80px 25px at 30% 40%, rgba(255,255,255,0.25), transparent),
        radial-gradient(ellipse 120px 35px at 50% 60%, rgba(255,255,255,0.2), transparent),
        radial-gradient(ellipse 90px 28px at 70% 45%, rgba(255,255,255,0.28), transparent),
        radial-gradient(ellipse 110px 32px at 90% 55%, rgba(255,255,255,0.22), transparent);
    animation: waterShimmer 2.8s ease-in-out infinite;
}

.water::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.3));
}

@keyframes waterFlow {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes waterShimmer {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.02); }
}

/* 水波纹效果 */
.river::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%23ffffff' fill-opacity='0.15' d='M0,192L48,197.3C96,203,192,213,288,229.3C384,245,480,267,576,250.7C672,235,768,181,864,181.3C960,181,1056,235,1152,234.7C1248,235,1344,181,1392,154.7L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E") repeat-x;
    background-size: 1440px 320px;
    animation: wave 3.4s linear infinite;
    opacity: 0.8;
    z-index: 1;
}

@keyframes wave {
    0% { transform: translateX(0); }
    100% { transform: translateX(-1440px); }
}

.ships-container {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.ship {
    position: absolute;
    isolation: isolate;
    background: transparent var(--boat-image) center bottom / contain no-repeat;
    border-radius: 0;
    padding: 26px 40px 40px;
    cursor: grab;
    transition: all 0.3s ease;
    box-shadow: none;
    user-select: none;
    border: 0;
    z-index: 2;
    transform-origin: center;
}

.ship::before {
    content: '';
    display: none;
}

.ship::after {
    content: '';
    display: none;
    position: absolute;
    left: 14px;
    right: 10px;
    bottom: 91px;
    height: 28px;
    background: var(--rim-fill);
    border-radius: 999px 999px 48% 52%;
    box-shadow: 0 5px 0 var(--rim-shadow);
    pointer-events: none;
    z-index: 2;
}

.ship-colliding {
    filter: brightness(0.95) saturate(0.9) drop-shadow(0 0 12px rgba(239, 68, 68, 0.8));
}

.fish-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.fish {
    position: absolute;
    top: var(--fish-y);
    width: calc(130px * var(--fish-size));
    height: calc(60px * var(--fish-size));
    opacity: 0;
    background: var(--fish-image) center / contain no-repeat;
    filter: drop-shadow(0 5px 5px rgba(0, 45, 70, 0.22));
}

.fish::before {
    content: none;
}

.fish::after {
    content: none;
}

.fish-gold {
    --fish-image: url('assets/fish/fish-gold-swim.webp');
}

.fish-blue {
    --fish-image: url('assets/fish/fish-blue-swim.webp');
}

.fish-pink {
    --fish-image: url('assets/fish/fish-pink-swim.webp');
}

.fish-striped {
    --fish-image: url('assets/fish/fish-striped-swim.webp');
}

.fish.swim-right {
    left: -140px;
    animation: fishSwimRight var(--fish-duration) linear forwards;
}

.fish.swim-left {
    right: -140px;
    transform: scaleX(-1);
    animation: fishSwimLeft var(--fish-duration) linear forwards;
}

@keyframes fishSwimRight {
    0% {
        opacity: 0;
        transform: translateX(0) translateY(0);
    }
    12%, 86% {
        opacity: 0.78;
    }
    45% {
        transform: translateX(48vw) translateY(10px) rotate(2deg);
    }
    100% {
        opacity: 0;
        transform: translateX(calc(100vw + 180px)) translateY(-4px);
    }
}

@keyframes fishSwimLeft {
    0% {
        opacity: 0;
        transform: scaleX(-1) translateX(0) translateY(0);
    }
    12%, 86% {
        opacity: 0.78;
    }
    45% {
        transform: scaleX(-1) translateX(48vw) translateY(8px) rotate(2deg);
    }
    100% {
        opacity: 0;
        transform: scaleX(-1) translateX(calc(100vw + 180px)) translateY(-5px);
    }
}

@keyframes boatReflection {
    0%, 100% { opacity: 0.6; transform: scaleX(1); }
    50% { opacity: 1; transform: scaleX(1.1); }
}

.ship:active {
    cursor: grabbing;
    transform: scale(1.05);
}

.ship:hover {
    filter: brightness(1.04);
}

.ship.big-ship {
    width: 280px;
    min-height: 168px;
    --boat-image: url('assets/boat-big-sprite.png');
    --boat-fill: linear-gradient(180deg, #19aee6 0%, #0796d4 60%, #087ebf 100%);
    --boat-border: 22px solid #f8fcff;
    --boat-depth: 0.1;
    --rim-fill: rgba(247, 252, 255, 0.96);
    --rim-shadow: rgba(196, 220, 230, 0.85);
}

.ship.small-ship {
    width: 226px;
    min-height: 148px;
    padding: 24px 34px 38px;
    --boat-image: url('assets/boat-small-sprite.png');
    --boat-fill: linear-gradient(180deg, #a9531d 0%, #8c4215 58%, #6d300f 100%);
    --boat-border: 12px solid #c78a56;
    --boat-depth: 0.22;
    --rim-fill: linear-gradient(180deg, #a85720, #884014);
    --rim-shadow: rgba(93, 42, 13, 0.72);
}

.ship-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

.ship-name {
    color: #fff2d0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.ship-cap {
    background: rgba(28, 13, 5, 0.42);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    color: #fff8dc;
    white-space: nowrap;
}

.ship-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--danger);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
}

.ship:hover .ship-close {
    opacity: 1;
}

.ship-close:hover {
    transform: scale(1.1);
    background: #dc2626;
}

.ship-passengers {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 42px;
    grid-template-rows: 64px;
    gap: 9px;
    align-items: end;
    justify-content: center;
    position: relative;
    z-index: 4;
    min-height: 70px;
    overflow: visible;
}

.passenger {
    width: 42px;
    height: 64px;
    background: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 27px;
    font-size: 1rem;
    font-weight: 700;
    animation: popIn 0.3s ease;
    box-shadow: none;
    color: white;
    text-shadow: 0 2px 2px rgba(125, 54, 70, 0.55);
    position: relative;
    overflow: hidden;
}

.seat {
    border: 0;
}

.seat.occupied {
    color: #eef2ff;
}

.person-number {
    position: relative;
    z-index: 3;
}

.person-avatar::before {
    content: '';
    display: none;
    position: absolute;
    top: 0;
    left: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 28% 52%, #22150d 0 2px, transparent 3px),
        radial-gradient(circle at 70% 52%, #22150d 0 2px, transparent 3px),
        radial-gradient(circle at 18% 75%, #ff99a8 0 4px, transparent 5px),
        radial-gradient(circle at 82% 75%, #ff99a8 0 4px, transparent 5px),
        #ffd7b6;
    box-shadow:
        inset 0 6px 0 #5a3218,
        0 1px 0 rgba(255,255,255,0.65);
    z-index: 2;
}

.person-avatar::after {
    content: '';
    display: none;
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: 0;
    height: 34px;
    background: #ff8194;
    border-radius: 14px 14px 4px 4px;
    z-index: 1;
}

.person-avatar.gender-male::after {
    background: linear-gradient(180deg, #6ab7ff, #3c82e6);
}

.person-avatar.gender-female::after {
    background: linear-gradient(180deg, #ff8ca0, #f45f82);
}

.person-avatar.gender-male {
    background: transparent url('assets/person-male-sprite.png') center bottom / contain no-repeat;
}

.person-avatar.gender-female {
    background: transparent url('assets/person-female-sprite.png') center bottom / contain no-repeat;
}

.seat.empty {
    height: 44px;
    align-self: end;
    padding-top: 0;
    color: #16556c;
    font-size: 0.74rem;
    text-shadow: none;
    background:
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.42) 0 4px, rgba(255, 255, 255, 0.05) 4px 8px),
        rgba(255, 255, 255, 0.68);
    border: 2px dashed rgba(19, 101, 128, 0.68);
    border-radius: 14px 14px 6px 6px;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.28);
}

.small-ship .seat.empty {
    color: #7a3511;
    border-color: rgba(123, 53, 17, 0.55);
    background:
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.34) 0 4px, rgba(255, 255, 255, 0.03) 4px 8px),
        rgba(255, 238, 202, 0.74);
}

.ship-badge {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    z-index: 5;
    min-width: 132px;
    padding: 7px 14px;
    border-radius: 10px;
    text-align: center;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0;
    color: #15536a;
    background: rgba(250, 254, 255, 0.94);
    border: 3px solid rgba(117, 213, 235, 0.9);
    box-shadow: 0 7px 16px rgba(31, 82, 98, 0.18);
    white-space: nowrap;
}

.small-ship .ship-badge {
    color: #72340f;
    background: rgba(255, 250, 235, 0.96);
    border-color: rgba(231, 181, 62, 0.95);
}

.water-ripple {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 72%;
    height: 18px;
    background: radial-gradient(ellipse, rgba(255,255,255,0.3) 0%, transparent 70%);
    animation: rippleContinuous 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes rippleContinuous {
    0%, 100% {
        opacity: 0.3;
        transform: translateX(-50%) scaleX(0.8);
    }
    50% {
        opacity: 0.8;
        transform: translateX(-50%) scaleX(1.2);
    }
}

@keyframes popIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* 候船区 */
.waiting-area {
    position: relative;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    min-height: 120px;
    flex: 0 0 auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.area-label {
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--primary);
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.people-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    padding-top: 10px;
}

.person {
    width: 42px;
    height: 64px;
    background: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 27px;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 2px rgba(75, 40, 54, 0.48);
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    position: relative;
    overflow: hidden;
    animation: popIn 0.3s ease;
    box-shadow: none;
}

.person:hover {
    transform: translateY(-3px) scale(1.04);
    filter: brightness(1.08);
}

.person.selected {
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.9));
    transform: translateY(-4px) scale(1.08);
}

.person.selected::after {
    display: block;
    content: '';
    position: absolute;
    inset: 8px 4px 0;
    border-radius: 12px;
    pointer-events: none;
    outline: 3px solid rgba(245, 158, 11, 0.92);
    outline-offset: -2px;
    background: transparent;
    z-index: 0;
}

.selection-box {
    position: absolute;
    border: 2px dashed var(--primary);
    background: rgba(99, 102, 241, 0.2);
    border-radius: 5px;
    pointer-events: none;
    display: none;
}

/* 底部控制区 */
.controls {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.control-group {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-ship {
    background: var(--glass);
    border: 2px solid var(--glass-border);
    color: var(--text);
}

.btn-ship.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

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

.btn-undo {
    background: var(--glass);
    border: 2px solid var(--glass-border);
    color: var(--text);
}

.btn-undo:hover {
    background: rgba(99, 102, 241, 0.3);
    border-color: var(--primary);
}

.btn-save {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

.btn-compare {
    background: linear-gradient(135deg, var(--secondary), #d97706);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.btn-compare:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
}

.btn-reset {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
}

.verify-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.verify-label {
    color: var(--text-dim);
    font-size: 1rem;
}

.verify-input {
    width: 100px;
    padding: 10px 15px;
    border: 2px solid var(--glass-border);
    border-radius: 10px;
    background: var(--glass);
    color: var(--text);
    font-size: 1rem;
    text-align: center;
}

.verify-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.btn-verify {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-verify:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

/* 统计信息 */
.stats {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    flex: 0 0 auto;
}

.stat-item {
    text-align: center;
}

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

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 算式区域 */
.formula-area {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    flex: 0 0 auto;
}

.formula-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--primary-light);
}

.formula-content {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    color: var(--text);
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    min-height: 50px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid var(--glass-border);
}

.modal-header h2 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-close {
    width: 36px;
    height: 36px;
    background: var(--glass);
    border: none;
    border-radius: 50%;
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-close:hover {
    background: var(--danger);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

.no-data {
    text-align: center;
    color: var(--text-dim);
    font-size: 1.1rem;
    padding: 40px;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
}

.compare-table th,
.compare-table td {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid var(--glass-border);
}

.compare-table th {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
    font-weight: 600;
}

.compare-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.compare-row {
    animation: fadeIn 0.5s ease;
}

/* 提示框 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: var(--bg-card);
    border: 2px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px 50px;
    font-size: 1.5rem;
    font-weight: 600;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.toast.success {
    border-color: var(--success);
    color: var(--success);
}

.toast.error {
    border-color: var(--danger);
    color: var(--danger);
}

.toast.info {
    border-color: var(--primary);
    color: var(--primary-light);
}

/* 动画 */
@keyframes float {
    0%, 100% { 
        transform: translateY(0); 
        filter: brightness(1);
    }
    25% { 
        transform: translateY(-8px); 
        filter: brightness(1.05);
    }
    50% { 
        transform: translateY(-12px); 
        filter: brightness(1.1);
    }
    75% { 
        transform: translateY(-6px); 
        filter: brightness(1.05);
    }
}

@keyframes floatSmall {
    0%, 100% { 
        transform: translateY(0); 
        filter: brightness(1);
    }
    25% { 
        transform: translateY(-10px); 
        filter: brightness(1.05);
    }
    50% { 
        transform: translateY(-15px); 
        filter: brightness(1.1);
    }
    75% { 
        transform: translateY(-8px); 
        filter: brightness(1.05);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

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

@keyframes ripple {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

@keyframes splash {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(
            calc(cos(var(--angle)) * var(--distance)),
            calc(sin(var(--angle)) * var(--distance) - 30px)
        ) scale(0);
        opacity: 0;
    }
}

@keyframes lotusFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-5px) rotate(3deg);
    }
}

@keyframes seaweedSway {
    0%, 100% {
        transform: rotate(-5deg);
    }
    50% {
        transform: rotate(5deg);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 
            0 8px 32px rgba(0, 0, 0, 0.4),
            0 0 20px rgba(255, 143, 0, 0.3);
    }
    50% {
        box-shadow: 
            0 8px 32px rgba(0, 0, 0, 0.4),
            0 0 40px rgba(255, 143, 0, 0.5),
            0 0 60px rgba(255, 143, 0, 0.3);
    }
}

.ship {
    animation: float 4s ease-in-out infinite, shipAppear 0.5s ease-out;
}

.ship:nth-child(even) {
    animation: floatSmall 3.5s ease-in-out infinite, shipAppear 0.5s ease-out;
    animation-delay: -1.75s, 0s;
}

.ship:nth-child(3n) {
    animation-duration: 4.5s, 0.5s;
}

.ship:nth-child(4n) {
    animation-delay: -2.25s, 0s;
}

@keyframes shipAppear {
    0% {
        transform: scale(0.5) translateY(50px);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) translateY(-10px);
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* 船只阴影在水面上的效果 */
.ship-shadow {
    position: absolute;
    bottom: 0;
    left: 13%;
    width: 80%;
    height: 24px;
    background: radial-gradient(ellipse, rgba(0,0,0,0.3) 0%, transparent 70%);
    filter: blur(8px);
    animation: shadowPulse 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shadowPulse {
    0%, 100% {
        opacity: 0.4;
        transform: scaleX(0.9);
    }
    50% {
        opacity: 0.7;
        transform: scaleX(1.1);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .params {
        justify-content: center;
    }

    .btn-change {
        margin-left: 0;
    }

    .river {
        min-height: 260px;
    }

    .ship.big-ship {
        width: 246px;
    }

    .ship.small-ship {
        width: 208px;
    }

    .controls {
        flex-direction: column;
    }

    .control-group {
        flex-wrap: wrap;
        justify-content: center;
    }

    .verify-group {
        margin-left: 0;
        flex-wrap: wrap;
        justify-content: center;
    }

    .stats {
        gap: 10px;
    }

    .stat-value {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.5rem;
    }

    .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .container {
        padding: 12px;
    }

    .ship {
        transform: scale(0.86);
        transform-origin: left top;
    }
}
