/* 岚泽农场 - 全局样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #a8e063 0%, #56ab2f 100%);
    min-height: 100vh;
    color: #333;
}
a { color: #4a9c2d; text-decoration: none; }
a:hover { text-decoration: underline; }

/* 登录/注册页面 */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}
.auth-box {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}
.auth-box h1 {
    text-align: center;
    color: #4a9c2d;
    margin-bottom: 8px;
    font-size: 28px;
}
.auth-box .subtitle {
    text-align: center;
    color: #999;
    margin-bottom: 30px;
    font-size: 14px;
}
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}
.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
    outline: none;
}
.form-group input:focus { border-color: #4a9c2d; }
.input-group { display: flex; gap: 10px; }
.input-group input { flex: 1; }
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}
.btn-primary {
    background: linear-gradient(135deg, #56ab2f, #4a9c2d);
    color: #fff;
    width: 100%;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(74,156,45,0.4); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-code {
    background: #f0f7ec;
    color: #4a9c2d;
    border: 2px solid #4a9c2d;
    white-space: nowrap;
    padding: 12px 16px;
    font-size: 13px;
}
.btn-code:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: #666;
}

/* 游戏主页面 */
.game-header {
    background: rgba(255,255,255,0.95);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}
.game-header .logo { font-size: 20px; font-weight: bold; color: #4a9c2d; }
.game-header .user-info { display: flex; align-items: center; gap: 20px; }
.game-header .stat {
    background: #f0f7ec;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}
.game-header .stat.gold { color: #d4a017; }
.game-header .stat.level { color: #4a9c2d; }
.game-header .btn-logout {
    background: #ff6b6b;
    color: #fff;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    border: none;
    cursor: pointer;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
.game-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}
.game-tab {
    padding: 10px 24px;
    background: rgba(255,255,255,0.8);
    border: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
}
.game-tab.active {
    background: #fff;
    color: #4a9c2d;
    border-bottom: 3px solid #4a9c2d;
}

/* 农田 */
.farm-panel {
    background: #fff;
    border-radius: 0 12px 12px 12px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.farm-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.land-cell {
    aspect-ratio: 1;
    background: linear-gradient(145deg, #8B4513, #654321);
    border: 3px solid #5D3A1A;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
    font-size: 32px;
}
.land-cell:hover { transform: scale(1.05); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.land-cell.locked {
    background: #ccc;
    border-color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}
.land-cell.empty { color: #fff; font-size: 14px; }
.land-cell.growing { background: linear-gradient(145deg, #6B8E23, #556B2F); }
.land-cell.mature {
    background: linear-gradient(145deg, #FFD700, #FFA500);
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,215,0,0.7); }
    50% { box-shadow: 0 0 0 10px rgba(255,215,0,0); }
}
.land-cell .crop-icon { font-size: 36px; }
.land-cell .crop-name { font-size: 11px; color: #fff; margin-top: 4px; }
.land-cell .timer {
    position: absolute;
    bottom: 4px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
}
.land-cell .harvest-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #ff6b6b;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

/* 商店 */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}
.shop-item {
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s;
}
.shop-item:hover { border-color: #4a9c2d; transform: translateY(-2px); }
.shop-item.locked { opacity: 0.5; }
.shop-item .item-icon { font-size: 40px; margin-bottom: 8px; }
.shop-item .item-name { font-weight: bold; margin-bottom: 4px; }
.shop-item .item-price { color: #d4a017; font-weight: bold; margin-bottom: 4px; }
.shop-item .item-info { font-size: 12px; color: #999; margin-bottom: 10px; }
.shop-item .btn-buy {
    width: 100%;
    padding: 8px;
    background: #4a9c2d;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.shop-item .btn-buy:disabled { background: #ccc; cursor: not-allowed; }

/* 仓库 */
.warehouse-list { display: flex; flex-direction: column; gap: 10px; }
.warehouse-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f9f9f9;
    border-radius: 8px;
    gap: 16px;
}
.warehouse-item .w-icon { font-size: 32px; }
.warehouse-item .w-info { flex: 1; }
.warehouse-item .w-name { font-weight: bold; }
.warehouse-item .w-quantity { color: #666; font-size: 13px; }
.warehouse-item .w-price { color: #d4a017; font-weight: bold; }
.warehouse-item .btn-sell {
    padding: 8px 20px;
    background: #d4a017;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

/* 公告 */
.announcement-list { margin-bottom: 20px; }
.announcement-item {
    background: #fffbe6;
    border-left: 4px solid #faad14;
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: 0 6px 6px 0;
}
.announcement-item .ann-title { font-weight: bold; margin-bottom: 4px; }
.announcement-item .ann-content { font-size: 14px; color: #666; }

/* 扩建按钮 */
.expand-section {
    text-align: center;
    padding: 20px;
    background: #f0f7ec;
    border-radius: 8px;
    margin-top: 16px;
}
.expand-section .btn-expand {
    padding: 10px 30px;
    background: linear-gradient(135deg, #ff9a56, #ff6b6b);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
}

/* 弹窗 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-box h3 { margin-bottom: 16px; color: #333; }
.modal-box .modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.modal-box .modal-actions .btn { flex: 1; }
.btn-cancel { background: #e0e0e0; color: #333; }
.btn-confirm { background: #4a9c2d; color: #fff; }

/* Toast提示 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 2000;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s;
}
.toast.show { opacity: 1; }
.toast.success { background: #4a9c2d; }
.toast.error { background: #ff6b6b; }

/* 经验条 */
.exp-bar {
    width: 120px;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    margin-left: 6px;
}
.exp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #56ab2f, #a8e063);
    transition: width 0.5s;
}

/* 管理员后台 */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 220px;
    background: #2c3e50;
    color: #fff;
    padding: 20px 0;
}
.admin-sidebar .admin-logo {
    padding: 0 20px 20px;
    font-size: 18px;
    font-weight: bold;
    border-bottom: 1px solid #34495e;
}
.admin-sidebar nav a {
    display: block;
    padding: 12px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s;
}
.admin-sidebar nav a:hover, .admin-sidebar nav a.active {
    background: #34495e;
    color: #fff;
}
.admin-main { flex: 1; padding: 24px; background: #f5f6fa; }
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.admin-header h2 { color: #2c3e50; }
.admin-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.stat-card .stat-label { color: #999; font-size: 13px; margin-bottom: 8px; }
.stat-card .stat-value { font-size: 28px; font-weight: bold; color: #2c3e50; }

/* 表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}
.data-table th, .data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 13px;
}
.data-table tr:hover { background: #f8f9fa; }
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }

/* 表单 */
.admin-form .form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    align-items: center;
}
.admin-form .form-row label {
    width: 100px;
    text-align: right;
    font-size: 14px;
    color: #555;
}
.admin-form .form-row input, .admin-form .form-row select, .admin-form .form-row textarea {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}
.admin-form .form-row textarea { min-height: 80px; resize: vertical; }

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}
.pagination a, .pagination span {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 13px;
}
.pagination .current { background: #4a9c2d; color: #fff; border-color: #4a9c2d; }

/* 搜索栏 */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    align-items: center;
}
.search-bar input, .search-bar select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}
.search-bar .btn { padding: 8px 20px; font-size: 14px; }

/* 响应式 */
@media (max-width: 768px) {
    .farm-grid { grid-template-columns: repeat(3, 1fr); }
    .game-header { flex-direction: column; gap: 10px; }
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; }
}
