/* ============================
   移动端样式
   配色与PC端统一
   ============================ */

:root {
    --primary: #2b5aed;
    --primary-light: #eef2ff;
    --success: #0ba574;
    --success-light: #e8f8f2;
    --warning: #e89200;
    --warning-light: #fff5e6;
    --info: #7c3aed;
    --info-light: #f3edff;
    --danger: #e5484d;
    --danger-light: #fff0f0;
    --text-color: #1a1d29;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --border-color: #e5e7eb;
    --border-light: #f0f1f3;
    --bg-color: #f4f5f7;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
}

.page {
    min-height: 100vh;
    padding-bottom: 64px;
}

/* ============================
   登录页
   ============================ */
.login-box {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
    background: #1e1f26;
}

.login-box h1 {
    text-align: center;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.login-box .subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    margin-bottom: 32px;
}

.login-box form {
    background: #fff;
    padding: 28px 24px;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.login-box input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.login-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(43, 90, 237, 0.08);
}

.login-box .btn-primary {
    width: 100%;
    height: 46px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
}

.login-box .btn-primary:active {
    background: #1e4dcc;
}

.login-box .tip {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    margin-top: 16px;
}

.login-box .tip a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}

/* 表单卡片内的提示（白底，需用深色文字） */
.login-box form .tip {
    color: #6b7280;
}
.login-box form .tip a {
    color: var(--primary);
    font-weight: 500;
}
.login-box form .tip a:hover {
    text-decoration: underline;
}

/* ============================
   注册页（复用登录页风格）
   ============================ */
.register-box {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
    background: #1e1f26;
}

.register-box h1 {
    text-align: center;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.register-box .subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    margin-bottom: 24px;
}

.register-box form {
    background: #fff;
    padding: 24px 20px;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.register-box .form-group {
    margin-bottom: 14px;
}

.register-box .form-group label {
    display: block;
    font-size: 14px;
    color: #4b5563;
    margin-bottom: 6px;
    font-weight: 500;
}

.register-box .form-group input,
.register-box .form-group select {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #1a1d29;
    -webkit-appearance: none;
    appearance: none;
}

.register-box .form-group input:focus,
.register-box .form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(43, 90, 237, 0.08);
}

.register-box .form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 8.5L1.5 4h9z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.register-error {
    background: #fff5f5;
    border: 1px solid #ffc9c9;
    color: #e03131;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 14px;
}

.register-tip {
    background: #e7f5ff;
    border: 1px solid #b3d7ff;
    color: #1c7ed6;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    line-height: 1.6;
    margin-bottom: 18px;
}

.register-box .btn-primary {
    width: 100%;
    height: 46px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.register-box .btn-primary:active {
    background: #1e4dcc;
}

.register-box .tip {
    text-align: center;
    color: #6b7280;
    font-size: 12px;
    margin-top: 16px;
}

.register-box .tip a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

/* ============================
   头部
   ============================ */
.header {
    background: #fff;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header h2 {
    font-size: 17px;
    font-weight: 600;
}

.header .btn-back {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 14px;
    cursor: pointer;
}

.header .logout {
    color: var(--danger);
    font-size: 14px;
    text-decoration: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-link {
    color: var(--primary);
    font-size: 14px;
    text-decoration: none;
}

/* ============================
   首页
   ============================ */
.home-hero {
    padding: 16px 16px 0;
}

.home-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
}

.home-subtitle {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-tertiary);
}

/* 统计卡片 */
.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px 16px;
}

