/* 装饰元素 */
.tool-container {
    position: relative;
    overflow: hidden;
}

.pickaxe-decoration {
    position: absolute;
    top: 20px;
    left: -20px;
    width: 80px;
    height: 80px;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><rect x="2" y="2" width="12" height="4" fill="%23A0A0A0"/><rect x="2" y="6" width="4" height="4" fill="%23A0A0A0"/><rect x="6" y="10" width="4" height="4" fill="%238B4513"/><rect x="10" y="14" width="4" height="4" fill="%238B4513"/><rect x="14" y="18" width="4" height="4" fill="%238B4513"/><rect x="18" y="22" width="4" height="4" fill="%238B4513"/></svg>');
    background-size: cover;
    transform: rotate(-15deg);
    opacity: 0.8;
    z-index: 0;
    image-rendering: pixelated;
    display: none; /* 在大屏幕上才显示 */
}

.ore-decoration {
    position: absolute;
    bottom: 30px;
    right: -15px;
    width: 70px;
    height: 70px;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><rect x="0" y="0" width="32" height="32" fill="%23666666"/><rect x="8" y="4" width="4" height="4" fill="%2355FFFF"/><rect x="16" y="8" width="4" height="4" fill="%2355FFFF"/><rect x="12" y="12" width="4" height="4" fill="%2355FFFF"/><rect x="20" y="16" width="4" height="4" fill="%2355FFFF"/><rect x="8" y="20" width="4" height="4" fill="%2355FFFF"/><rect x="16" y="24" width="4" height="4" fill="%2355FFFF"/></svg>');
    background-size: cover;
    transform: rotate(10deg);
    opacity: 0.8;
    z-index: 0;
    image-rendering: pixelated;
    display: none; /* 在大屏幕上才显示 */
}

/* 计算器容器 */
.calculator-container {
    position: relative;
    background: var(--minecraft-panel);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
    border: 2px solid var(--minecraft-secondary);
    z-index: 1;
    border-radius: 2px;
}

.calculator-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEklEQVQImWNgYGD4z8DAwMAAADgDAKdD8tMAAAAASUVORK5CYII=');
    background-size: 2px 2px;
    opacity: 0.05;
    z-index: -1;
}

.calculator-container h2 {
    color: var(--minecraft-green);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--minecraft-secondary);
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
}

.section-subtitle {
    color: #CCCCCC;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-style: italic;
    opacity: 0.9;
}

/* 表单样式 */
.calculator-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: bold;
    color: #E0E0E0;
    font-size: 1.1rem;
}

.minecraft-select {
    padding: 0.75rem;
    background-color: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--minecraft-secondary);
    color: white;
    font-family: 'VT323', monospace;
    font-size: 1rem;
    border-radius: 2px;
    box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.3);
}

.minecraft-select:focus {
    outline: none;
    border-color: var(--minecraft-green);
    box-shadow: 0 0 0 2px rgba(68, 189, 50, 0.2);
}

.minecraft-select option {
    background-color: var(--minecraft-dark);
    color: white;
    padding: 0.5rem;
}

.minecraft-select optgroup {
    background-color: var(--minecraft-secondary);
    color: var(--minecraft-green);
    font-weight: bold;
}

/* 效果和条件区域 */
.effects-section, .conditions-section {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border: 1px solid var(--minecraft-secondary);
    border-radius: 2px;
    margin-top: 1rem;
}

.effects-section h3, .conditions-section h3 {
    color: var(--minecraft-green);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
}

.effects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.effect-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.effect-group label {
    font-size: 1rem;
    color: #CCCCCC;
}

.conditions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.condition-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.minecraft-checkbox {
    width: 18px;
    height: 18px;
    appearance: none;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--minecraft-secondary);
    position: relative;
    cursor: pointer;
}

.minecraft-checkbox:checked {
    background: var(--minecraft-green);
    border-color: var(--minecraft-green);
}

.minecraft-checkbox:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-weight: bold;
    font-size: 12px;
    top: -2px;
    left: 2px;
}

.condition-check label {
    color: #E0E0E0;
    cursor: pointer;
    font-size: 1rem;
}

/* 计算按钮 */
.minecraft-btn.primary {
    background: linear-gradient(to bottom, var(--minecraft-green), #2a7a1a);
    border: 3px solid var(--minecraft-secondary);
    color: white;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-family: 'VT323', monospace;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
    border-radius: 2px;
    margin-top: 1rem;
}

.minecraft-btn.primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.3s ease;
}

