/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background-color: #4CAF50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 1.5rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background-color: #45a049;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid #4CAF50;
    color: #4CAF50;
}

.btn-outline:hover {
    background-color: #4CAF50;
    color: white;
}

.btn-danger {
    background-color: #f44336;
    color: white;
}

.btn-danger:hover {
    background-color: #d32f2f;
}

.btn-back {
    background-color: transparent;
    color: #666;
}

.btn-back:hover {
    color: #333;
}

/* 主内容区域 */
.main {
    min-height: calc(100vh - 140px);
    padding: 20px 0;
}

/* 加载状态 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 错误提示 */
.error-alert {
    background-color: #ffebee;
    color: #c62828;
    padding: 12px 0;
    margin-bottom: 20px;
}

.error-alert .container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    margin-left: auto;
}

/* 页面样式 */
.page {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.page-header h2 {
    font-size: 1.8rem;
    color: #333;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state i {
    font-size: 3rem;
    color: #4CAF50;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

/* 花盆网格 */
.pots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.pot-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pot-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.pot-image {
    height: 180px;
    overflow: hidden;
}

.pot-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.pot-card:hover .pot-image img {
    transform: scale(1.05);
}

.pot-info {
    padding: 15px;
}

.pot-info h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: #333;
}

.pot-info p {
    color: #666;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.pot-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #888;
}

.pot-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 认证表单 */
.auth-form {
    max-width: 400px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #4CAF50;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #888;
    font-size: 0.8rem;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.auth-link a {
    color: #4CAF50;
    text-decoration: none;
    cursor: pointer;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #333;
}

/* 底部样式 */
.footer {
    background-color: #333;
    color: white;
    padding: 20px 0;
    text-align: center;
}

.footer p {
    margin-bottom: 5px;
}

.version {
    font-size: 0.8rem;
    color: #aaa;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .pots-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .page-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .auth-form {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .pots-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* 工具类 */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* 用户菜单 */
.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.auth-buttons {
    display: flex;
    gap: 10px;
}

/* 花盆详情页 */
.pot-detail {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 新首页样式 - 基于原小程序 */

/* 顶部操作栏 */
.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.batch-icon, .cancel-icon {
    width: 24px;
    height: 24px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.batch-icon:hover, .cancel-icon:hover {
    opacity: 0.8;
}

.header-right {
    display: flex;
    align-items: center;
}

.user-info-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.user-avatar-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.login-icon {
    font-size: 24px;
    cursor: pointer;
}

.login-status {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.user-nickname-small {
    font-size: 14px;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 用户菜单弹窗 */
.user-menu {
    position: absolute;
    top: 60px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 120px;
    overflow: hidden;
}

.menu-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
}

.menu-item:hover {
    background-color: #f5f5f5;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 999;
}

/* 天气信息显示 */
.compact-weather {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    margin: 10px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.weather-line1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.weather-location-compact {
    font-size: 14px;
    font-weight: 500;
}

.weather-temp-compact {
    font-size: 20px;
    font-weight: bold;
}

.weather-line2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    opacity: 0.9;
}

/* 养护建议弹窗 */
.advice-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.advice-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
}

.advice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #4CAF50;
    color: white;
}

.advice-title {
    font-size: 16px;
    font-weight: 600;
}

.advice-close {
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.advice-list {
    padding: 16px;
    max-height: 60vh;
    overflow-y: auto;
}

.advice-item {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.advice-item:last-child {
    border-bottom: none;
}

.advice-text {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
    color: #333;
}

.advice-condition {
    font-size: 12px;
    color: #666;
}

.advice-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 1999;
}

/* 养护建议循环滚动显示 */
.care-advice-scroll {
    background: #fff8e1;
    border-radius: 8px;
    margin: 10px 20px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.advice-icon {
    font-size: 20px;
}

.advice-swiper {
    flex: 1;
    overflow: hidden;
    height: 24px;
    position: relative;
}

.advice-item-simple {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    opacity: 0;
    transition: opacity 0.5s;
}

.advice-item-simple[x-show="true"] {
    opacity: 1;
}

.advice-text-simple {
    font-size: 14px;
    color: #333;
    line-height: 24px;
}

/* 空状态 */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-text {
    display: block;
    font-size: 16px;
    margin-bottom: 10px;
}

.empty-tip {
    display: block;
    font-size: 14px;
    color: #888;
}

/* 花盆列表 */
.pot-list-container {
    margin: 0 20px;
}

.pot-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.movable-area {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.movable-view {
    display: flex;
    transition: transform 0.3s ease;
    position: relative;
}

.pot-item {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: white;
    min-height: 100px;
}

.checkbox-container {
    margin-right: 12px;
}

.checkbox-container input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.pot-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.pot-img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    background: #f5f5f5;
}

.pot-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pot-info .name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.pot-info .date,
.pot-info .last,
.pot-info .note {
    font-size: 12px;
    color: #666;
}

.delete-btn {
    width: 80px;
    background: #f44336;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.delete-btn:hover {
    background: #d32f2f;
}

/* 添加花盆按钮 */
.add-button {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #4CAF50;
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    transition: all 0.2s;
    z-index: 100;
}

.add-button:hover {
    background: #45a049;
    transform: scale(1.05);
}

/* 删除选中按钮 */
.delete-selected-btn {
    position: fixed;
    bottom: 80px;
    left: 20px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 24px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
    transition: all 0.2s;
    z-index: 100;
}

.delete-selected-btn:hover {
    background: #d32f2f;
    transform: scale(1.05);
}

/* 登录/注册模态框 */
.login-modal, .register-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.login-modal-content, .register-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    overflow: hidden;
}

.login-header, .register-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #4CAF50;
    color: white;
}

.login-title, .register-title {
    font-size: 16px;
    font-weight: 600;
}

.login-close, .register-close {
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.login-body, .register-body {
    padding: 20px;
}

.login-desc {
    display: block;
    text-align: center;
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
}

.login-form, .register-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-form .form-group,
.register-form .form-group {
    margin-bottom: 0;
}

.login-form input,
.register-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.login-form input:focus,
.register-form input:focus {
    outline: none;
    border-color: #4CAF50;
}

.login-button, .register-button {
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.login-button:hover:not(:disabled),
.register-button:hover:not(:disabled) {
    background: #45a049;
}

.login-button:disabled,
.register-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-footer, .register-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
}

.login-register, .register-login {
    color: #4CAF50;
    cursor: pointer;
    text-decoration: underline;
}

.login-skip {
    color: #666;
    cursor: pointer;
    margin-left: 20px;
}

.login-overlay, .register-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 1999;
}

/* 表单验证样式 */
input:invalid {
    border-color: #f44336;
}

input:valid {
    border-color: #4CAF50;
}

/* 禁用状态 */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
