/* 全局重置 & 基础规范 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft Yahei", "PingFang SC", sans-serif;
}
html, body {
    width: 100%;
    overflow-x: hidden;
}
body {
    background-color: #f0f2f5;
    padding: 16px;
    line-height: 1.5;
}
.container {
    max-width: 1920px;
    margin: 0 auto;
    width: 100%;
}

/* 顶部头部 - 电脑端布局 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}
.header h1 {
    font-size: 22px;
    color: #333;
    font-weight: 600;
    white-space: nowrap;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.header-right span {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

/* 搜索框样式 - 高度和按钮完全对齐 */
.search-box {
    display: flex;
    align-items: center;
    gap: 0;
}
.search-box input {
    padding: 0 12px;
    height: 36px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    outline: none;
    width: 260px;
    font-size: 14px;
    line-height: 36px;
    vertical-align: middle;
}
.search-box input:focus {
    border-color: #1677ff;
}

/* 按钮全局样式 */
.btn {
    padding: 0 16px;
    height: 36px;
    line-height: 36px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    white-space: nowrap;
    vertical-align: middle;
    transition: opacity 0.2s;
}
.btn:hover {
    opacity: 0.9;
}
.btn-search {
    background-color: #1677ff;
    border-radius: 0 4px 4px 0;
    height: 36px;
}
.btn-primary {
    background-color: #1677ff;
}
.btn-success {
    background-color: #00b42a;
}
.btn-warning {
    background-color: #f7931e;
}
.btn-danger {
    background-color: #f53f3f;
}
.btn-gray {
    background-color: #86909c;
}

/* 公告区域 - 动态布局适配 */
.notice-wrap {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
    width: 100%;
}
/* 双公告：左右分栏 */
.notice-wrap.two-col {
    grid-template-columns: 1fr 1fr;
}
/* 单公告：铺满整行 */
.notice-wrap.one-col {
    grid-template-columns: 1fr;
}
/* 无公告：隐藏整个区域 */
.notice-wrap.hidden {
    display: none;
}
.notice-card {
    padding: 14px 16px;
    border-radius: 8px;
    background-color: #fff;
    width: 100%;
}
.notice-card.all {
    background-color: #f0f7ff;
    border-left: 4px solid #1677ff;
}
.notice-card.private {
    background-color: #fff7e6;
    border-left: 4px solid #ff9500;
}
.notice-card h3 {
    font-size: 15px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    color: #333;
}
.notice-card p {
    font-size: 14px;
    color: #444;
    line-height: 1.6;
    word-break: break-all;
}
.notice-card .time {
    font-size: 12px;
    color: #999;
    text-align: right;
    margin-top: 6px;
}

/* 总合计栏 */
.total-box {
    background-color: #fff;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    text-align: center;
    width: 100%;
}
.total-box .total-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}
.total-box .total-num {
    color: #f53f3f;
    font-size: 20px;
    font-weight: 600;
}

