/* 全局样式 */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

/* 导航栏样式 */
.nav-container {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-left {
    flex: 1;
    justify-content: flex-start;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.refresh-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f8f9fa;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
}

.countdown {
    font-family: monospace;
}

.refresh-button {
    color: #1a73e8;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.refresh-button:hover {
    background: #f0f4fe;
}

/* 导航链接样式 */
.nav-link {
    color: #666;
    text-decoration: none;
    font-size: 15px;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #1a73e8;
    background-color: #f0f4fe;
}

.nav-link.active {
    color: #1a73e8;
    font-weight: 500;
    background-color: #f0f4fe;
}

/* 导航项目样式 */
.nav li {
    margin: 0 8px;
}

/* 导航容器样式补充 */
.nav-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 刷新信息区域样式调整 */
.refresh-info {
    background: #f8f9fa;
    border: 1px solid #eef0f5;
}

/* 响应式调整补充 */
@media (max-width: 768px) {
    .nav li {
        margin: 0 4px;
    }
    
    .nav-link {
        padding: 6px 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .nav-wrapper {
        flex-direction: column;
        padding: 10px;
    }
    
    .nav-left {
        margin-bottom: 10px;
    }
}

/* 内容区域 */
.container {
    margin-top: 80px;
    padding: 20px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* 卡片容器 */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px;
    width: 100%;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #eef0f5;
    position: relative;
    perspective: 2000px;
    cursor: pointer;
    height: 220px;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* 卡片内部容器 */
.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: left;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

/* 翻转效果 */
.card.flipped .card-inner {
    transform: rotateY(180deg);
}

/* 卡片正面和背面的共同样式 */
.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    padding: 20px;
    background: white;
    border-radius: 12px;
}

/* 卡片正面 */
.card-front {
    transform: rotateY(0);
    background: linear-gradient(to bottom, white, #fafafa);
}

.card-front h2 {
    margin-top: 45px;
    margin-bottom: 12px;
}

.card-front p {
    margin: 4px 0;
}

/* 更新时间信息的容器 */
.card-info-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 更新时间样式 */
.update-time {
    font-size: 13px;
    color: #666;
}

/* 翻转提示 */
.flip-hint {
    position: absolute;
    bottom: 12px;
    width: 100%;
    text-align: center;
    color: #999;
    font-size: 12px;
    left: 0;
}

/* 卡片背面 */
.card-back {
    transform: rotateY(180deg);
    background: linear-gradient(to bottom, #f8f9fa, #f0f2f5);
}

/* 状态标签样式 */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    position: absolute;
    top: 15px;
    right: 15px;
}

.status-badge.available {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-badge.borrowed {
    background-color: #fff3e0;
    color: #f57c00;
}

.status-badge.unavailable {
    background-color: #ffebee;
    color: #c62828;
}

/* 调整卡片内容布局 */
.card-front h2 {
    margin-top: 45px; /* 为状态标签留出空间 */
}

/* 卡片内容样式 */
.card h2 {
    font-size: 16px;
    margin-bottom: 12px;
    padding-right: 25px;
    color: #2c3e50;
}

.card h3 {
    font-size: 15px;
    margin-bottom: 10px;
    color: #1a73e8;
}

.card p {
    font-size: 14px;
    color: #666;
    margin: 8px 0;
}

/* 手机号码样式 */
.phone-number {
    cursor: pointer;
    color: #1a73e8;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.phone-number:hover {
    color: #1557b0;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .card {
        height: 240px; /* 稍微增加卡片高度 */
    }

    .card-front {
        padding: 16px;
    }

    .card-front h2 {
        margin-top: 40px;
        font-size: 15px;
    }

    .card-front p {
        font-size: 13px;
    }

    .card-info-bottom {
        gap: 6px;
    }

    .update-time {
        font-size: 12px;
    }

    .flip-hint {
        padding-top: 6px;
        font-size: 11px;
    }
}

/* 表格样式 */
table {
    width: 100%;
    background: white;
    border-radius: 12px;
    border-collapse: separate;
    border-spacing: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    overflow: hidden;
    margin-top: 20px;
}

th {
    background-color: #f8f9fa;
    color: #2c3e50;
    font-weight: 500;
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eef0f5;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #eef0f5;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav {
        padding: 0 10px;
        height: 50px;
    }

    .nav li {
        margin: 0 5px;
    }

    .nav a {
        padding: 6px 12px;
        font-size: 14px;
    }

    .container {
        margin-top: 60px;
        padding: 10px;
    }

    .card-container {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 10px;
    }

    .card {
        height: 200px;
    }

    .card-front,
    .card-back {
        padding: 15px;
    }

    .refresh-container {
        top: 8px;
        right: 10px;
        padding: 5px 10px;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    th, td {
        padding: 10px;
    }
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    transition: all 0.3s ease;
    opacity: 0;
}

.modal.show {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 1;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    width: 320px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transform: scale(0.8) translateY(-20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.show .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* 弹窗消失动画 */
.modal.hide {
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    opacity: 0;
}

.modal.hide .modal-content {
    transform: scale(0.8) translateY(20px);
    opacity: 0;
}

.modal-content h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    color: #2c3e50;
    font-weight: 500;
}

.modal-content.error {
    text-align: center;
    padding: 20px;
    animation: shake 0.5s ease-in-out;
}

.modal-content.error h3 {
    color: #dc2626;
    margin-bottom: 8px;
}

.modal-content.error p {
    color: #666;
    margin: 0;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-size: 14px;
}

#password-input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

#password-input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

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

.modal-buttons button {
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-confirm {
    background: #1a73e8;
    color: white;
    border: none;
}

.btn-confirm:hover {
    background: #1557b0;
}

.btn-cancel {
    background: #f1f5f9;
    color: #475569;
    border: none;
}

.btn-cancel:hover {
    background: #e2e8f0;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* 历史记录容器 */
.history-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 24px;
    padding: 20px;
}

/* 历史记录卡片 */
.history-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.history-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.history-card-header {
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-bottom: 1px solid #eef0f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-card-header h2 {
    margin: 0;
    font-size: 18px;
    color: #2c3e50;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.status-badge.available {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-badge.borrowed {
    background-color: #fff3e0;
    color: #f57c00;
}

.status-badge.unavailable {
    background-color: #ffebee;
    color: #c62828;
}

/* 时间线样式 */
.history-timeline {
    padding: 20px;
}

.history-item {
    position: relative;
    padding-left: 28px;
    margin-bottom: 24px;
}

.history-item:last-child {
    margin-bottom: 0;
}

.history-item::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 24px;
    bottom: -24px;
    width: 2px;
    background: #e1e8ed;
}

.history-item:last-child::before {
    display: none;
}

.history-time {
    margin-bottom: 8px;
    color: #666;
    font-size: 13px;
    display: flex;
    align-items: center;
}

.time-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    position: absolute;
    left: 0;
    top: 4px;
}

.borrow-record .time-dot {
    background: #ff9500;
    box-shadow: 0 0 0 4px rgba(255, 149, 0, 0.2);
}

.return-record .time-dot {
    background: #34c759;
    box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.2);
}

.history-content {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
}

.history-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.history-type {
    font-size: 13px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 12px;
}

.borrow-record .history-type {
    background: #fff3e0;
    color: #f57c00;
}

.return-record .history-type {
    background: #e8f5e9;
    color: #2e7d32;
}

.history-name {
    font-weight: 500;
    color: #2c3e50;
    margin-right: 12px;
}

.history-purpose,
.history-status {
    color: #666;
    font-size: 14px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .history-container {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 10px;
    }

    .history-card-header {
        padding: 15px;
    }

    .history-timeline {
        padding: 15px;
    }
}

/* 展开按钮样式 */
.expand-button {
    text-align: center;
    padding: 12px;
    margin-top: 8px;
    cursor: pointer;
    color: #1a73e8;
    font-size: 14px;
    transition: all 0.3s ease;
}

.expand-text {
    position: relative;
    display: inline-block;
}

.expand-icon {
    display: inline-block;
    margin-left: 4px;
    transition: transform 0.3s ease;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-2px);
    }
}

