body {
  font-family: 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  background-color: #f4f6f9;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
  min-height: 100vh;
  min-width: 1340px; /* 추가: body 최소 너비 설정 */
}

#result {
    position: relative;
}

h2 {
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
}

.top-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.title-box{
    width:100%;
}

.login-box {
    background-color: #fff;
    padding: 30px 40px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    box-sizing: border-box;
}

.login-box input {
    width: 100%;
    padding: 12px 15px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.login-box button {
    width: 100%;
    padding: 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

.login-box button:hover {
    background-color: #2980b9;
}

.result-box {
  margin-top: 20px;
  width: 100%;
  max-width: 1300px;
  min-width: 1300px; /* 추가: 최소 너비 보장 */
  background-color: #fff;
  padding: 25px 30px;
  border-radius: 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
  overflow-x: auto; /* 추가: 가로 스크롤 허용 */
}

.account-section {
  margin-top: 25px;
  display: flex;
  flex-wrap: nowrap; /* 줄바꿈 방지 */
  gap: 20px;
  justify-content: space-between; /* 균등 분배 */
  align-items: flex-start;
}

.account-box,
div#downloadArea {
  width: calc(25% - 15px); /* 4개 박스, 간격 고려 */
  min-width: 250px; /* 최소 너비 보장 */
  max-width: 300px; /* 최대 너비 제한 */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* 메모 박스도 동일한 너비 적용 */
.memo-box {
  width: calc(25% - 15px);
  min-width: 250px;
  max-width: 300px;
}

.field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.field-label {
    font-weight: bold;
    color: #34495e;
    font-size: 17px;
}

.field-group {
    margin-top: 10px;
}

.field-group label {
    display: block;
    font-size: 14px;
    margin-bottom: 5px;
    color: #555;
}

.editable-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.editable {
    padding: 10px;
    background-color: #fefefe;
    border: 1px solid #ccc;
    border-radius: 6px;
    flex: 1;
    font-size: 13px;
    min-width: 120px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.memo-area {
    min-height: 100px;
    margin-top: 20px;
}

.copy-btn {
    padding: 6px 10px;
    font-size: 13px;
    background-color: #eee;
    border: 1px solid #bbb;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.copy-btn:hover {
    background-color: #ddd;
}

.save-btn {
    margin-top: 20px;
    padding: 8px 14px;
    background-color: #2ecc71;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.save-btn:hover {
    background-color: #27ae60;
}

.link-button {
    font-size: 13px;
    padding: 6px 10px;
    background-color: #eee;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    border: 1px solid #bbb;
}

.link-button:hover {
    background-color: #ccc;
}

.header-box{
  display:flex;
  justify-content:space-between; /* 좌·우 끝으로 배치 */
  align-items:center;            /* 세로 중앙 정렬 */
  gap:15px;                      /* 요소 간 기본 간격 */
}

/* 인라인 스타일 대신 클래스 사용 권장 */
.greeting{
  margin:0;                      /* 아래 여백 제거 */
  font-size:16px;
}

/* 버튼 그룹 */
.header-actions{
  display:flex;
  gap:10px;                      /* 버튼 사이 여백 */
  margin-bottom:10px;
}

.notice-box {
    margin-bottom: 25px;
    padding: 15px;
    background-color: #fef8e7;
    border-left: 5px solid #f1c40f;
    border-radius: 10px;
    color: #555;
    width: 100%;
    max-width: 400px;
    margin: 10px auto;
    box-sizing: border-box;
    flex: 1;
    min-width: 250px;
}

.back-btn {
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 6px;
    background-color: #95a5a6 !important;
    color: white;
    border: none;
    cursor: pointer;
}

.back-btn:hover {
    background-color: #7f8c8d !important;
}

.notice-box.red {
    border-left-color: #e74c3c;
    background-color: #fdecea;
}

.notice-box.yellow {
    border-left-color: #f1c40f;
    background-color: #fff9e6;
}

.notice-box.blue {
    border-left-color: #3498db;
    background-color: #eaf4fd;
}

.notices-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.notice-box p {
    white-space: normal;
    overflow-wrap: break-word;
}

.login-box input[type="text"],
.login-box input[type="password"],
.login-box button {
    width: 100%;
    display: block;
    margin: 10px auto;
    box-sizing: border-box;
}

.editable:empty::before {
    content: attr(data-placeholder);
    color: #aaa;
    font-style: italic;
}

.change-btn.red {
    margin-top: 20px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 14px;
    cursor: pointer;
}

.change-btn.red:hover {
    background-color: #c0392b;
}

.change-btn {
    padding: 10px 20px;
    border-radius: 6px;
    background-color: #8e44ad;
    color: white;
    border: none;
    font-size: 14px;
    cursor: pointer;
}

.change-btn:hover {
    background-color: #732d91;
}

.result-box input[type="password"] {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.copy-container {
    display: inline-block;
    position: relative;
}

.header-btn {
    margin-top: 10px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    border-width: initial;
    border-style: none;
    border-color: initial;
    border-image: initial;
    border-radius: 6px;
    padding: 8px 16px;
}

.score-section {
    margin: 20px 10px 5px 10px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background-color: #f9f9f9;
}

.score-title {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 16px;
    color: #333;
}

.score-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
}

.score-item {
    width: 48%;
    gap: 30px;
    display: flex;
    height: 22px;
    min-width: 180px;
}

.score-name {
    font-weight: 500;
}

.score-value {
    color: #666;
}

.google-btn-group,
.entry-btn-group {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.upload-download-section {
    margin-top: 30px;
    padding: 25px;
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    display: flex;
    gap: 40px;
    justify-content: space-around;
    flex-wrap: wrap;
}

.upload-box label,
.download-box label {
    font-weight: bold;
    color: #2c3e50;
    font-size: 16px;
    margin-bottom: 10px;
    display: block;
}

.upload-box input[type="file"] {
    display: block;
    margin-top: 8px;
    margin-bottom: 10px;
    width: 100%;
}

.upload-box button {
    padding: 10px 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.upload-box button:hover {
    background-color: #2980b9;
}

.download-box ul {
    list-style: none;
    padding: 0;
}

.download-box li {
    margin-bottom: 8px;
}

.download-box a {
    color: #2980b9;
    text-decoration: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.download-box a:hover {
    text-decoration: underline;
}

.card-box {
    background-color: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 40px;
}

.upload-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.upload-btn:hover {
    background-color: #2c80b4;
}

.file-link {
    color: #2980b9;
    text-decoration: underline;
}

.file-area-wrapper {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.account-section {
    flex: 4;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: stretch;
    min-width: 280px;
}

.download-wrapper {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

.card-box.fade-in {
    width: 200px;
    height: 100px;
    padding: 15px;
}

.upload-top-right {
    width: 280px;
    background-color: white;
    padding: 16px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    height:150px;
    box-sizing: border-box;
}

/* ③ 한 행에 정렬 */
.top-bar{
  width:100%;
  max-width:1300px;      /* result-box 폭과 맞춤 */
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:20px;    /* 아래 콘텐츠와 간격 */
}

/* ④ 타이틀 약간 왼쪽으로 이동(시각적 가운데) */
.top-bar .title{
  margin:0;
  padding-left:10px;     /* 필요에 따라 값 조정 */
  font-size:22px;
  font-weight:700;
}

.drop-zone {
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px dashed #ccc;
    padding: 20px;
    cursor: pointer;
    border-radius: 10px;
    background-color: #fdfdfd;
    transition: background-color 0.2s ease;
    height: 30px;
    position: relative;
    text-align: center;
    overflow: hidden;
}

.drop-zone.dragover {
    background-color: #f0f8ff;
}

.drop-zone span {
    font-size: 14px;
    color: #666;
    z-index: 1;
}

.drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.upload-header .field-label {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
}

.download-box {
  max-height: 250px; /* 높이 증가 */
  overflow-y: auto;
}

.download-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 221px;
    height: 221px;
    overflow-y: auto;
    padding-right: 10px;
}

.download-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f4f8fb;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.download-item:hover {
    background-color: #eaf4fa;
}

.download-item a {
    color: #007acc;
    text-decoration: none;
    font-size: 14px;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.download-item button {
    background-color: transparent;
    border: none;
    color: #888;
    font-size: 16px;
    cursor: pointer;
    margin-left: 8px;
    transition: color 0.2s;
}

.download-item.hovered {
    background-color: #ffe6e6;
}

.download-list::-webkit-scrollbar {
    width: 6px;
}

.download-list::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 3px;
}

/* 반응형 수정 - 1340px 이하에서만 적용 */
@media (max-width: 1340px) {
  body {
    min-width: 280px;
  }
  
  .result-box {
    min-width: auto;
    max-width: 100%;
  }
  
  .account-section {
    flex-wrap: wrap;
    justify-content: space-evenly;
  }
  
  .account-box,
  div#downloadArea,
  .memo-box {
    width: 275px;
    min-width: 200px;
    max-width: none;
  }
}

/* 880px 이하에서 수행평가 한 줄에 하나씩 표시 */
@media (max-width: 880px) {
    .score-item {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 750px) {
    /* 1) 타이틀과 업로드 영역을 한 줄에서 → 두 줄로 */
    .top-bar{                 /* 기존 : display:flex; */
        flex-direction: column;   /* 세로로 쌓기 */
        align-items: center;      /* 가운데 정렬 */
        gap: 12px;                /* 위·아래 간격 약간 */
    }

    /* 2) 타이틀 가운데 정렬(좌측 padding 제거) */
    .top-bar .title{
        padding-left: 0;
        text-align: center;
        width: 100%;
    }

    /* 3) 업로드 박스(=uploadArea) 가운데 배치 */
    .upload-top-right{        /* 또는 #uploadArea, 실제 클래스/ID에 맞춰 변경 */
        width: 100%;
        margin: 0 auto;       /* 좌우 자동 → 수평 중앙 */
        float: none;          /* 혹시 남아 있는 float 제거 */
    }
    .top-box{
        display:block;

    }
}

@media (max-width: 700px) {
    .header-box{
        display:block;
    }
}
/* 480px 이하 */
@media (max-width: 480px) {
    body {
        padding: 10px;
        min-width: 280px;
    }
    
    .login-box {
        padding: 15px 20px;
        margin: 0 5px;
    }
    
    .result-box {
        padding: 15px;
    }
    
    .account-section {
        gap: 10px;
        margin-top: 15px;
        justify-content: center;
    }
    
    .account-box,
    div#downloadArea,
    .memo-box {
        width: 100%;
        max-width: 100%;
        min-width: 260px;
    }
    
    .notice-box {
        min-width: 260px;
        margin: 8px 0;
    }
    
    /* 1. div.editable 넘침 문제 해결 */
    .editable-wrap {
        align-items: stretch;
        gap: 8px;
    }
    
    .editable {
        min-width: auto;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* 2. 초대코드 버튼 크기 원래대로 유지 */
    .copy-btn . {
        width: auto;
        align-self: flex-start;
        white-space: nowrap;
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .save-btn,
    .change-btn,
    .header-btn {
        width: 100%;
        text-align: center;
        padding: 10px;
        white-space: normal;
    }
    
    /* 엔트리, 구글 버튼 그룹을 세로로 배치하되 버튼 크기는 유지 */
    .google-btn-group,
    .entry-btn-group {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    /* 엔트리, 클래스룸 바로가기 버튼들은 원래 크기를 유지 */
    .google-btn-group .link-button,
    .entry-btn-group .link-button {
        width: auto;
        align-self: flex-start;
        white-space: nowrap;
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .score-list {
        flex-direction: column;
        gap: 8px;
    }
    
    /* 4. score-item에서 flex-direction 속성 삭제 */
    .score-item {
        width: 100%;
        height: auto;
        align-items: flex-start;
        gap: 5px;
        min-width: auto;
    }
    
    .upload-download-section {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .file-area-wrapper {
        flex-direction: column;
        gap: 15px;
    }
    
    .download-wrapper {
        max-width: 100%;
        min-width: auto;
    }

    .card-box.fade-in {
        width: 100%;
        height: auto;
    }
    
    /* 3. 모바일에서 타이틀 글씨 크기 조정 */
    .field-label {
        font-size: 15px;
    }
    
    .score-title{
        font-size: 14px;
    }
    .score-name{
        font-size: 14px;
    }
    .score-value{
        font-size: 14px;
    }
}

/* 380px 이하 */
@media (max-width: 380px) {
    body {
        padding: 8px;
        min-width: 280px;
    }
    
    .login-box,
    .result-box {
        padding: 12px 15px;
    }
    
    .account-box,
    div#downloadArea,
    .memo-box,
    .notice-box {
        min-width: 250px;
    }
    
    .field-label {
        font-size: 14px;
    }
    
    .score-title {
        font-size: 13px;
    }
    
    .editable {
        font-size: 12px;
        padding: 8px;
    }
    
    .copy-btn,
    .save-btn,
    .change-btn {
        font-size: 12px;
        padding: 8px;
    }
    
    h2 {
        font-size: 18px;
        margin-bottom: 15px;
    }
}

/* 320px 이하 */
@media (max-width: 320px) {
    body {
        padding: 5px;
        min-width: 280px;
    }
    
    .login-box,
    .result-box {
        padding: 10px 12px;
        margin: 0 1px;
    }
    
    .account-box,
    div#downloadArea,
    .memo-box,
    .notice-box {
        min-width: 240px;
    }
    
    .notice-box {
        padding: 10px;
        margin: 5px 0;
    }
    
    .field-label {
        font-size: 13px;
    }
    
    .score-title {
        font-size: 12px;
    }
    
    .editable {
        font-size: 11px;
        padding: 6px;
    }
    
    .copy-btn,
    .save-btn,
    .change-btn {
        font-size: 11px;
        padding: 6px;
    }
    
    h2 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .upload-download-section {
        padding: 10px;
    }
}

/* ───────────────────────────────────────
   좁은 화면(≤480px) - 헤더 옆 버튼 정렬 및 복사 버튼 높이  맞춤
─────────────────────────────────────── */
@media (max-width:480px) {

    /* 1-A. “엔트리 / Google” 헤더 + 버튼 한 줄 정렬 */
    .field-header{               /* 헤더 래퍼 */
        display:flex;
        flex-direction:row;      /* 가로 배치 */
        align-items:center;
        gap:6px;
        flex-wrap:nowrap;
    }

    /* 1-B. 버튼 그룹(초대코드·엔트리 바로가기 등)을 가로로 */
    .entry-btn-group,
    .google-btn-group{
        display:flex !important; /* 세로 정렬 규칙 덮어쓰기 */
        flex-direction:row;
        gap:6px;
        flex-wrap:nowrap;
    }

    /* 1-C. 각 링크 버튼 크기 고정(너비 최소화) */
    .entry-btn-group .link-button,
    .google-btn-group .link-button{
        width:auto;
        padding:6px 10px;
        font-size:13px;
        white-space:nowrap;
    }

    /* 2. ‘복사’ 버튼을 입력창 세로 높이에 맞춤 */
    .editable-wrap > .copy-btn{
        height:41px;             /* 입력창(약 36-40px)과 맞춤 */
        padding:0 12px;
        display:flex;
        align-items:center;
        justify-content:center;
        line-height:normal;      /* 텍스트 중앙 정렬 */
        flex-shrink:0;
    }

    .account-box{
        margin-bottom:15px;
    }
}