/* 日期分组头部 */
.date-group {
    margin-bottom: 16px;
    width: 100%;
}
.date-header {
    background-color: #f0f7ff;
    padding: 12px 16px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.date-header .date {
    font-size: 18px;
    font-weight: 600;
    color: #1677ff;
}
.date-header .day-total {
    font-size: 16px;
    color: #00b42a;
    font-weight: 600;
}

/* ===================== 电脑端表格样式 ===================== */
.table-box {
    width: 100%;
    overflow-x: auto;
    background-color: #fff;
    border-radius: 0 0 8px 8px;
}
table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
table thead tr {
    background-color: #f5f7fa;
}
table th {
    padding: 12px 15px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    vertical-align: middle;
    border-bottom: 1px solid #eee;
}
/* 列宽分配 */
table th:nth-child(1),
table td:nth-child(1) {
    width: 6%;
    text-align: center;
}
table th:nth-child(2),
table td:nth-child(2) {
    width: 11%;
    text-align: left;
}
table th:nth-child(3),
table td:nth-child(3) {
    width: 11%;
    text-align: left;
}
table th:nth-child(4),
table td:nth-child(4) {
    width: 13%;
    text-align: left;
}
table th:nth-child(5),
table td:nth-child(5) {
    width: 11%;
    text-align: left;
}
table th:nth-child(6),
table td:nth-child(6) {
    width: 13%;
    text-align: left;
}
table th:nth-child(7),
table td:nth-child(7) {
    width: 12%;
    text-align: left;
}
table th:nth-child(8),
table td:nth-child(8) {
    width: 23%;
    text-align: center;
}
table td {
    padding: 12px 15px;
    font-size: 14px;
    vertical-align: middle;
    border-bottom: 1px solid #eee;
    word-break: break-all;
    white-space: nowrap;
}
.operate-btn {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
}
.operate-btn .btn {
    height: 32px;
    line-height: 32px;
    padding: 0 12px;
    font-size: 13px;
    flex-shrink: 0;
}

/* 表单卡片样式 */
.form-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    width: 100%;
}
.form-card h2 {
    font-size: 18px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    color: #333;
}
.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 15px;
    width: 100%;
}
.form-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}
.form-item label {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}
.form-item input, .form-item textarea, .form-item select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
    font-size: 14px;
    width: 100%;
    vertical-align: middle;
}
.form-item input:focus, .form-item textarea:focus, .form-item select:focus {
    border-color: #1677ff;
}
.form-item textarea {
    resize: vertical;
    min-height: 60px;
    line-height: 1.5;
}
.checkbox-group {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    height: 36px;
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 5px;
}
.checkbox-item input {
    width: auto;
    height: auto;
}

/* 维修项目表格 */
.item-table {
    margin-bottom: 15px;
}
.item-table th, .item-table td {
    text-align: center;
    white-space: normal;
}
.item-table input {
    text-align: center;
}

/* 表单底部 */
.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 15px;
}
.form-footer .total-amount {
    font-size: 18px;
    font-weight: 600;
}
.form-footer .total-amount span {
    color: #f53f3f;
}
.form-footer .btn-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 打印页面样式 */
.print-box {
    width: 210mm;
    min-height: 297mm;
    padding: 30mm;
    background-color: #fff;
    margin: 0 auto;
}
.print-box h2 {
    text-align: center;
    font-size: 20px;
    margin-bottom: 20px;
    font-weight: 600;
}
.print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
    table-layout: auto;
}
.print-table td {
    border: 1px solid #333;
    padding: 8px 10px;
    font-size: 14px;
    vertical-align: middle;
    text-align: left;
    white-space: normal;
}
.print-tip {
    margin-top: 30px;
    font-size: 12px;
    line-height: 1.6;
}
.sign-area {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

/* 登录/注册页面 */
.login-box {
    max-width: 400px;
    margin: 100px auto;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
}
.login-box h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
    font-weight: 600;
}
.login-box .form-item {
    margin-bottom: 15px;
}
.login-box .btn {
    width: 100%;
    padding: 0;
    height: 40px;
    line-height: 40px;
    font-size: 16px;
}
.login-tip {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
}
.login-tip a {
    color: #1677ff;
    text-decoration: none;
}

/* 后台侧边栏 */
.user-sidebar {
    width: 220px;
    background-color: #fff;
    border-radius: 8px;
    height: calc(100vh - 32px);
    position: fixed;
    left: 16px;
    top: 16px;
    padding: 20px 0;
    overflow-y: auto;
}
.user-sidebar h3 {
    padding: 0 16px 15px;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
}
.user-item {
    padding: 12px 16px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}
.user-item.active {
    background-color: #f0f7ff;
    border-left-color: #1677ff;
}
.user-item p {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}
.user-item span {
    font-size: 12px;
    color: #999;
}
.admin-main {
    margin-left: 240px;
    width: calc(100% - 256px);
}

/* 公告列表 */
.notice-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
}
.notice-item .notice-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #fff;
    margin-bottom: 8px;
}
.notice-tag.all {
    background-color: #1677ff;
}
.notice-tag.private {
    background-color: #ff9500;
}
.notice-item .notice-content {
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.6;
}
.notice-item .notice-target {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}
.notice-item .notice-time {
    font-size: 12px;
    color: #999;
    text-align: right;
}

/* 版权信息 */
.copyright {
    text-align: center;
    font-size: 13px;
    color: #999;
    margin-top: 30px;
    padding-bottom: 20px;
}

