/* 签到系统 - 莫兰迪柔色系样式 */
:root {
    --bg-primary: #F5F0EB;
    --bg-secondary: #E8E0D8;
    --bg-card: #FFFFFF;
    --text-primary: #4A4543;
    --text-secondary: #7A7572;
    --text-muted: #A09A96;
    --accent: #8B9D83;
    --accent-hover: #7A8C72;
    --accent-light: #C5D4BF;
    --danger: #C48B8B;
    --danger-hover: #B07A7A;
    --warning: #D4B896;
    --border: #D9D2CB;
    --shadow: rgba(74, 69, 67, 0.08);
    --radius: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* 容器 */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
}

.container-wide {
    max-width: 960px;
    margin: 0 auto;
    padding: 16px;
}

/* 卡片 */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px var(--shadow);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}
.btn-outline:hover {
    background: var(--bg-secondary);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 表单 */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
}

select.form-input {
    appearance: none;
    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='%237A7572' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* 列表 */
.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.list-item:last-child {
    border-bottom: none;
}

.list-item-content {
    flex: 1;
}

.list-item-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.list-item-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.list-item-actions {
    display: flex;
    gap: 8px;
}

/* 状态标签 */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.tag-success {
    background: var(--accent-light);
    color: var(--accent-hover);
}

.tag-warning {
    background: #F5E6D0;
    color: #A07A4A;
}

.tag-danger {
    background: #F5D5D5;
    color: #8B5A5A;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

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

/* 头部 */
.header {
    background: var(--bg-card);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 4px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
}

.header-back {
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
}

/* 底部导航 */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    display: flex;
    box-shadow: 0 -1px 4px var(--shadow);
    z-index: 100;
}

.tab-item {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: color 0.2s;
}

.tab-item.active {
    color: var(--accent);
}

.tab-item-icon {
    font-size: 20px;
    margin-bottom: 2px;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--text-primary);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 2000;
    transition: transform 0.3s;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* 表格（管理端） */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* 开关 */
.switch {
    position: relative;
    width: 44px;
    height: 24px;
    display: inline-block;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--border);
    border-radius: 24px;
    transition: 0.2s;
}

.switch-slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s;
}

.switch input:checked + .switch-slider {
    background: var(--accent);
}

.switch input:checked + .switch-slider:before {
    transform: translateX(20px);
}

/* 响应式 */
@media (max-width: 480px) {
    .container-wide {
        padding: 12px;
    }
    th, td {
        padding: 8px 6px;
        font-size: 12px;
    }
}