.stat-item {
    background: #fff;
    padding: 18px 16px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-num {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* 提醒框 */
.reminder-box {
    background: #fff;
    margin: 0 16px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.reminder-box h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-color);
}

.reminder-box-light {
    margin-top: 12px;
}

/* 快捷操作（四宫格） */
.quick-actions {
    padding: 0 16px 16px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.quick-action-card {
    border: none;
    border-radius: 14px;
    color: #fff;
    padding: 18px 12px;
    min-height: 104px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.quick-action-card.primary {
    background: var(--primary);
}

.quick-action-card.success {
    background: var(--success);
}

.quick-action-card.warning {
    background: var(--warning);
}

.quick-action-card.info {
    background: var(--info);
}

.quick-action-card:active {
    opacity: 0.9;
    transform: scale(0.97);
}

.quick-action-icon {
    font-size: 30px;
    line-height: 1;
}

.quick-action-main {
    font-size: 15px;
    font-weight: 600;
}

.quick-action-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.35;
}

/* 提醒列表 */
.reminder-list {
    list-style: none;
}

.reminder-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.reminder-list li:last-child {
    border-bottom: none;
}

.reminder-list li.empty {
    color: var(--text-tertiary);
    text-align: center;
    padding: 20px 0;
}

.reminder-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reminder-info strong {
    color: var(--text-color);
    font-size: 14px;
}

.reminder-info span {
    font-size: 12px;
    color: var(--danger);
}

.list-subline {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-tertiary);
}

.btn-inline-action {
    margin-top: 10px;
    border: none;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 13px;
    cursor: pointer;
}

/* ============================
   底部导航
   ============================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    display: flex;
    justify-content: space-around;
    padding: 7px 0;
    border-top: 1px solid var(--border-color);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-tertiary);
    font-size: 10px;
}

.nav-item .icon {
    font-size: 20px;
    margin-bottom: 2px;
}

.nav-item.active {
    color: var(--primary);
}

/* ============================
   搜索栏 / 筛选栏
   ============================ */
.search-bar {
    padding: 12px 16px;
}

.search-bar input {
    width: 100%;
    height: 38px;
    padding: 0 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    background: #fff;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-bar {
    padding: 12px 16px;
}

.filter-bar input {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
}

.filter-bar input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ============================
   列表
   ============================ */
.list-container {
    padding: 0 16px;
}

.card-item {
    background: #fff;
    margin-bottom: 10px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.card-item .card-header {
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
}

.card-item .card-body {
    padding: 10px 14px;
}

.card-item .card-body p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.card-item .card-body p:last-child {
    margin-bottom: 0;
}

/* ============================
   标签
   ============================ */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.tag-success {
    background: var(--success-light);
    color: var(--success);
}

.tag-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.tag-danger {
    background: var(--danger-light);
    color: var(--danger);
}

/* ============================
   浮动添加按钮
   ============================ */
.btn-add {
    position: fixed;
    bottom: 72px;
    right: 18px;
    width: 52px;
    height: 52px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    line-height: 1;
    box-shadow: 0 4px 16px rgba(43, 90, 237, 0.3);
    cursor: pointer;
    z-index: 50;
}

.btn-add:active {
    background: #1e4dcc;
}

/* ============================
   表单页
   ============================ */
.record-form {
    padding: 14px;
}

.form-hero {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--primary);
    color: #fff;
    border-radius: 14px;
    padding: 16px 14px;
    margin-bottom: 14px;
}

.form-hero-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.form-hero-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

.form-hero-sub {
    margin-top: 3px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

.form-card {
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
}

.form-card-light {
    background: #fafbfc;
}

.form-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 12px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px;
    background: #fff;
    color: var(--text-color);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(43, 90, 237, 0.08);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.input-large {
    min-height: 52px !important;
    font-size: 16px !important;
}

.form-row-emphasis .form-group {
    margin-bottom: 0;
}

.input-emphasis {
    min-height: 56px !important;
    font-size: 19px !important;
    font-weight: 700;
    text-align: center;
    background: #f8faff !important;
    border-color: #b6d5ff !important;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}

.btn-primary:active {
    background: #1e4dcc;
}

.btn-block {
    margin-top: 16px;
}

/* ============================
   照片上传
   ============================ */
.photo-upload {
    padding: 22px 14px;
    border: 2px dashed #cfe0ff;
    border-radius: 14px;
    text-align: center;
    color: var(--text-secondary);
    cursor: pointer;
    background: #f8fbff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.photo-upload-icon {
    font-size: 26px;
}

.photo-upload-main {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
}

.photo-upload-sub {
    font-size: 12px;
    color: var(--text-tertiary);
}

.photo-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.preview-item {
    position: relative;
    width: 76px;
    height: 76px;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.preview-item button {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
}

/* ============================
   加载状态 / 空状态
   ============================ */
.loading, .empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
    font-size: 14px;
}

/* ============================
   统计详情
   ============================ */
.stats-detail {
    padding: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stat-card {
    background: #fff;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-card .stat-label {
    font-size: 12px;
    color: var(--text-tertiary);
}

.stat-card .stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
    margin-top: 4px;
}

/* ============================
   响应式
   ============================ */
@media (max-width: 380px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .form-hero-title {
        font-size: 17px;
    }
}