/* ===================== 【重点重写】1:1复刻参考图的手机端样式 ===================== */
@media screen and (max-width: 768px) {
    /* 全局基础适配 */
    body {
        padding: 12px;
        background-color: #f0f2f5;
    }
    .container {
        width: 100%;
    }

    /* 顶部头部竖排布局 */
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 12px;
    }
    .header h1 {
        font-size: 20px;
    }
    .header-right {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }
    .header-right span {
        align-self: flex-end;
        font-size: 14px;
    }
    .search-box {
        width: 100%;
    }
    .search-box input {
        width: 100%;
        height: 44px;
        line-height: 44px;
        font-size: 16px;
        border-radius: 8px 0 0 8px;
    }
    .btn-search {
        height: 44px;
        border-radius: 0 8px 8px 0;
        font-size: 16px;
    }
    .header-right .btn {
        width: 100%;
        height: 44px;
        line-height: 44px;
        font-size: 16px;
        border-radius: 8px;
    }

    /* 公告区域适配 */
    .notice-wrap.two-col {
        grid-template-columns: 1fr;
    }
    .notice-card {
        border-radius: 8px;
        padding: 14px 16px;
    }
    .form-row {
        grid-template-columns: 1fr;
    }

    /* 后台侧边栏适配 */
    .user-sidebar {
        position: relative;
        width: 100%;
        height: auto;
        left: 0;
        top: 0;
        margin-bottom: 16px;
    }
    .admin-main {
        margin-left: 0;
        width: 100%;
    }
    .print-box {
        width: 100%;
        padding: 10px;
        min-height: auto;
    }

    /* 总合计栏适配 */
    .total-box {
        padding: 16px;
        border-radius: 8px;
        margin-bottom: 12px;
    }
    .total-box .total-text {
        font-size: 18px;
    }
    .total-box .total-num {
        font-size: 20px;
    }

    /* 日期头部适配 */
    .date-header {
        padding: 12px 16px;
        border-radius: 8px 8px 0 0;
        margin-bottom: 0;
    }
    .date-header .date {
        font-size: 18px;
    }
    .date-header .day-total {
        font-size: 16px;
    }

    /* ============== 核心：卡片式布局1:1完美复刻 ============== */
    /* 表格容器透明，去掉背景 */
    .table-box {
        overflow: visible;
        background: transparent;
        border-radius: 0;
    }
    table {
        width: 100%;
        display: block;
    }
    /* 隐藏电脑端表头 */
    table thead {
        display: none !important;
    }
    table tbody {
        display: block;
        width: 100%;
    }
    /* 每一行变成独立圆角卡片 */
    table tr {
        display: block !important;
        background: #fff;
        border-radius: 0 0 8px 8px;
        padding: 0 16px;
        margin-bottom: 12px;
        width: 100%;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    }
    /* 每个单元格：标签左、内容右，两端对齐 */
    table td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        padding: 14px 0 !important;
        border-bottom: 1px solid #f5f5f5 !important;
        font-size: 16px !important;
        text-align: left !important;
        white-space: nowrap !important;
        word-break: keep-all !important;
        margin: 0 !important;
    }
    /* 最后一个操作单元格：去掉下边框，调整内边距 */
    table td:last-child {
        border-bottom: none !important;
        padding: 16px 0 16px !important;
    }
    /* 标签样式：左对齐，固定权重 */
    table td::before {
        content: attr(data-label) !important;
        font-weight: 500 !important;
        color: #333 !important;
        flex-shrink: 0 !important;
        margin-right: 10px !important;
    }
    /* 操作按钮：三个等宽铺满 */
    .operate-btn {
        display: flex !important;
        width: 100% !important;
        max-width: 75% !important;
        gap: 10px !important;
        justify-content: space-between !important;
        margin-left: auto !important;
    }
    .operate-btn .btn {
        flex: 1 !important;
        height: 44px !important;
        line-height: 44px !important;
        font-size: 16px !important;
        border-radius: 8px !important;
        padding: 0 !important;
        min-width: 0 !important;
    }
}

/* 打印专用样式 */
@media print {
    body {
        padding: 0;
        background-color: #fff;
    }
    .no-print {
        display: none !important;
    }
    .print-box {
        width: 100%;
        height: 100%;
        padding: 0;
        margin: 0;
    }
}