/* ============================================================
   便民工具借用系统 - 公共样式
   移动端H5优先
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-main: #1f2937;
    --text-sub: #6b7280;
    --text-light: #9ca3af;
    --bg-page: #f0f4ff;
    --bg-card: #ffffff;
    --border: #e5e7eb;
    --radius: 14px;
    --shadow: 0 2px 12px rgba(37, 99, 235, 0.08);
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg-page);
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; }
input { font-family: inherit; outline: none; border: none; }

/* 页面容器 */
.page {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg-page);
    position: relative;
    padding-bottom: 70px;
}

/* 顶部标题栏 */
.topbar {
    background: var(--primary);
    color: #fff;
    padding: 14px 16px;
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

/* 按钮 */
.btn {
    display: block;
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    transition: opacity 0.2s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:disabled {
    background: #93c5fd;
    cursor: not-allowed;
}
.btn-outline {
    background: #fff;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}
.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-success {
    background: var(--success);
    color: #fff;
}

/* 输入框 */
.input-group {
    margin-bottom: 14px;
}
.input-group label {
    display: block;
    font-size: 14px;
    color: var(--text-sub);
    margin-bottom: 6px;
}
.input-group input,
.input-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    background: #f9fafb;
    transition: border-color 0.2s;
}
.input-group input:focus,
.input-group select:focus {
    border-color: var(--primary);
    background: #fff;
}

/* 底部导航 */
.tabbar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: #fff;
    display: flex;
    border-top: 1px solid var(--border);
    padding: 6px 0 8px;
    z-index: 100;
}
.tabbar-item {
    flex: 1;
    text-align: center;
    color: var(--text-light);
    font-size: 11px;
    padding: 4px 0;
}
.tabbar-item .icon {
    font-size: 22px;
    display: block;
    margin-bottom: 2px;
}
.tabbar-item.active {
    color: var(--primary);
    font-weight: 600;
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}
.tag-borrowing { background: #fef3c7; color: #b45309; }
.tag-pending   { background: #e0e7ff; color: #4338ca; }
.tag-returned  { background: #d1fae5; color: #047857; }
.tag-overdue   { background: #fee2e2; color: #b91c1c; }

/* 空状态 */
.empty {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-light);
}
.empty .icon { font-size: 48px; margin-bottom: 12px; }

/* Toast提示 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 9999;
    max-width: 80%;
    text-align: center;
    display: none;
}

/* 遮罩弹窗 */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal-box {
    background: #fff;
    border-radius: 16px;
    width: 85%;
    max-width: 360px;
    padding: 24px 20px;
}
.modal-box h3 {
    font-size: 17px;
    margin-bottom: 16px;
    text-align: center;
}