/* 隐藏记录的动画 */
.hidden-records {
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

/* 提示动画 */
.history-timeline.has-more {
    position: relative;
}

.history-timeline.has-more::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0.9));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.history-card:hover .history-timeline.has-more::after {
    opacity: 1;
}

/* 展开/收起动画 */
.hidden-records {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.hidden-records[style*="display: block"] {
    opacity: 1;
    transform: translateY(0);
}

/* 遮罩层样式 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 历史记录卡片激活状态 */
.history-card {
    position: relative;
    z-index: 1;
    transition: all 0.3s ease, z-index 0s;
}

.history-card.active {
    z-index: 101;
    transform: scale(1.02);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

/* 修改卡片标题区域样式 */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card-header h2 {
    margin: 0;
    padding-right: 0;
    font-size: 16px;
    flex: 1;
}

/* 调整状态标签样式 */
.status-badge {
    position: static;  /* 移除绝对定位 */
    margin-left: 10px;
}

/* 调整卡片内容布局 */
.card-front h2 {
    margin-top: 0;  /* 移除顶部边距 */
}

/* 页脚样式 */
.footer {
    background: #fff;
    padding: 40px 0 20px;
    margin-top: 60px;
    border-top: 1px solid #eef0f5;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
}

.footer-section {
    padding: 0 20px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.logo-img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-size: 18px;
    font-weight: 500;
    color: #2c3e50;
}

.footer-description {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.footer-section h3 {
    color: #2c3e50;
    font-size: 16px;
    margin-bottom: 16px;
}

.footer-links,
.footer-contact {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li,
.footer-contact li {
    margin-bottom: 8px;
}

.footer-links a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #1a73e8;
}

.footer-contact li {
    color: #666;
    font-size: 14px;
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eef0f5;
}

.footer-bottom p {
    color: #999;
    font-size: 13px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-section {
        padding: 0;
        text-align: center;
    }

    .footer-logo {
        justify-content: center;
    }
}

#password-input.error {
    border-color: #dc2626 !important;
    animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

@keyframes shake {
    10%, 90% {
        transform: translate3d(-1px, 0, 0);
    }
    
    20%, 80% {
        transform: translate3d(2px, 0, 0);
    }

    30%, 50%, 70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%, 60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* 联系信息弹窗样式 */
.contact-dialog {
    width: 360px;
    text-align: center;
}

.contact-info {
    background: #f5f7fa;
    border-radius: 16px;
    padding-left: 25px;
    margin: 20px 0;
}

.info-row {
    display: flex;
    flex-direction: column;
}

.info-item {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
}
.info-value {
    font-size: 15px;
    font-weight: 500;
    color: #2c3e50;
    padding: 12px 24px;
    border-radius: 12px;
}

.info-label {
    font-size: 15px;
    font-weight: 500;
    color: #888888;
}

.modal-buttons {
    justify-content: center;
}

