/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", sans-serif;
}

body {
    background-color: #f5f9f0;
    padding: 20px;
}

/* 头部样式 */
.header {
    background-color: #4CAF50;
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    font-size: 16px;
}

.user-info span {
    font-weight: bold;
    margin-right: 15px;
}

.logout-btn {
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
}

.logout-btn:hover {
    background-color: #ff4949;
}

/* 容器样式 */
.container {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.title {
    color: #2E7D32;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* 登录/注册表单样式 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
}

.form-group input {
    width: 300px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.submit-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.submit-btn:hover {
    background-color: #388E3C;
}

.switch-form {
    margin-top: 15px;
    color: #666;
}

.switch-form a {
    color: #4CAF50;
    text-decoration: none;
}

.switch-form a:hover {
    text-decoration: underline;
}

/* 农场耕地样式 */
.lands-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.land {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 12px;
    cursor: pointer;
    position: relative;
}

.land-idle {
    background-color: #8D6E63;
    border: 2px solid #5D4037;
}

.land-growing {
    background-color: #8BC34A;
    border: 2px solid #689F38;
}

.land-harvestable {
    background-color: #FFC107;
    border: 2px solid #FFA000;
}

.land-withered {
    background-color: #9E9E9E;
    border: 2px solid #616161;
}

.land:hover {
    opacity: 0.9;
}

/* 商店样式 */
.shop-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.shop-table th, .shop-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.shop-table th {
    background-color: #f1f8e9;
    color: #2E7D32;
}

.shop-table tr:hover {
    background-color: #f9fcf7;
}

.buy-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.buy-btn:hover {
    background-color: #388E3C;
}

/* 导航样式 */
.nav {
    margin-bottom: 20px;
}

.nav a {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    margin-right: 10px;
    font-size: 14px;
}

.nav a:hover {
    background-color: #388E3C;
}

/* 提示框样式 */
.alert {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    z-index: 9999;
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.alert-success {
    background-color: #4CAF50;
}

.alert-error {
    background-color: #ff6b6b;
}

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

/* 播种弹窗样式（简易） */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    width: 300px;
}

.modal-title {
    color: #2E7D32;
    margin-bottom: 15px;
    font-size: 18px;
}

.modal-seed {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    cursor: pointer;
}

.modal-seed:hover {
    background-color: #f1f8e9;
}

.modal-btns {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.modal-btn {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.modal-confirm {
    background-color: #4CAF50;
    color: white;
    border: none;
}

.modal-cancel {
    background-color: #eee;
    color: #555;
    border: none;
}


/* 收获成功弹窗样式（确保默认隐藏） */
/* 收获成功弹窗（强制隐藏+居中+遮罩） */
.harvest-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0,0,0,0.7) !important;
    display: none !important; /* 强制隐藏，默认不显示 */
    justify-content: center !important;
    align-items: center !important;
    z-index: 9999 !important; /* 最高层级，覆盖所有内容 */
    margin: 0 !important;
    padding: 0 !important;
}

.harvest-modal-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: relative;
    z-index: 10000;
}

.harvest-modal-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.harvest-modal-close {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
}

.harvest-modal-close:hover {
    background-color: #388E3C;
}

.harvest-audio {
    display: none !important; /* 彻底隐藏播放器 */
}