body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0.625em;
    background-color: #f5f5f5;
    font-size: 16px;
}

.container {
    width: 100%;
    max-width: 75em;
    margin: 0 auto;
    background-color: #fff;
    padding: 1.25em;
    border-radius: 0.3125em;
    box-shadow: 0 0 0.625em rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25em;
    padding-bottom: 0.625em;
    border-bottom: 0.0625em solid #eee;
    flex-wrap: wrap;
}

.header h1 {
    margin: 0 0 0.625em 0;
    font-size: 1.5em;
}


.month-section {
    margin-bottom: 1.875em;
}

.month-title {
    background-color: #f0f0f0;
    padding: 0.625em;
    margin-bottom: 0.625em;
    border-radius: 0.1875em;
    font-weight: bold;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.5em;
    text-align: left;
    border-bottom: 0.0625em solid #eee;
}

th {
    background-color: #f8f8f8;
}

.file-link {
    color: #0066cc;
    text-decoration: none;
    margin-right: 0.625em;
    display: inline-block;
}

.file-link:hover {
    text-decoration: underline;
}

.preview-link {
    color: #27ae60;
    text-decoration: none;
    margin-right: 0.625em;
    display: inline-block;
}

.preview-link:hover {
    text-decoration: underline;
}

.logout-link {
    color: #666;
    text-decoration: none;
    padding: 0.3125em 0.625em;
    background-color: #f0f0f0;
    border-radius: 0.1875em;
    display: inline-block;
}

.logout-link:hover {
    background-color: #e0e0e0;
}

.empty-message {
    padding: 1.25em;
    text-align: center;
    color: #888;
}

.user-info {
    font-size: 0.875em;
    color: #666;
    margin-right: 0.9375em;
    margin-bottom: 0.3125em;
}

.file-icon {
    font-size: 1.2em;
    margin-right: 0.3125em;
}

.login-container {
    max-width: 25em;
    width: 90%;
    margin: 3.125em auto;
    background: white;
    padding: 1.25em;
    border-radius: 0.3125em;
    box-shadow: 0 0.125em 0.625em rgba(0,0,0,0.1);
    box-sizing: border-box;
}

h1 {
    margin-top: 0;
    color: #333;
    font-size: 1.5em;
}

.form-group {
    margin-bottom: 0.9375em;
}

label {
    display: block;
    margin-bottom: 0.3125em;
    font-weight: bold;
}

input[type="text"], input[type="password"] {
    width: 100%;
    padding: 0.5em;
    box-sizing: border-box;
    border: 0.0625em solid #ddd;
    border-radius: 0.25em;
}

button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 0.625em 0.9375em;
    border-radius: 0.25em;
    cursor: pointer;
    font-size: 0.9375em;
}

button:hover {
    background-color: #45a049;
}

.error-message {
    color: #f44336;
    margin-bottom: 0.9375em;
}