.minecraft-btn.primary:hover::before {
    left: 100%;
}

.minecraft-btn.primary:hover {
    background: linear-gradient(to bottom, #4CAF50, var(--minecraft-green));
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
}

.minecraft-btn.primary:active {
    transform: translateY(2px);
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.3);
}

/* 结果容器 */
.results-container {
    background: var(--minecraft-panel);
    padding: 2rem;
    margin-top: 2rem;
    border: 2px solid var(--minecraft-secondary);
    border-radius: 2px;
    position: relative;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEklEQVQImWNgYGD4z8DAwMAAADgDAKdD8tMAAAAASUVORK5CYII=');
    background-size: 2px 2px;
    opacity: 0.05;
    z-index: -1;
}

.results-container h3 {
    color: var(--minecraft-green);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--minecraft-secondary);
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-card {
    background: rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    border: 2px solid var(--minecraft-secondary);
    border-radius: 2px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(68, 189, 50, 0.1) 50%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.result-card:hover::before {
    opacity: 1;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.3);
    border-color: var(--minecraft-green);
}

.result-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.result-content {
    position: relative;
    z-index: 1;
}

.result-content h4 {
    color: #E0E0E0;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
}

.result-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--minecraft-green);
    margin-bottom: 0.5rem;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
    font-family: 'VT323', monospace;
}

.result-subtitle {
    color: #AAAAAA;
    font-size: 0.9rem;
}

/* 优化建议 */
.optimization-tips {
    background: rgba(59, 133, 38, 0.1);
    padding: 1.5rem;
    border-left: 4px solid var(--minecraft-green);
    border-radius: 2px;
    margin-top: 1.5rem;
}

.optimization-tips h4 {
    color: var(--minecraft-green);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
}

.tip-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tip-icon {
    color: var(--minecraft-green);
    font-size: 1.2rem;
    margin-top: 0.2rem;
}

.tip-text {
    color: #CCCCCC;
    line-height: 1.4;
}

/* 挖掘指南 */
.mining-guide {
    background: var(--minecraft-panel);
    padding: 2rem;
    position: relative;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
    border: 2px solid var(--minecraft-secondary);
    z-index: 1;
    border-radius: 2px;
}

.mining-guide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEklEQVQImWNgYGD4z8DAwMAAADgDAKdD8tMAAAAASUVORK5CYII=');
    background-size: 2px 2px;
    opacity: 0.05;
    z-index: -1;
}

.mining-guide h2 {
    margin-bottom: 1.5rem;
    color: var(--minecraft-green);
    border-bottom: 2px solid var(--minecraft-secondary);
    padding-bottom: 0.5rem;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
}

.guide-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.guide-section {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border: 1px solid var(--minecraft-secondary);
    border-radius: 2px;
    position: relative;
}

.guide-section h3 {
    color: var(--minecraft-green);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
}

.guide-section p {
    color: #AAAAAA;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.guide-section ul {
    list-style: none;
    padding: 0;
}

.guide-section li {
    color: #CCCCCC;
    margin-bottom: 0.75rem;
    padding-left: 1rem;
    position: relative;
    line-height: 1.4;
}

.guide-section li::before {
    content: '⛏️';
    position: absolute;
    left: 0;
    color: var(--minecraft-green);
}

.guide-section li strong {
    color: var(--minecraft-green);
}

/* 响应式设计 */
@media (min-width: 992px) {
    .pickaxe-decoration,
    .ore-decoration {
        display: block;
    }
}

@media (max-width: 768px) {
    .calculator-container,
    .results-container,
    .mining-guide {
        padding: 1.5rem;
    }

    .effects-grid,
    .conditions-grid {
        grid-template-columns: 1fr;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .guide-sections {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .result-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .calculator-container,
    .results-container,
    .mining-guide {
        padding: 1rem;
    }

    .minecraft-btn.primary {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    .result-value {
        font-size: 1.3rem;
    }

    .result-icon {
        font-size: 2rem;
    }
}

/* 加载动画 */
.calculating {
    opacity: 0.7;
    pointer-events: none;
}

.calculating .minecraft-btn.primary {
    background: #666666;
    cursor: not-allowed;
}

.calculating .minecraft-btn.primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
