/* 手机版文本管理系统样式 - 专为老年人优化 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.8;
    color: #333;
    background-color: #f8f9fa;
    padding: 0;
    margin: 0;
    font-size: 16px;
}

.container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    min-height: 100vh;
    background: #fff;
    padding: 15px;
    box-shadow: none;
}

header {
    background-color: #3498db;
    color: white;
    padding: 15px;
    margin-bottom: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.back-home {
    background-color: #2980b9;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.back-home:hover {
    background-color: #1f6dad;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

h1 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
    padding-bottom: 12px;
    border-bottom: 3px solid #2c5f2d;
    font-size: 2em;
    font-weight: bold;
}

h2 {
    color: #34495e;
    margin: 15px 0;
    font-size: 1.5em;
    font-weight: bold;
}

/* 表单样式 */
.form-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.form-group {
    flex: 100%;
    min-width: 100%;
}

.full-width {
    flex: 100%;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 18px;
    color: #333;
}

input[type="text"],
select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 18px;
    background-color: #fff;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 18px;
    min-height: 250px;
    resize: vertical;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
}

button {
    padding: 12px 20px;
    background-color: #2980b9;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s;
    margin-top: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

button:hover {
    background-color: #1f6dad;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

button[type="submit"] {
    background: #27ae60;
}

button[type="submit"]:hover {
    background: #229954;
}

/* 表格样式 */
.table-section {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

/* 隐藏表头 */
table thead {
    display: none;
}

/* 表格行样式 */
table tr {
    display: block;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 隐藏不需要的列 */
table td:nth-child(1),  /* ID列 */
table td:nth-child(2),  /* 分类列 */
table td:nth-child(6),  /* 添加时间列 */
table td:nth-child(7)   /* 更新时间列 */
{
    display: none;
}

/* 信息列样式 */
table td:nth-child(3) {
    display: block;
    margin-bottom: 15px;
}

/* 文本内容样式 */
.text-content {
    width: 100%;
}

.text-content span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    max-width: 100%;
}

/* 隐藏文本内容中的复制按钮 */
.text-content .copy-btn {
    display: none;
}

/* 复制次数列样式 */
table td:nth-child(4) {
    display: inline-block;
    vertical-align: middle;
    margin-right: 10px;
}

.copy-count-value {
    padding: 0 16px;
    border-radius: 6px;
    font-weight: bold;
    color: white;
    display: inline-flex;
    font-size: 14px;
    min-width: 60px;
    text-align: center;
    height: 40px;
    align-items: center;
    justify-content: center;
}

/* 状态列样式 */
table td:nth-child(5) {
    display: inline-block;
    vertical-align: middle;
    margin-right: 10px;
}

.status-icon {
    color: white;
    font-size: 16px;
    font-weight: bold;
    background-color: #27ae60;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.copy-green {
    background-color: #2ecc71;
}

.copy-yellow {
    background-color: #f1c40f;
}

.copy-red {
    background-color: #e74c3c;
}

/* 操作列样式 */
table td:nth-child(8) {
    display: inline-block;
    vertical-align: middle;
}

.action-buttons {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    height: 100%;
}

/* 复制按钮和编辑按钮样式 */
.copy-btn,
.btn-edit {
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    font-size: 14px;
    vertical-align: middle;
}

.btn-edit {
    background: #f39c12;
    border-radius: 6px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-edit:hover {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.btn-delete {
    display: none;
}

/* 复制按钮样式 */
.copy-btn {
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.copy-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* 调整复制次数、状态和操作按钮的布局 */
table tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    position: relative;
}

table td:nth-child(3) {
    flex: 100%;
}

table td:nth-child(4),
table td:nth-child(5),
table td:nth-child(8) {
    flex: none;
    display: flex;
    align-items: center;
}

table td:nth-child(4) {
    order: 2;
    margin-right: 10px;
}

table td:nth-child(5) {
    order: 1;
    margin-right: 10px;
}

table td:nth-child(8) {
    order: 3;
}

.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 消息提示 */
.message {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 18px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.success {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

/* 链接 */
.back-link {
    display: inline-block;
    margin-top: 20px;
    color: #2c5f2d;
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
    padding: 10px 15px;
    border-radius: 6px;
    background-color: #f8f9fa;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.back-link:hover {
    text-decoration: underline;
    color: #3e7c3f;
    background-color: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* 添加按钮样式 */
.add-button {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    background-color: #3498db;
    color: white;
    border: none;
    cursor: pointer;
}

.add-button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* 模态框样式 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    width: 95%;
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
    font-weight: bold;
}

.close-modal {
    font-size: 32px;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
}

.close-modal:hover {
    color: #333;
    transform: none;
}

.modal-overlay .form-group {
    margin-bottom: 20px;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 25px;
}

.cancel-btn {
    padding: 12px 20px;
    background-color: #f5f5f5;
    color: #333;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cancel-btn:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* 调试信息 */
.debug-info {
    background-color: #f8f9fa;
    padding: 15px;
    margin-top: 20px;
    border-radius: 8px;
    font-family: monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 14px;
    border: 1px solid #e9ecef;
}

/* 自定义确认对话框样式 */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1100;
}

.confirm-content {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.confirm-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.confirm-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
    font-weight: bold;
}

.confirm-body {
    margin-bottom: 25px;
}

.confirm-body p {
    margin: 0;
    color: #555;
    font-size: 18px;
    line-height: 1.6;
}

.confirm-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.confirm-btn {
    padding: 12px 20px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.confirm-btn:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* 右上角提示框样式 */
.notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #4CAF50;
    color: white;
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    font-size: 18px;
    font-weight: bold;
    animation: slideInRight 0.3s ease-out;
    opacity: 1;
    display: none;
    transition: opacity 0.5s ease-out;
}

/* 动画 */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-toast.auto-dismiss {
    animation: slideInRight 0.3s ease-out forwards, notificationHide 0.5s ease-in forwards 3s;
}

@keyframes notificationHide {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* 动画结束后自动隐藏元素 */
.notification-toast.auto-dismiss {
    animation-fill-mode: forwards;
}

/* 过滤选择器样式 */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="%23333" d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

/* 优化过滤器和按钮布局 */
div[style*="display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;"] {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
}

select {
    width: 100%;
    max-width: 100%;
    padding: 12px;
    font-size: 16px;
    border-radius: 8px;
}

/* 优化按钮组布局 */
div[style*="display: flex; gap: 10px; align-items: center;"] {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.add-button {
    width: 100%;
    text-align: center;
    padding: 12px 20px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px;
}

.back-home {
    width: 100%;
    text-align: center;
    padding: 12px 20px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px;
}

/* 响应式调整 */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    header {
        padding: 12px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    h2 {
        font-size: 1.3em;
    }
    
    .form-section {
        padding: 15px;
    }
    
    input[type="text"],
    select,
    textarea {
        padding: 10px;
        font-size: 16px;
    }
    
    button {
        padding: 10px 16px;
        font-size: 16px;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .confirm-content {
        padding: 20px;
    }
    
    .notification-toast {
        padding: 15px 20px;
        font-size: 16px;
    }
    
    /* 底部信息行样式 */
    .table-row-bottom {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .copy-count-container,
    .status-container {
        flex: 0 0 auto;
    }
    
    .action-buttons {
        flex: 1 1 100%;
        justify-content: flex-start;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    body {
        background-color: #000;
        color: #fff;
    }
    
    .container {
        background: #111;
    }
    
    .form-section {
        background: #222;
    }
    
    input[type="text"],
    select,
    textarea {
        background-color: #333;
        color: #fff;
        border-color: #555;
    }
    
    table tr {
        background-color: #222;
        border-color: #444;
    }
}

/* 减少动画支持 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}