/* style.css */
body {
    font-family: 'Noto Sans SC', sans-serif, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}

header {
    background-color: #4CAF50;
    color: white;
    padding: 1em 0;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 500;
}

#last-updated {
    font-size: 0.9em;
    margin-top: 5px;
    color: #e0e0e0;
}

.status-message { /* 用于加载中、错误等消息 */
    text-align: center;
    padding: 15px;
    font-weight: bold;
    color: #555;
    background-color: #fffbcc;
    border: 1px solid #f0e68c;
    border-radius: 4px;
    margin: 10px auto;
    max-width: 860px; /* 与 data-container 差不多宽 */
}


main#data-container {
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.loading-message { /* 初始加载提示 */
    text-align: center;
    font-size: 1.2em;
    color: #555;
    padding: 20px;
    grid-column: 1 / -1; /* 如果网格已激活，让它横跨所有列 */
}

.data-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    display: flex; /* 使用 Flexbox 进行内部布局 */
    flex-direction: column; /* 垂直排列子元素 */
    justify-content: space-between; /* 分散对齐，时间在底部 */
}

.data-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.data-card .content-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px; /* 为下方的时间留出空间 */
}

.data-card .content {
    font-size: 1.3em;
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 0; /* 移除 h2 的默认底部边距 */
    font-weight: 500;
    flex-grow: 1; /* 允许内容区域扩展 */
    word-break: break-word; /* 长单词换行 */
}

.data-card .create-time {
    font-size: 0.9em;
    color: #7f8c8d;
    margin-bottom: 0;
    margin-top: auto; /* 将时间推到底部 (如果卡片高度不一致时更明显) */
}

.copy-button {
    background-color: #5cb85c; /* 更鲜亮的绿色 */
    color: white;
    border: none;
    padding: 6px 12px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 0.85em;
    margin-left: 10px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease-in-out, opacity 0.2s;
    flex-shrink: 0; /* 防止按钮被压缩 */
}

.copy-button:hover {
    background-color: #4cae4c;
}

.copy-button:active {
    background-color: #3e8e41;
}

.copy-button:disabled {
    background-color: #d9edf7; /* 复制成功后的颜色 */
    color: #31708f;
    cursor: default;
    opacity: 0.8;
}

footer {
    text-align: center;
    padding: 20px;
    background-color: #333;
    color: #f4f7f6;
    margin-top: 30px;
}

/* --- Toast 提示样式 --- */
.toast {
    visibility: hidden; /* 默认隐藏 */
    min-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 16px;
    position: fixed; /* 固定在屏幕上 */
    z-index: 100;
    left: 50%;
    transform: translateX(-50%); /* 水平居中 */
    bottom: 30px; /* 距离底部 30px */
    font-size: 17px;
    opacity: 0; /* 默认完全透明 */
    transition: opacity 0.5s, visibility 0.5s, bottom 0.5s; /* 添加过渡效果 */
}

/* Toast 成功和失败的样式 */
.toast.success {
    background-color: #4CAF50; /* 成功-绿色 */
}
.toast.error {
    background-color: #f44336; /* 失败-红色 */
}


/* 显示 Toast 时的动画效果 */
.toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 50px; /* 向上移动一点以示出现 */
}


@media (max-width: 600px) {
    header h1 {
        font-size: 1.5em;
    }
    main#data-container {
        padding: 10px;
        gap: 10px;
        grid-template-columns: 1fr; /* 在小屏幕上单列显示 */
    }
    .data-card {
        padding: 15px;
    }
    .data-card .content {
        font-size: 1.1em;
    }
    .copy-button {
        padding: 5px 8px;
        font-size: 0.8em;
    }
    .toast { /* 移动端Toast位置调整 */
        min-width: calc(100% - 40px);
        left: 20px;
        transform: none;
        bottom: 20px;
    }
    .toast.show {
        bottom: 40px;
    }
}