/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f0f4f8;
    color: #333;
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部样式 */
header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

.logo a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 1.8rem;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

nav a:hover {
    background-color: #34495e;
}

nav span {
    color: #ecf0f1;
}

/* 主内容区样式 */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 160px);
}

/* 工具卡片样式 */
.tools-section {
    text-align: center;
    margin-bottom: 2rem;
}

.tools-section h1 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.tool-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.tool-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
}

.tool-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tool-card h3 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.tool-card p {
    color: #7f8c8d;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* 工具页面样式 */
.tool-section {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.tool-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
}

.tool-header h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.tool-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 按钮样式 */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.3s;
    text-align: center;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #ecf0f1;
    color: #333;
}

.btn-secondary:hover {
    background-color: #dcdde1;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    position: relative;
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
}

.close-btn:hover {
    color: #333;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group small {
    color: #7f8c8d;
    display: block;
    margin-top: 0.25rem;
}

.form-options {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.form-options a {
    color: #3498db;
    text-decoration: none;
}

.form-options a:hover {
    text-decoration: underline;
}

.code-input-group {
    display: flex;
    gap: 10px;
}

.code-input-group input {
    flex-grow: 1;
}

/* 消息提示样式 */
.error-message, .success-message {
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    text-align: center;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
}

/* 认证页面样式 */
.auth-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.auth-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

/* 附魔计算器样式 */
.enchantment-calculator {
    background-color: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
}

.enchantments-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 1rem;
}

.enchantment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.5rem;
    background-color: white;
    border-radius: 4px;
    border: 1px solid #eee;
}

.results-section {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

#enchantment-results {
    margin-top: 1rem;
    padding: 1rem;
    background-color: white;
    border-radius: 4px;
    min-height: 100px;
}

/* 页脚样式 */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 1.5rem 0;
    text-align: center;
}

footer a {
    color: #3498db;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* 响应式样式 */
@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    nav {
        width: 100%;
        justify-content: center;
    }
}
