:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-white: #ffffff;
    --bg-gray: #f8f9fa;
    --border-color: #e5e7eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    line-height: 1.5;
}

.container {
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 20px;
    width: 100%;
    max-width: 480px;
    margin: 10px 0;
    min-height: 520px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 电脑版登录页面优化 */
@media (min-width: 768px) {
    .container.login-section {
        max-width: 400px;
        padding: 24px;
        min-height: 450px;
    }
    
    .container.info-section {
        max-width: 800px;
        padding: 30px;
        min-height: auto;
    }
    
    .baby-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .baby-card {
        margin-bottom: 0;
    }
}

/* 彻底修复验证码输入框对齐问题 */
.code-input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
    height: 48px;
}

.code-input-group .form-input.code-input {
    flex: 1;
    height: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px;
    background: var(--bg-gray);
    transition: all 0.3s ease;
    line-height: 1;
    margin: 0;
    display: flex;
    align-items: center;
}

.code-input-group .form-input.code-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.code-input-group .send-code-btn {
    width: 120px;
    height: 100%;
    padding: 0;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-gray);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
    margin: 0;
    text-align: center;
}

.code-input-group .send-code-btn:hover:not(:disabled) {
    background: var(--border-color);
}

.code-input-group .send-code-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 移动端适配 */
@media (max-width: 767px) {
    .container.login-section {
        min-height: 480px;
    }
    
    .code-input-group {
        height: 44px;
    }
    
    .code-input-group .form-input.code-input {
        padding: 10px 12px;
        font-size: 15px;
    }
    
    .code-input-group .send-code-btn {
        width: 110px;
        font-size: 13px;
    }
}

/* 超小屏幕适配 */
@media (max-width: 360px) {
    .container.login-section {
        min-height: 460px;
        padding: 16px;
    }
    
    .code-input-group {
        height: 42px;
        gap: 8px;
    }
    
    .code-input-group .form-input.code-input {
        padding: 9px 11px;
        font-size: 14px;
    }
    
    .code-input-group .send-code-btn {
        width: 100px;
        font-size: 12px;
    }
}

.logo {
    text-align: center;
    margin-bottom: 20px;
}

.logo h1 {
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 4px;
}

.logo p {
    color: var(--text-secondary);
    font-size: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 16px;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: var(--bg-gray);
    height: 48px;
    line-height: 1;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
    line-height: 1;
}

.btn-full {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: var(--bg-gray);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-small {
    padding: 8px 12px;
    font-size: 14px;
    width: auto;
    height: 48px;
}

.loading {
    position: relative;
    color: transparent;
}

.loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-left: -9px;
    margin-top: -9px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.message {
    padding: 10px 14px;
    border-radius: 10px;
    margin: 16px 0;
    font-size: 15px;
    text-align: center;
    display: none;
}

.message.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.login-section {
    display: block;
}

.info-section {
    display: none;
}

.tab-container {
    display: flex;
    margin-bottom: 20px;
    background: var(--bg-gray);
    border-radius: 10px;
    padding: 4px;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 16px;
}

.tab.active {
    background: var(--bg-white);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.countdown {
    color: var(--text-secondary);
}

.user-card {
    background: var(--bg-gray);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
}

.user-header {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 20px;
    margin-right: 14px;
    flex-shrink: 0;
}

.user-info h3 {
    color: var(--text-primary);
    margin-bottom: 3px;
    font-size: 18px;
    font-weight: 600;
}

.user-info p {
    color: var(--text-secondary);
    font-size: 14px;
}

.stats-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
}

.stat-item {
    text-align: center;
    padding: 10px;
    background: var(--bg-white);
    border-radius: 10px;
}

.stat-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 18px;
    margin-bottom: 3px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
}

.section-title i {
    margin-right: 6px;
    color: var(--primary-color);
    font-style: normal;
}

.baby-list {
    margin: 18px 0;
}

.baby-card {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.baby-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.baby-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.baby-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 14px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
    font-size: 20px;
}

.baby-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.baby-info {
    flex: 1;
    min-width: 0;
}

.baby-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.baby-gender-age {
    font-size: 15px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.baby-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 12px;
    font-size: 14px;
    color: var(--text-secondary);
    margin: 12px 0;
}

.baby-detail-item {
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.baby-detail-item i {
    margin-right: 6px;
    width: 14px;
    text-align: center;
    font-size: 14px;
    font-style: normal;
}

.baby-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 12px 0;
}

.baby-stat {
    text-align: center;
    padding: 8px 6px;
    background: var(--bg-gray);
    border-radius: 8px;
}

.baby-stat-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 16px;
    margin-bottom: 2px;
}

.baby-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.vip-status {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 10px;
    font-size: 13px;
    color: #92400e;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.vip-status.active {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: #34d399;
    color: #065f46;
}

.vip-status.expired {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fecaca;
    color: #991b1b;
}

.vip-icon {
    font-weight: bold;
    margin-right: 6px;
}

.vip-time {
    font-weight: 600;
    font-size: 12px;
}

.space-warning {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px;
    font-size: 13px;
    color: #991b1b;
    margin-top: 8px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* 统一的图片弹窗样式 */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.image-modal-content {
    max-width: 90%;
    max-height: 80%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    background: var(--bg-white);
}

.modal-image-container {
    width: 100%;
    height: auto;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.modal-image-container:hover {
    transform: scale(1.02);
}

.image-modal img {
    width: 100%;
    height: auto;
    display: block;
}

.image-modal-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 12px;
    text-align: center;
    font-size: 14px;
}

.image-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    z-index: 1001;
}

.image-modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

@media (max-width: 480px) {
    .container {
        padding: 16px;
        border-radius: 14px;
    }
    
    .image-modal-content {
        max-width: 95%;
        max-height: 85%;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 14px;
    }
    
    .stats-info {
        grid-template-columns: 1fr;
    }
    
    .baby-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 底部信息样式 */
.footer-info {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.footer-info p {
    margin-bottom: 5px;
}

/* 获取查询码链接样式 */
.query-code-link {
    color: var(--primary-color);
    text-decoration: none;
    margin-left: 8px;
    font-size: inherit;
    cursor: pointer;
    font-weight: 500;
    border-bottom: 1px dashed var(--primary-color);
    padding-bottom: 1px;
}

.query-code-link:hover {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
}