/* 模态预览 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
}

.modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 2% auto;
    padding: 0;
    width: 95%;
    max-width: 75em;
    height: 90%;
    border-radius: 0.3125em;
    box-shadow: 0 0.25em 0.5em rgba(0,0,0,0.2);
}

.close-modal {
    position: absolute;
    top: 0.625em;
    right: 1.25em;
    color: #333;
    font-size: 1.75em;
    font-weight: bold;
    z-index: 1001;
    cursor: pointer;
}

.preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0.3125em;
}

.preview-title {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 0.625em 1.25em;
    background-color: #f8f8f8;
    border-bottom: 0.0625em solid #ddd;
    text-align: center;
    font-weight: bold;
    border-top-left-radius: 0.3125em;
    border-top-right-radius: 0.3125em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-container {
    padding-top: 2.5em;
    height: calc(100% - 2.5em);
}

.excel-preview-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-card {
    background-color: white;
    border-radius: 0.5em;
    box-shadow: 0 0.25em 1em rgba(0,0,0,0.1);
    max-width: 37.5em;
    width: 90%;
    padding: 1.875em;
    text-align: center;
    box-sizing: border-box;
}

.file-icon {
    font-size: 4.5em;
    color: #27ae60;
    margin-bottom: 1.25em;
}

.file-name {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 1.25em;
    word-break: break-all;
}

.file-info {
    margin-bottom: 1.5625em;
    color: #666;
    font-size: 0.875em;
}

.info-item {
    margin-bottom: 0.5em;
}

.preview-message {
    margin: 1.25em 0;
    padding: 0.9375em;
    background-color: #f8f9fa;
    border-radius: 0.25em;
    border-left: 0.25em solid #27ae60;
    text-align: left;
    font-size: 0.875em;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 0.9375em;
    margin-top: 1.5625em;
    flex-wrap: wrap;
}

.button {
    display: inline-block;
    padding: 0.625em 1.25em;
    border-radius: 0.25em;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s;
    cursor: pointer;
    margin-bottom: 0.3125em;
}

.download-btn {
    background-color: #27ae60;
    color: white;
}

.download-btn:hover {
    background-color: #219653;
}

.close-btn {
    background-color: #e0e0e0;
    color: #333;
}

.close-btn:hover {
    background-color: #d0d0d0;
}


@media (max-width: 768px) {
    body {
        padding: 2vw;
        font-size: 4vw;
    }

    .container {
        padding: 3vw;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 4vw;
        padding-bottom: 3vw;
    }

    .header h1 {
        margin-bottom: 3vw;
        font-size: 5.5vw;
    }

    .header div {
        margin-top: 2vw;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .logout-link {
        margin-top: 2vw;
        padding: 2vw 3vw;
        font-size: 3.5vw;
    }

    .user-info {
        font-size: 3.2vw;
        margin-bottom: 1vw;
    }

    .month-title {
        padding: 2.5vw;
        margin-bottom: 2vw;
        font-size: 4.5vw;
    }

    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        border: 0.3vw solid #ccc;
        margin-bottom: 3vw;
        border-radius: 1vw;
    }

    td {
        border: none;
        border-bottom: 0.3vw solid #eee;
        position: relative;
        padding-left: 40%;
        min-height: 6vw;
        padding-top: 3vw;
        padding-bottom: 3vw;
        font-size: 3.7vw;
    }

    td:before {
        position: absolute;
        top: 3vw;
        left: 2vw;
        width: 35%;
        padding-right: 2vw;
        white-space: nowrap;
        font-weight: bold;
        font-size: 3.5vw;
    }

    td:nth-of-type(1):before { content: "種類"; }
    td:nth-of-type(2):before { content: "ファイル名"; }
    td:nth-of-type(3):before { content: "サイズ"; }
    td:nth-of-type(4):before { content: "日付"; }
    td:nth-of-type(5):before { content: "操作"; }

    .file-link, .preview-link {
        margin-bottom: 2vw;
        display: inline-block;
        padding: 1.5vw;
        font-size: 3.5vw;
    }

    .month-section {
        margin-bottom: 5vw;
    }

    .empty-message {
        padding: 4vw;
        font-size: 3.7vw;
    }

    .file-icon {
        font-size: 9vw;
        margin-bottom: 3vw;
    }

    .login-container {
        width: 85%;
        margin: 10vw auto;
        padding: 5vw;
    }

    .login-container h1 {
        font-size: 6vw;
        margin-bottom: 5vw;
    }

    .form-group {
        margin-bottom: 4vw;
    }

    label {
        margin-bottom: 2vw;
        font-size: 4vw;
    }

    input[type="text"], input[type="password"] {
        padding: 3vw;
        font-size: 4vw;
        border-radius: 1vw;
    }

    button {
        padding: 3vw 5vw;
        font-size: 4vw;
        border-radius: 1vw;
    }

    .error-message {
        font-size: 3.5vw;
        margin-bottom: 4vw;
    }

    .modal-content {
        width: 95vw;
        height: 90vh;
        margin: 5vh auto;
    }

    .close-modal {
        top: 2vw;
        right: 4vw;
        font-size: 7vw;
    }

    .preview-title {
        padding: 3vw;
        font-size: 4vw;
    }

    .preview-container {
        padding-top: 10vw;
        height: calc(100% - 10vw);
    }

    .preview-card {
        width: 90vw;
        max-width: none;
        padding: 5vw;
    }

    .file-name {
        font-size: 5vw;
        margin-bottom: 3vw;
    }

    .file-info {
        font-size: 3.5vw;
        margin-bottom: 4vw;
    }

    .info-item {
        margin-bottom: 2vw;
    }

    .preview-message {
        padding: 3vw;
        margin: 4vw 0;
        border-left: 1vw solid #27ae60;
        font-size: 3.5vw;
    }

    .action-buttons {
        gap: 3vw;
        margin-top: 5vw;
    }

    .button {
        padding: 3vw 5vw;
        border-radius: 1vw;
        font-size: 3.8vw;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 1em;
        max-width: 90vw;
    }

    th, td {
        padding: 0.4em;
    }

    .header h1 {
        font-size: 1.8em;
    }

    .preview-card {
        max-width: 80vw;
    }
}